Changeset 247327 in webkit


Ignore:
Timestamp:
Jul 10, 2019 2:12:47 PM (5 years ago)
Author:
rniwa@webkit.org
Message:

[iOS] REGRESSION(r244851): Revealing caret sometimes fails when content inset is used
https://bugs.webkit.org/show_bug.cgi?id=199662

Reviewed by Simon Fraser.

Source/WebCore:

The bug was caused by ScrollableArea::maximumScrollPosition using ScrollableArea::visibleSize, which does not
take the content insets into account correctly, rather than FrameView::visualViewportRectExpandedByContentInsets,
which does, and is used for "viewRect" in RenderLayer::scrollRectToVisible.

Override the maximum scroll position using visualViewportRectExpandedByContentInsets in iOS to fix the issue.

Test: editing/selection/ios/autoscroll-with-top-content-inset-2.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::scrollRectToVisible): Fixed the bug.

LayoutTests:

Added a regression test.

  • editing/selection/ios/autoscroll-with-top-content-inset-2-expected.txt: Added.
  • editing/selection/ios/autoscroll-with-top-content-inset-2.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r247319 r247327  
     12019-07-10  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        [iOS] REGRESSION(r244851): Revealing caret sometimes fails when content inset is used
     4        https://bugs.webkit.org/show_bug.cgi?id=199662
     5
     6        Reviewed by Simon Fraser.
     7
     8        Added a regression test.
     9
     10        * editing/selection/ios/autoscroll-with-top-content-inset-2-expected.txt: Added.
     11        * editing/selection/ios/autoscroll-with-top-content-inset-2.html: Added.
     12
    1132019-07-10  Saam Barati  <sbarati@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r247325 r247327  
     12019-07-10  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        [iOS] REGRESSION(r244851): Revealing caret sometimes fails when content inset is used
     4        https://bugs.webkit.org/show_bug.cgi?id=199662
     5
     6        Reviewed by Simon Fraser.
     7
     8        The bug was caused by ScrollableArea::maximumScrollPosition using ScrollableArea::visibleSize, which does not
     9        take the content insets into account correctly, rather than FrameView::visualViewportRectExpandedByContentInsets,
     10        which does, and is used for "viewRect" in RenderLayer::scrollRectToVisible.
     11
     12        Override the maximum scroll position using visualViewportRectExpandedByContentInsets in iOS to fix the issue.
     13
     14        Test: editing/selection/ios/autoscroll-with-top-content-inset-2.html
     15
     16        * rendering/RenderLayer.cpp:
     17        (WebCore::RenderLayer::scrollRectToVisible): Fixed the bug.
     18
    1192019-07-10  Ryan Haddad  <ryanhaddad@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r247306 r247327  
    26792679            LayoutRect viewRect = frameView.visibleContentRect();
    26802680#else
    2681             // FIXME: ContentInsets should be taken care of in UI process side.
     2681            // FIXME: ContentInsets should be taken care of in UI process side. webkit.org/b/199682
    26822682            // To do that, getRectToExpose needs to return the additional scrolling to do beyond content rect.
    26832683            LayoutRect viewRect = frameView.visualViewportRectExpandedByContentInsets();
     2684
     2685            // FIXME: webkit.org/b/199683 FrameView::visibleContentRect is wrong when content insets are present
     2686            maxScrollPosition = frameView.scrollPositionFromOffset(ScrollPosition(frameView.totalContentsSize() - flooredIntSize(viewRect.size())));
    26842687
    26852688            auto contentInsets = page().contentInsets();
Note: See TracChangeset for help on using the changeset viewer.