Changeset 240027 in webkit


Ignore:
Timestamp:
Jan 15, 2019, 7:35:59 PM (7 years ago)
Author:
rniwa@webkit.org
Message:

VisualViewport API should be updated upon opening of keyboard
https://bugs.webkit.org/show_bug.cgi?id=193475

Reviewed by Simon Fraser.

Source/WebCore:

Added a function to update the visual viewport API and schedule a resize event to FrameView.

Test: fast/visual-viewport/ios/resize-event-for-keyboard.html

  • page/FrameView.cpp:

(WebCore::FrameView::didUpdateViewportOverrideRects):

  • page/FrameView.h:

Source/WebKit:

The bug was caused by the changes to unobscuredContentRectRespectingInputViewBounds not updating the visual viewport
unless it caused a layout to happen. Added a code to update the visual viewport in WebPage::updateVisibleContentRects.

Also fixed the bug that VisibleContentRectUpdateInfo::operator== was not checking differences in
unobscuredContentRectRespectingInputViewBounds which resulted in the visual viewport override not getting updated
while the keyboard is getting brought up.

  • Shared/VisibleContentRectUpdateInfo.h:

(WebKit::operator==):

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::updateVisibleContentRects):

LayoutTests:

Added a regression test.

  • fast/visual-viewport/ios/resize-event-for-keyboard-expected.txt: Added.
  • fast/visual-viewport/ios/resize-event-for-keyboard.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r240015 r240027  
     12019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        VisualViewport API should be updated upon opening of keyboard
     4        https://bugs.webkit.org/show_bug.cgi?id=193475
     5
     6        Reviewed by Simon Fraser.
     7
     8        Added a regression test.
     9
     10        * fast/visual-viewport/ios/resize-event-for-keyboard-expected.txt: Added.
     11        * fast/visual-viewport/ios/resize-event-for-keyboard.html: Added.
     12
    1132019-01-15  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r240026 r240027  
     12019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        VisualViewport API should be updated upon opening of keyboard
     4        https://bugs.webkit.org/show_bug.cgi?id=193475
     5
     6        Reviewed by Simon Fraser.
     7
     8        Added a function to update the visual viewport API and schedule a resize event to FrameView.
     9
     10        Test: fast/visual-viewport/ios/resize-event-for-keyboard.html
     11
     12        * page/FrameView.cpp:
     13        (WebCore::FrameView::didUpdateViewportOverrideRects):
     14        * page/FrameView.h:
     15
    1162019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
    217
  • trunk/Source/WebCore/page/FrameView.cpp

    r240011 r240027  
    27982798#if PLATFORM(IOS_FAMILY)
    27992799
     2800void FrameView::didUpdateViewportOverrideRects()
     2801{
     2802    if (!frame().settings().visualViewportAPIEnabled())
     2803        return;
     2804
     2805    if (auto* window = frame().window())
     2806        window->visualViewport().update();
     2807}
     2808
    28002809void FrameView::unobscuredContentSizeChanged()
    28012810{
  • trunk/Source/WebCore/page/FrameView.h

    r240011 r240027  
    591591    TiledBacking::Scrollability computeScrollability() const;
    592592
     593#if PLATFORM(IOS_FAMILY)
     594    WEBCORE_EXPORT void didUpdateViewportOverrideRects();
     595#endif
     596
    593597    void addPaintPendingMilestones(OptionSet<LayoutMilestone>);
    594598    void firePaintRelatedMilestonesIfNeeded();
  • trunk/Source/WebKit/ChangeLog

    r240021 r240027  
     12019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        VisualViewport API should be updated upon opening of keyboard
     4        https://bugs.webkit.org/show_bug.cgi?id=193475
     5
     6        Reviewed by Simon Fraser.
     7
     8        The bug was caused by the changes to unobscuredContentRectRespectingInputViewBounds not updating the visual viewport
     9        unless it caused a layout to happen. Added a code to update the visual viewport in WebPage::updateVisibleContentRects.
     10
     11        Also fixed the bug that VisibleContentRectUpdateInfo::operator== was not checking differences in
     12        unobscuredContentRectRespectingInputViewBounds which resulted in the visual viewport override not getting updated
     13        while the keyboard is getting brought up.
     14
     15        * Shared/VisibleContentRectUpdateInfo.h:
     16        (WebKit::operator==):
     17        * WebProcess/WebPage/ios/WebPageIOS.mm:
     18        (WebKit::WebPage::updateVisibleContentRects):
     19
    1202019-01-15  Megan Gardner  <megan_gardner@apple.com>
    221
  • trunk/Source/WebKit/Shared/VisibleContentRectUpdateInfo.h

    r231095 r240027  
    122122        && a.exposedContentRect() == b.exposedContentRect()
    123123        && a.unobscuredContentRect() == b.unobscuredContentRect()
     124        && a.unobscuredContentRectRespectingInputViewBounds() == b.unobscuredContentRectRespectingInputViewBounds()
    124125        && a.customFixedPositionRect() == b.customFixedPositionRect()
    125126        && a.obscuredInsets() == b.obscuredInsets()
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r239931 r240027  
    30423042                sendPartialEditorStateAndSchedulePostLayoutUpdate();
    30433043            }
     3044
     3045            frameView.didUpdateViewportOverrideRects();
    30443046        } else
    30453047            frameView.setCustomFixedPositionLayoutRect(enclosingIntRect(visibleContentRectUpdateInfo.customFixedPositionRect()));
Note: See TracChangeset for help on using the changeset viewer.