WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-178789-20171101194123.patch (text/plain), 12.32 KB, created by
Frédéric Wang Nélar
on 2017-11-01 11:41:24 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang Nélar
Created:
2017-11-01 11:41:24 PDT
Size:
12.32 KB
patch
obsolete
>Subversion Revision: 224272 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 32c9c635f5604b0aea3bdc22857bc1f9aef9a53e..1079de2a60e522f502916d09ac87e0c5720b97b4 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,14 @@ >+2017-10-25 Frederic Wang <fwang@igalia.com> >+ >+ Make iOS Find UI reveal matches in scrollable elements >+ https://bugs.webkit.org/show_bug.cgi?id=178789 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/WebPage/ios/FindControllerIOS.mm: >+ (WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame >+ is handled by the SmartMagnificationController. >+ > 2017-10-31 Tim Horton <timothy_horton@apple.com> > > Clean up some drag and drop feature flags >diff --git a/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm >index d949a1ccd1d1920a4001f003b83ec5cff4ea248f..f493d6ce092911e69b22ae90b8f7e60ca00a3a20 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm >@@ -157,6 +157,10 @@ void FindController::didFindString() > frame.selection().setUpdateAppearanceEnabled(true); > frame.selection().updateAppearance(); > frame.selection().setUpdateAppearanceEnabled(false); >+ >+ // Scrolling the main frame is handled by the SmartMagnificationController class but we still >+ // need to consider overflow nodes and subframes here. >+ frame.selection().revealSelection(SelectionRevealMode::RevealUpToMainFrame, ScrollAlignment::alignToEdgeIfNeeded, WebCore::DoNotRevealExtent); > } > > void FindController::didFailToFindString() >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 82e6114c1abcc3cf9e5cd059a4f4b2ef14630c8d..dd7864ad36b66b481e4b9439f0535ae7eacd0dd6 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,26 @@ >+2017-10-27 Frederic Wang <fwang@igalia.com> >+ >+ Make iOS Find UI reveal matches in scrollable elements >+ https://bugs.webkit.org/show_bug.cgi?id=178789 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch exposes WKWebView's findString function in order to test the fix for bug 178789. >+ >+ * DumpRenderTree/ios/UIScriptControllerIOS.mm: >+ (WTR::UIScriptController::findString): Dummy implementation of findString. >+ * DumpRenderTree/mac/UIScriptControllerMac.mm: >+ (WTR::UIScriptController::findString): Ditto. >+ * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: Declare findString. >+ * TestRunnerShared/UIScriptContext/UIScriptController.cpp: >+ (WTR::UIScriptController::findString): Dummy implementation of findString. >+ * TestRunnerShared/UIScriptContext/UIScriptController.h: Declare findString. >+ * WebKitTestRunner/ios/UIScriptControllerIOS.mm: >+ (WTR::UIScriptController::findString): Implement findString by forwarding the call to the >+ web view. >+ * WebKitTestRunner/mac/UIScriptControllerMac.mm: >+ (WTR::UIScriptController::findString): Dummy implementation of findString. >+ > 2017-10-31 Ross Kirsling <ross.kirsling@sony.com> > > Web Inspector: Add Inspector menu items to Mac MiniBrowser >diff --git a/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm b/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >index 913ec1e150104657c092a5910c76acc675d2bb87..c9d2008ac4eea88e8ae7e804c8b345e5b5006abf 100644 >--- a/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >+++ b/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >@@ -319,6 +319,10 @@ void UIScriptController::simulateRotationLikeSafari(DeviceOrientation*, JSValueR > { > } > >+void UIScriptController::findString(JSStringRef, unsigned long options, unsigned long maxCount) >+{ >+} >+ > void UIScriptController::removeViewFromWindow(JSValueRef) > { > } >diff --git a/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm b/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm >index 82e4dce7b2d0d9dd8a2672deb2df6eb5edda042b..066991cbc7e0022be20344352f1d2e44e96e5579 100644 >--- a/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm >+++ b/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm >@@ -123,6 +123,10 @@ void UIScriptController::simulateRotationLikeSafari(DeviceOrientation*, JSValueR > { > } > >+void UIScriptController::findString(JSStringRef, unsigned long options, unsigned long maxCount) >+{ >+} >+ > void UIScriptController::removeViewFromWindow(JSValueRef callback) > { > unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent); >diff --git a/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl b/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl >index e373230c56a1e64abe4297d7ddb97c2fec6053e0..00343e087129e6a8da4562a0cea0dcc414117049 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl >+++ b/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl >@@ -239,6 +239,8 @@ interface UIScriptController { > void simulateRotation(DeviceOrientation orientation, object callback); > void simulateRotationLikeSafari(DeviceOrientation orientation, object callback); > >+ void findString(DOMString string, unsigned long options, unsigned long maxCount); >+ > // Unparent and parent the web view, simulating, for example, tab switching. > void removeViewFromWindow(object callback); > void addViewToWindow(object callback); >diff --git a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >index ba10dbfa9092b466e5077eae5e9a189b6170f900..666de932abe95ef95990fb9decdc990ea7c6d7f3 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >+++ b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >@@ -445,6 +445,10 @@ void UIScriptController::simulateRotationLikeSafari(DeviceOrientation*, JSValueR > { > } > >+void UIScriptController::findString(JSStringRef, unsigned long options, unsigned long maxCount) >+{ >+} >+ > void UIScriptController::removeViewFromWindow(JSValueRef) > { > } >diff --git a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >index 546e0ff64d926d347236125d7ed37e40fb531bb2..09af4f37f19f6ae62c5a64f584996d2bd3ce0293 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >+++ b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >@@ -166,6 +166,8 @@ public: > void simulateRotation(DeviceOrientation*, JSValueRef); > void simulateRotationLikeSafari(DeviceOrientation*, JSValueRef); > >+ void findString(JSStringRef, unsigned long options, unsigned long maxCount); >+ > // These use a callback to allow the client to know when view visibility state updates get to the web process. > void removeViewFromWindow(JSValueRef); > void addViewToWindow(JSValueRef); >diff --git a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >index a65947b827917b7005bb0e431d0095c40f3a1f24..0996136a6473da1e4682d369a796c7b7462295c4 100644 >--- a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >+++ b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >@@ -620,6 +620,12 @@ void UIScriptController::simulateRotationLikeSafari(DeviceOrientation* orientati > [[UIDevice currentDevice] setOrientation:toUIDeviceOrientation(orientation) animated:YES]; > } > >+void UIScriptController::findString(JSStringRef string, unsigned long options, unsigned long maxCount) >+{ >+ TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); >+ [webView _findString:toWTFString(toWK(string)) options:options maxCount:maxCount]; >+} >+ > void UIScriptController::removeViewFromWindow(JSValueRef callback) > { > TestController::singleton().mainWebView()->removeFromWindow(); >diff --git a/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm b/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm >index 650830bcdbf6b1fa028a4ce551d89c447c18b5b4..71cc7b206778b5e1ad00f1d902198506c7ab3ea4 100644 >--- a/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm >+++ b/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm >@@ -164,6 +164,10 @@ void UIScriptController::simulateRotationLikeSafari(DeviceOrientation*, JSValueR > { > } > >+void UIScriptController::findString(JSStringRef, unsigned long options, unsigned long maxCount) >+{ >+} >+ > void UIScriptController::removeViewFromWindow(JSValueRef callback) > { > #if WK_API_ENABLED >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 8750999e2d8ab900c513a390d057b9690991f72f..c7129540183d047a3fcebade44d917b96cf1460b 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2017-10-27 Frederic Wang <fwang@igalia.com> >+ >+ Make iOS Find UI reveal matches in scrollable elements >+ https://bugs.webkit.org/show_bug.cgi?id=178789 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Adds a test to verify that an overflow node is scrolled to reveal results it contains when >+ iOS's Find UI is used. >+ >+ * platform/ios/fast/scrolling/find-text-in-overflow-node-expected.txt: Added. >+ * platform/ios/fast/scrolling/find-text-in-overflow-node.html: Added. >+ > 2017-10-31 Chris Dumez <cdumez@apple.com> > > Fix a couple of service worker tests and unskip them >diff --git a/LayoutTests/platform/ios/fast/scrolling/find-text-in-overflow-node-expected.txt b/LayoutTests/platform/ios/fast/scrolling/find-text-in-overflow-node-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..bebb71c97cdba7605421136d3891c1b030b3e688 >--- /dev/null >+++ b/LayoutTests/platform/ios/fast/scrolling/find-text-in-overflow-node-expected.txt >@@ -0,0 +1,13 @@ >+Use iOS Find UI to search for the text "match". The following overflow node should scroll to show the fourth result. >+ >+match 2 >+ >+match 3 >+ >+match 4 >+ >+ >+PASS Initial position of overflow node >+PASS Position of overflow node after the three first results >+PASS Position of overflow node after the fourth result >+ >diff --git a/LayoutTests/platform/ios/fast/scrolling/find-text-in-overflow-node.html b/LayoutTests/platform/ios/fast/scrolling/find-text-in-overflow-node.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5e8af35e7bb4bec4bd45873ab678d55e140e85ac >--- /dev/null >+++ b/LayoutTests/platform/ios/fast/scrolling/find-text-in-overflow-node.html >@@ -0,0 +1,58 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>Find text in overflow node</title> >+ <meta name="viewport" content="width=device-width"> >+ <script src="../../../../resources/testharness.js"></script> >+ <script src="../../../../resources/testharnessreport.js"></script> >+ <script type="text/javascript"> >+ setup({ "explicit_done": true }); >+ function run() { >+ if (!window.testRunner || !testRunner.runUIScript) >+ return; >+ >+ var node = document.getElementById("scrollable"); >+ test(function() { >+ assert_equals(node.scrollTop, 0); >+ }, "Initial position of overflow node"); >+ var afterMatch3 = async_test("Position of overflow node after the three first results"); >+ var afterMatch4 = async_test("Position of overflow node after the fourth result"); >+ testRunner.runUIScript(` >+ uiController.findString("match", 0, 4); // match >+ uiController.findString("match", 0, 4); // match 2 >+ uiController.findString("match", 0, 4); // match 3 >+ uiController.uiScriptComplete("Done"); >+ `, afterMatch3.step_func_done(function() { >+ assert_equals(node.scrollTop, 0); >+ testRunner.runUIScript(` >+ uiController.findString("match", 0, 4); // match 4 >+ uiController.uiScriptComplete("Done"); >+ `, afterMatch4.step_func_done(function() { >+ assert_greater_than(node.scrollTop, 0); >+ })); >+ })); >+ >+ done(); >+ } >+ </script> >+ <style> >+ #scrollable { >+ border: 1px solid black; >+ background: gray; >+ width: 200px; >+ height: 200px; >+ overflow-y: auto; >+ -webkit-overflow-scrolling: touch; >+ } >+ </style> >+ </head> >+ <body onload="run()"> >+ <p>Use iOS Find UI to search for the text "match". The following overflow node should scroll to show the fourth result.</p> >+ <p>match 2</p> >+ <p>match 3</p> >+ <div id="scrollable"> >+ <div style="height: 200px; background: linear-gradient(135deg, blue, cyan);"></div> >+ <p>match 4</p> >+ </div> >+ </body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
thorton
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 178789
:
324816
|
324985
|
325159
| 325603 |
353082