[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andersca at apple.com
andersca at apple.com
Wed Dec 22 14:32:07 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ff784980b2211c64e0d27df92d529231e84bf318
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 12 21:00:41 2010 +0000
Add FindController class
https://bugs.webkit.org/show_bug.cgi?id=47555
Reviewed by Sam Weinig.
WebCore:
Export Page::findString.
* WebCore.exp.in:
WebKit2:
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
Add new files.
* WebProcess/WebPage/FindController.cpp: Added.
(WebKit::FindController::FindController):
(WebKit::FindController::findString):
Ask WebCore to find the given string for us.
(WebKit::FindController::hideFindUI):
Add stub.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Initialize the find controller.
(WebKit::WebPage::findString):
(WebKit::WebPage::hideFindUI):
Call the find controller.
* win/WebKit2.vcproj:
Add new files.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dce2062..0b6827c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-12 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add FindController class
+ https://bugs.webkit.org/show_bug.cgi?id=47555
+
+ Export Page::findString.
+
+ * WebCore.exp.in:
+
2010-10-12 Alexey Proskuryakov <ap at apple.com>
Reviewed by Simon Fraser.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 9206522..e382a1b 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -545,9 +545,9 @@ __ZN7WebCore46contextMenuItemTagCorrectSpellingAutomaticallyEv
__ZN7WebCore4Font11setCodePathENS0_8CodePathE
__ZN7WebCore4Font18shouldUseSmoothingEv
__ZN7WebCore4Font21setShouldUseSmoothingEb
+__ZN7WebCore4FontaSERKS0_
__ZN7WebCore4FontC1ERKNS_16FontPlatformDataEbNS_17FontSmoothingModeE
__ZN7WebCore4FontC1Ev
-__ZN7WebCore4FontaSERKS0_
__ZN7WebCore4Icon18createIconForFilesERKN3WTF6VectorINS1_6StringELm0EEE
__ZN7WebCore4IconD1Ev
__ZN7WebCore4KURL10invalidateEv
@@ -559,6 +559,7 @@ __ZN7WebCore4Node10renderRectEPb
__ZN7WebCore4Node17stopIgnoringLeaksEv
__ZN7WebCore4Node18startIgnoringLeaksEv
__ZN7WebCore4Node19setNeedsStyleRecalcENS_15StyleChangeTypeE
+__ZN7WebCore4Page10findStringERKN3WTF6StringENS1_19TextCaseSensitivityENS_13FindDirectionEb
__ZN7WebCore4Page12setGroupNameERKN3WTF6StringE
__ZN7WebCore4Page13didStopPluginEPNS_14HaltablePluginE
__ZN7WebCore4Page14didStartPluginEPNS_14HaltablePluginE
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2c25f1f..8ec3de7 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,33 @@
+2010-10-12 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add FindController class
+ https://bugs.webkit.org/show_bug.cgi?id=47555
+
+ * WebKit2.pro:
+ * WebKit2.xcodeproj/project.pbxproj:
+ Add new files.
+
+ * WebProcess/WebPage/FindController.cpp: Added.
+ (WebKit::FindController::FindController):
+ (WebKit::FindController::findString):
+ Ask WebCore to find the given string for us.
+
+ (WebKit::FindController::hideFindUI):
+ Add stub.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ Initialize the find controller.
+
+ (WebKit::WebPage::findString):
+ (WebKit::WebPage::hideFindUI):
+ Call the find controller.
+
+ * win/WebKit2.vcproj:
+ Add new files.
+
2010-10-12 Sam Weinig <sam at webkit.org>
Reviewed by Anders Carlsson.
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index d5f69f7..ef3581b 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -295,6 +295,7 @@ HEADERS += \
WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.h \
WebProcess/WebPage/ChunkedUpdateDrawingArea.h \
WebProcess/WebPage/DrawingArea.h \
+ WebProcess/WebPage/FindController.h \
WebProcess/WebPage/WebEditCommand.h \
WebProcess/WebPage/WebFrame.h \
WebProcess/WebPage/WebPage.h \
@@ -431,6 +432,7 @@ SOURCES += \
WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp \
WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp \
WebProcess/WebPage/DrawingArea.cpp \
+ WebProcess/WebPage/FindController.cpp \
WebProcess/WebPage/WebEditCommand.cpp \
WebProcess/WebPage/WebFrame.cpp \
WebProcess/WebPage/WebPage.cpp \
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 6f0265d..f64fdd3 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -120,6 +120,9 @@
1A8EFA711252B84100F7067F /* PluginProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8EFA6F1252B84100F7067F /* PluginProxyMessages.h */; };
1A8EFDFA1253CAA200F7067F /* DataReference.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8EFDF91253CAA200F7067F /* DataReference.h */; };
1A8EFDFE1253CB6E00F7067F /* DataReference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8EFDFD1253CB6E00F7067F /* DataReference.cpp */; };
+ 1A90C1EE1264FD50003E44D4 /* FindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A90C1ED1264FD50003E44D4 /* FindOptions.h */; };
+ 1A90C1F41264FD71003E44D4 /* FindController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A90C1F21264FD71003E44D4 /* FindController.h */; };
+ 1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A90C1F31264FD71003E44D4 /* FindController.cpp */; };
1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; };
1AA1CD07100FA1BA0078DEBC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */; };
1AA56F2911E92BC80061B882 /* PluginController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA56F2811E92BC80061B882 /* PluginController.h */; };
@@ -578,6 +581,9 @@
1A8EFA6F1252B84100F7067F /* PluginProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProxyMessages.h; sourceTree = "<group>"; };
1A8EFDF91253CAA200F7067F /* DataReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataReference.h; sourceTree = "<group>"; };
1A8EFDFD1253CB6E00F7067F /* DataReference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DataReference.cpp; sourceTree = "<group>"; };
+ 1A90C1ED1264FD50003E44D4 /* FindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindOptions.h; sourceTree = "<group>"; };
+ 1A90C1F21264FD71003E44D4 /* FindController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindController.h; sourceTree = "<group>"; };
+ 1A90C1F31264FD71003E44D4 /* FindController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindController.cpp; sourceTree = "<group>"; };
1AA1C79A100E7FC50078DEBC /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
@@ -1141,6 +1147,7 @@
1A043D78124FEFC100FFBFB5 /* BackingStore.h */,
1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */,
0FB659221208B4DB0044816C /* DrawingAreaBase.h */,
+ 1A90C1ED1264FD50003E44D4 /* FindOptions.h */,
762B7481120BBA0100819339 /* FontSmoothingLevel.h */,
BC3065F91259344E00E71278 /* CacheModel.h */,
BC64696D11DBE603006455B0 /* ImmutableArray.cpp */,
@@ -1304,6 +1311,8 @@
BC5F7BB31182376C0052C02C /* ChunkedUpdateDrawingArea.h */,
BC8452A51162C80900CAB9B5 /* DrawingArea.cpp */,
BC8452A61162C80900CAB9B5 /* DrawingArea.h */,
+ 1A90C1F31264FD71003E44D4 /* FindController.cpp */,
+ 1A90C1F21264FD71003E44D4 /* FindController.h */,
0F5265B111DD37680006D33C /* LayerBackedDrawingArea.cpp */,
0F5265B211DD37680006D33C /* LayerBackedDrawingArea.h */,
BC72B9F811E6476B001EB4EA /* WebBackForwardListProxy.cpp */,
@@ -1994,6 +2003,8 @@
BCC8B374125FB69000DE46A4 /* WKGeometry.h in Headers */,
BC57450C1263B155006F0F12 /* WKBundleNodeHandlePrivate.h in Headers */,
1AC41AC71263C88300054E94 /* BinarySemaphore.h in Headers */,
+ 1A90C1EE1264FD50003E44D4 /* FindOptions.h in Headers */,
+ 1A90C1F41264FD71003E44D4 /* FindController.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2297,6 +2308,7 @@
BCBD3914125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp in Sources */,
1A3DD1FD125E59F3004515E6 /* WebFindClient.cpp in Sources */,
1AC41AC81263C88300054E94 /* BinarySemaphore.cpp in Sources */,
+ 1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit2/WebProcess/WebPage/FindController.cpp b/WebKit2/WebProcess/WebPage/FindController.cpp
new file mode 100644
index 0000000..6ab0e49
--- /dev/null
+++ b/WebKit2/WebProcess/WebPage/FindController.cpp
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "FindController.h"
+
+#include "WebPage.h"
+#include <WebCore/Frame.h>
+#include <WebCore/Page.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+FindController::FindController(WebPage* webPage)
+ : m_webPage(webPage)
+{
+}
+
+static Frame* frameWithSelection(Page* page)
+{
+ for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+ if (frame->selection()->isRange())
+ return frame;
+ }
+
+ return 0;
+}
+
+void FindController::findString(const String& string, FindDirection findDirection, FindOptions findOptions, unsigned maxNumMatches)
+{
+ bool found = m_webPage->corePage()->findString(string, (findOptions & FindOptionsCaseInsensitive) ? TextCaseInsensitive : TextCaseSensitive,
+ findDirection == FindDirectionForward ? WebCore::FindDirectionForward : WebCore::FindDirectionBackward,
+ findOptions & FindOptionsWrapAround);
+
+ Frame* selectedFrame = frameWithSelection(m_webPage->corePage());
+
+ if (!found) {
+ // We didn't find the string, clear all text matches.
+ m_webPage->corePage()->unmarkAllTextMatches();
+
+ // And clear the selection.
+ if (selectedFrame)
+ selectedFrame->selection()->clear();
+
+ return;
+ }
+}
+
+void FindController::hideFindUI()
+{
+ // FIXME: Implement.
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/WebPage/FindController.h b/WebKit2/WebProcess/WebPage/FindController.h
new file mode 100644
index 0000000..479591a
--- /dev/null
+++ b/WebKit2/WebProcess/WebPage/FindController.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FindController_h
+#define FindController_h
+
+#include "FindOptions.h"
+#include <wtf/Forward.h>
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+ class Frame;
+}
+
+namespace WebKit {
+
+class WebPage;
+
+class FindController {
+ WTF_MAKE_NONCOPYABLE(FindController);
+
+public:
+ explicit FindController(WebPage*);
+
+ void findString(const String&, FindDirection, FindOptions, unsigned maxNumMatches);
+ void hideFindUI();
+
+private:
+ WebPage* m_webPage;
+};
+
+} // namespace WebKit
+
+#endif // FindController_h
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 819146f..79ca8c3 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -104,6 +104,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
#elif PLATFORM(WIN)
, m_nativeWindow(parameters.nativeWindow)
#endif
+ , m_findController(this)
, m_pageID(pageID)
{
ASSERT(m_pageID);
@@ -758,14 +759,14 @@ void WebPage::didRemoveEditCommand(uint64_t commandID)
removeWebEditCommand(commandID);
}
-void WebPage::findString(const String&, uint32_t findDirection, uint32_t findOption, uint32_t maxNumMatches)
+void WebPage::findString(const String& string, uint32_t findDirection, uint32_t findOptions, uint32_t maxNumMatches)
{
- // FIXME: Implement.
+ m_findController.findString(string, static_cast<FindDirection>(findDirection), static_cast<FindOptions>(findOptions), maxNumMatches);
}
void WebPage::hideFindUI()
{
- // FIXME: Implement.
+ m_findController.hideFindUI();
}
void WebPage::countStringMatches(const String& string, bool caseInsensitive, uint32_t maxNumMatches)
diff --git a/WebKit2/WebProcess/WebPage/WebPage.h b/WebKit2/WebProcess/WebPage/WebPage.h
index fb5ea5d..49e3f70 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/WebKit2/WebProcess/WebPage/WebPage.h
@@ -28,6 +28,7 @@
#include "APIObject.h"
#include "DrawingArea.h"
+#include "FindController.h"
#include "InjectedBundlePageEditorClient.h"
#include "InjectedBundlePageFormClient.h"
#include "InjectedBundlePageLoaderClient.h"
@@ -213,7 +214,7 @@ private:
void reapplyEditCommand(uint64_t commandID);
void didRemoveEditCommand(uint64_t commandID);
- void findString(const String&, uint32_t findDirection, uint32_t findOption, uint32_t maxNumMatches);
+ void findString(const String&, uint32_t findDirection, uint32_t findOptions, uint32_t maxNumMatches);
void hideFindUI();
void countStringMatches(const String&, bool caseInsensitive, uint32_t maxNumMatches);
@@ -250,6 +251,8 @@ private:
InjectedBundlePageLoaderClient m_loaderClient;
InjectedBundlePageUIClient m_uiClient;
+ FindController m_findController;
+
uint64_t m_pageID;
};
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 56b77cb..0113787 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -1036,6 +1036,14 @@
>
</File>
<File
+ RelativePath="..\WebProcess\WebPage\FindController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\WebProcess\WebPage\FindController.h"
+ >
+ </File>
+ <File
RelativePath="..\WebProcess\WebPage\WebBackForwardListProxy.cpp"
>
</File>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list