Changeset 224284 in webkit


Ignore:
Timestamp:
Nov 1, 2017 11:50:36 AM (6 years ago)
Author:
fred.wang@free.fr
Message:

Make iOS Find UI reveal matches in scrollable elements
https://bugs.webkit.org/show_bug.cgi?id=178789

Patch by Frederic Wang <fwang@igalia.com> on 2017-11-01
Reviewed by Tim Horton.

Source/WebKit:

  • WebProcess/WebPage/ios/FindControllerIOS.mm:

(WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame
is handled by the SmartMagnificationController.

Tools:

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.

LayoutTests:

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.
Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r224282 r224284  
     12017-11-01  Frederic Wang  <fwang@igalia.com>
     2
     3        Make iOS Find UI reveal matches in scrollable elements
     4        https://bugs.webkit.org/show_bug.cgi?id=178789
     5
     6        Reviewed by Tim Horton.
     7
     8        Adds a test to verify that an overflow node is scrolled to reveal results it contains when
     9        iOS's Find UI is used.
     10
     11        * platform/ios/fast/scrolling/find-text-in-overflow-node-expected.txt: Added.
     12        * platform/ios/fast/scrolling/find-text-in-overflow-node.html: Added.
     13
    1142017-11-01  Per Arne Vollan  <pvollan@apple.com>
    215
  • trunk/Source/WebKit/ChangeLog

    r224274 r224284  
     12017-11-01  Frederic Wang  <fwang@igalia.com>
     2
     3        Make iOS Find UI reveal matches in scrollable elements
     4        https://bugs.webkit.org/show_bug.cgi?id=178789
     5
     6        Reviewed by Tim Horton.
     7
     8        * WebProcess/WebPage/ios/FindControllerIOS.mm:
     9        (WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame
     10        is handled by the SmartMagnificationController.
     11
    1122017-11-01  Michael Catanzaro  <mcatanzaro@igalia.com>
    213
  • trunk/Source/WebKit/WebProcess/WebPage/ios/FindControllerIOS.mm

    r219852 r224284  
    158158    frame.selection().updateAppearance();
    159159    frame.selection().setUpdateAppearanceEnabled(false);
     160
     161    // Scrolling the main frame is handled by the SmartMagnificationController class but we still
     162    // need to consider overflow nodes and subframes here.
     163    frame.selection().revealSelection(SelectionRevealMode::RevealUpToMainFrame, ScrollAlignment::alignToEdgeIfNeeded, WebCore::DoNotRevealExtent);
    160164}
    161165
  • trunk/Tools/ChangeLog

    r224281 r224284  
     12017-11-01  Frederic Wang  <fwang@igalia.com>
     2
     3        Make iOS Find UI reveal matches in scrollable elements
     4        https://bugs.webkit.org/show_bug.cgi?id=178789
     5
     6        Reviewed by Tim Horton.
     7
     8        This patch exposes WKWebView's findString function in order to test the fix for bug 178789.
     9
     10        * DumpRenderTree/ios/UIScriptControllerIOS.mm:
     11        (WTR::UIScriptController::findString): Dummy implementation of findString.
     12        * DumpRenderTree/mac/UIScriptControllerMac.mm:
     13        (WTR::UIScriptController::findString): Ditto.
     14        * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: Declare findString.
     15        * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
     16        (WTR::UIScriptController::findString): Dummy implementation of findString.
     17        * TestRunnerShared/UIScriptContext/UIScriptController.h: Declare findString.
     18        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
     19        (WTR::UIScriptController::findString): Implement findString by forwarding the call to the
     20        web view.
     21        * WebKitTestRunner/mac/UIScriptControllerMac.mm:
     22        (WTR::UIScriptController::findString): Dummy implementation of findString.
     23
    1242017-11-01  Alex Christensen  <achristensen@webkit.org>
    225
  • trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm

    r217587 r224284  
    320320}
    321321
     322void UIScriptController::findString(JSStringRef, unsigned long options, unsigned long maxCount)
     323{
     324}
     325
    322326void UIScriptController::removeViewFromWindow(JSValueRef)
    323327{
  • trunk/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm

    r221234 r224284  
    124124}
    125125
     126void UIScriptController::findString(JSStringRef, unsigned long options, unsigned long maxCount)
     127{
     128}
     129
    126130void UIScriptController::removeViewFromWindow(JSValueRef callback)
    127131{
  • trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl

    r221234 r224284  
    240240    void simulateRotationLikeSafari(DeviceOrientation orientation, object callback);
    241241
     242    void findString(DOMString string, unsigned long options, unsigned long maxCount);
     243
    242244    // Unparent and parent the web view, simulating, for example, tab switching.
    243245    void removeViewFromWindow(object callback);
  • trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp

    r221234 r224284  
    446446}
    447447
     448void UIScriptController::findString(JSStringRef, unsigned long options, unsigned long maxCount)
     449{
     450}
     451
    448452void UIScriptController::removeViewFromWindow(JSValueRef)
    449453{
  • trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h

    r221234 r224284  
    167167    void simulateRotationLikeSafari(DeviceOrientation*, JSValueRef);
    168168
     169    void findString(JSStringRef, unsigned long options, unsigned long maxCount);
     170
    169171    // These use a callback to allow the client to know when view visibility state updates get to the web process.
    170172    void removeViewFromWindow(JSValueRef);
  • trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm

    r218275 r224284  
    621621}
    622622
     623void UIScriptController::findString(JSStringRef string, unsigned long options, unsigned long maxCount)
     624{
     625    TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
     626    [webView _findString:toWTFString(toWK(string)) options:options maxCount:maxCount];
     627}
     628
    623629void UIScriptController::removeViewFromWindow(JSValueRef callback)
    624630{
  • trunk/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm

    r221234 r224284  
    165165}
    166166
     167void UIScriptController::findString(JSStringRef, unsigned long options, unsigned long maxCount)
     168{
     169}
     170
    167171void UIScriptController::removeViewFromWindow(JSValueRef callback)
    168172{
Note: See TracChangeset for help on using the changeset viewer.