Changeset 72937 in webkit
- Timestamp:
- Nov 30, 2010 11:14:56 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r72931 r72937 1 2010-11-30 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/8710645> WebKitTestRunner needs layoutTestController.findString 6 https://bugs.webkit.org/show_bug.cgi?id=50238 7 8 * platform/mac-wk2/Skipped: Removed editing/text-iterator/findString.html. 9 1 10 2010-11-30 Xiaomei Ji <xji@chromium.org> 2 11 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r72930 r72937 1916 1916 printing/page-format-data-display-none.html 1917 1917 1918 # WebKitTestRunner needs layoutTestController.findString <http://webkit.org/b/50238>1919 editing/text-iterator/findString.html1920 1921 1918 # WebKit2 needs support for moving/resizing and querying the location/size the window 1922 1919 fast/dom/Window/window-resize-and-move-arguments.html -
trunk/WebKit2/ChangeLog
r72926 r72937 1 2010-11-30 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 Injected bundle support for <rdar://problem/8710645> WebKitTestRunner needs layoutTestController.findString 6 https://bugs.webkit.org/show_bug.cgi?id=50238 7 8 * Shared/API/c/WKFindOptions.h: Added. Moved the definition of WKFindOptions here from WKPage.h. 9 * Shared/API/c/WKSharedAPICast.h: 10 (WebKit::toFindOptions): Moved from WKAPICast.h. 11 * UIProcess/API/C/WKAPICast.h: 12 * UIProcess/API/C/WKPage.h: 13 * WebKit2.xcodeproj/project.pbxproj: Added WKFindOptions.h. 14 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: 15 (WKBundlePageFindString): Added. 16 * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 17 * WebProcess/WebPage/WebPage.cpp: 18 (WebKit::WebPage::findStringFromInjectedBundle): Added. 19 * WebProcess/WebPage/WebPage.h: 20 1 21 2010-11-30 Andreas Kling <kling@webkit.org> 2 22 -
trunk/WebKit2/Shared/API/c/WKSharedAPICast.h
r72666 r72937 30 30 #include "WKContextMenuItemTypes.h" 31 31 #include "WKEvent.h" 32 #include "WKFindOptions.h" 32 33 #include "WKGeometry.h" 33 34 #include "WebError.h" 34 35 #include "WebEvent.h" 36 #include "WebFindOptions.h" 35 37 #include "WebNumber.h" 36 38 #include "WebString.h" … … 620 622 } 621 623 624 inline FindOptions toFindOptions(WKFindOptions wkFindOptions) 625 { 626 unsigned findOptions = 0; 627 628 if (wkFindOptions & kWKFindOptionsCaseInsensitive) 629 findOptions |= FindOptionsCaseInsensitive; 630 if (wkFindOptions & kWKFindOptionsAtWordStarts) 631 findOptions |= FindOptionsAtWordStarts; 632 if (wkFindOptions & kWKFindOptionsTreatMedialCapitalAsWordStart) 633 findOptions |= FindOptionsTreatMedialCapitalAsWordStart; 634 if (wkFindOptions & kWKFindOptionsBackwards) 635 findOptions |= FindOptionsBackwards; 636 if (wkFindOptions & kWKFindOptionsWrapAround) 637 findOptions |= FindOptionsWrapAround; 638 if (wkFindOptions & kWKFindOptionsShowOverlay) 639 findOptions |= FindOptionsShowOverlay; 640 if (wkFindOptions & kWKFindOptionsShowFindIndicator) 641 findOptions |= FindOptionsShowFindIndicator; 642 643 return static_cast<FindOptions>(findOptions); 644 } 645 622 646 } // namespace WebKit 623 647 -
trunk/WebKit2/UIProcess/API/C/WKAPICast.h
r72887 r72937 33 33 #include "WKPreferencesPrivate.h" 34 34 #include "WKSharedAPICast.h" 35 #include "WebFindOptions.h"36 35 #include <WebCore/FrameLoaderTypes.h> 37 36 … … 125 124 } 126 125 127 inline FindOptions toFindOptions(WKFindOptions wkFindOptions)128 {129 unsigned findOptions = 0;130 131 if (wkFindOptions & kWKFindOptionsCaseInsensitive)132 findOptions |= FindOptionsCaseInsensitive;133 if (wkFindOptions & kWKFindOptionsAtWordStarts)134 findOptions |= FindOptionsAtWordStarts;135 if (wkFindOptions & kWKFindOptionsTreatMedialCapitalAsWordStart)136 findOptions |= FindOptionsTreatMedialCapitalAsWordStart;137 if (wkFindOptions & kWKFindOptionsBackwards)138 findOptions |= FindOptionsBackwards;139 if (wkFindOptions & kWKFindOptionsWrapAround)140 findOptions |= FindOptionsWrapAround;141 if (wkFindOptions & kWKFindOptionsShowOverlay)142 findOptions |= FindOptionsShowOverlay;143 if (wkFindOptions & kWKFindOptionsShowFindIndicator)144 findOptions |= FindOptionsShowFindIndicator;145 146 return static_cast<FindOptions>(findOptions);147 }148 149 126 inline FontSmoothingLevel toFontSmoothingLevel(WKFontSmoothingLevel wkLevel) 150 127 { -
trunk/WebKit2/UIProcess/API/C/WKPage.h
r72887 r72937 29 29 #include <WebKit2/WKBase.h> 30 30 #include <WebKit2/WKEvent.h> 31 #include <WebKit2/WKFindOptions.h> 31 32 #include <WebKit2/WKGeometry.h> 32 33 #include <WebKit2/WKNativeEvent.h> … … 273 274 WK_EXPORT double WKPageGetViewScaleFactor(WKPageRef page); 274 275 275 // Find.276 enum {277 kWKFindOptionsCaseInsensitive = 1 << 0,278 kWKFindOptionsAtWordStarts = 1 << 1,279 kWKFindOptionsTreatMedialCapitalAsWordStart = 1 << 2,280 kWKFindOptionsBackwards = 1 << 3,281 kWKFindOptionsWrapAround = 1 << 4,282 kWKFindOptionsShowOverlay = 1 << 5,283 kWKFindOptionsShowFindIndicator = 1 << 6284 };285 typedef uint32_t WKFindOptions;286 287 276 WK_EXPORT void WKPageFindString(WKPageRef page, WKStringRef string, WKFindOptions findOptions, unsigned maxMatchCount); 288 277 WK_EXPORT void WKPageHideFindUI(WKPageRef page); -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r72887 r72937 195 195 1CA8B946127C882A00576C2B /* WebInspectorProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CA8B944127C882A00576C2B /* WebInspectorProxyMessages.h */; }; 196 196 1CA8B954127C891500576C2B /* WebInspectorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C8E2DAD1278C5B200BC7BD0 /* WebInspectorMac.mm */; }; 197 37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 197 198 510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */; }; 198 199 510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = 510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */; }; … … 761 762 1CA8B944127C882A00576C2B /* WebInspectorProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorProxyMessages.h; sourceTree = "<group>"; }; 762 763 32DBCF5E0370ADEE00C91783 /* WebKit2Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKit2Prefix.h; sourceTree = "<group>"; }; 764 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFindOptions.h; sourceTree = "<group>"; }; 763 765 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenuItemData.cpp; sourceTree = "<group>"; }; 764 766 510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuItemData.h; sourceTree = "<group>"; }; … … 2068 2070 BC4075E0124FF0270068F20A /* WKError.h */, 2069 2071 BC40783C1250FADD0068F20A /* WKEvent.h */, 2072 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */, 2070 2073 BCC8B373125FB69000DE46A4 /* WKGeometry.h */, 2071 2074 BC4075E1124FF0270068F20A /* WKMutableArray.cpp */, … … 2428 2431 5153569D1291B1D2000749DC /* WebPageContextMenuClient.h in Headers */, 2429 2432 1AAB4A8D1296F0A20023952F /* SandboxExtension.h in Headers */, 2433 37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */, 2430 2434 ); 2431 2435 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
r72446 r72937 157 157 return WebPage::canHandleRequest(toImpl(requestRef)->resourceRequest()); 158 158 } 159 160 bool WKBundlePageFindString(WKBundlePageRef pageRef, WKStringRef target, WKFindOptions findOptions) 161 { 162 return toImpl(pageRef)->findStringFromInjectedBundle(toImpl(target)->string(), toFindOptions(findOptions)); 163 } -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
r72446 r72937 29 29 #include <WebKit2/WKBase.h> 30 30 #include <WebKit2/WKEvent.h> 31 #include <WebKit2/WKFindOptions.h> 31 32 32 33 #ifndef __cplusplus … … 210 211 WK_EXPORT bool WKBundlePageCanHandleRequest(WKURLRequestRef request); 211 212 213 WK_EXPORT bool WKBundlePageFindString(WKBundlePageRef page, WKStringRef target, WKFindOptions findOptions); 214 212 215 #ifdef __cplusplus 213 216 } -
trunk/WebKit2/WebProcess/WebPage/WebPage.cpp
r72919 r72937 1002 1002 } 1003 1003 1004 bool WebPage::findStringFromInjectedBundle(const String& target, FindOptions options) 1005 { 1006 return m_page->findString(target, options); 1007 } 1008 1004 1009 void WebPage::findString(const String& string, uint32_t options, uint32_t maxMatchCount) 1005 1010 { -
trunk/WebKit2/WebProcess/WebPage/WebPage.h
r72887 r72937 150 150 InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; } 151 151 152 bool findStringFromInjectedBundle(const String&, FindOptions); 153 152 154 WebFrame* mainFrame() const { return m_mainFrame.get(); } 153 155 PassRefPtr<Plugin> createPlugin(const Plugin::Parameters&); -
trunk/WebKitTools/ChangeLog
r72923 r72937 1 2010-11-30 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 <rdar://problem/8710645> WebKitTestRunner needs layoutTestController.findString 6 https://bugs.webkit.org/show_bug.cgi?id=50238 7 8 * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: 9 (WTR::LayoutTestController::findString): Added. 10 * WebKitTestRunner/InjectedBundle/LayoutTestController.h: 11 1 12 2010-11-30 Steve Falkenburg <sfalken@apple.com> 2 13 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
r71458 r72937 234 234 } 235 235 236 bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) 237 { 238 WKFindOptions options = 0; 239 240 JSRetainPtr<JSStringRef> lengthPropertyName(Adopt, JSStringCreateWithUTF8CString("length")); 241 JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), 0); 242 if (!JSValueIsNumber(context, lengthValue)) 243 return false; 244 245 size_t length = static_cast<size_t>(JSValueToNumber(context, lengthValue, 0)); 246 for (size_t i = 0; i < length; ++i) { 247 JSValueRef value = JSObjectGetPropertyAtIndex(context, optionsArray, i, 0); 248 if (!JSValueIsString(context, value)) 249 continue; 250 251 JSRetainPtr<JSStringRef> optionName(Adopt, JSValueToStringCopy(context, value, 0)); 252 253 if (JSStringIsEqualToUTF8CString(optionName.get(), "CaseInsensitive")) 254 options |= kWKFindOptionsCaseInsensitive; 255 else if (JSStringIsEqualToUTF8CString(optionName.get(), "AtWordStarts")) 256 options |= kWKFindOptionsAtWordStarts; 257 else if (JSStringIsEqualToUTF8CString(optionName.get(), "TreatMedialCapitalAsWordStart")) 258 options |= kWKFindOptionsTreatMedialCapitalAsWordStart; 259 else if (JSStringIsEqualToUTF8CString(optionName.get(), "Backwards")) 260 options |= kWKFindOptionsBackwards; 261 else if (JSStringIsEqualToUTF8CString(optionName.get(), "WrapAround")) 262 options |= kWKFindOptionsWrapAround; 263 else if (JSStringIsEqualToUTF8CString(optionName.get(), "StartInSelection")) { 264 // FIXME: No kWKFindOptionsStartInSelection. 265 } 266 } 267 268 return WKBundlePageFindString(InjectedBundle::shared().page()->page(), toWK(target).get(), options); 269 } 270 236 271 bool LayoutTestController::isCommandEnabled(JSStringRef name) 237 272 { -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
r71458 r72937 102 102 void addUserStyleSheet(JSStringRef source, bool allFrames); 103 103 104 // Text search testing. 105 bool findString(JSContextRef, JSStringRef, JSObjectRef optionsArray); 106 104 107 enum WhatToDump { RenderTree, MainFrameText, AllFramesText }; 105 108 WhatToDump whatToDump() const { return m_whatToDump; }
Note: See TracChangeset
for help on using the changeset viewer.