⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 248977 in webkit


Ignore:
Timestamp:
Aug 21, 2019, 5:06:38 PM (7 years ago)
Author:
Megan Gardner
Message:

Do not adjust viewport if editing selection is already visible
https://bugs.webkit.org/show_bug.cgi?id=200907
<rdar://problem/53903417>

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/scrolling/ios/autoscroll-input-when-very-zoomed.html

Currently due to scrolling being mostly handled by integers, we are getting
issues with rounding errors when trying to adjust the viewport while
editing text when we are significantly zoomed in. The real fix would be to
start dealing with scrolling with floats/doubles, but until such time,
we should early out of adjusting selections that we are certain are currently
visible.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::scrollRectToVisible):

LayoutTests:

  • fast/scrolling/ios/autoscroll-input-when-very-zoomed-expected.txt: Added.
  • fast/scrolling/ios/autoscroll-input-when-very-zoomed.html: Added.
  • resources/ui-helper.js:

(window.UIHelper.immediateZoomToScale):

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r248974 r248977  
     12019-08-21  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Do not adjust viewport if editing selection is already visible
     4        https://bugs.webkit.org/show_bug.cgi?id=200907
     5        <rdar://problem/53903417>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * fast/scrolling/ios/autoscroll-input-when-very-zoomed-expected.txt: Added.
     10        * fast/scrolling/ios/autoscroll-input-when-very-zoomed.html: Added.
     11        * resources/ui-helper.js:
     12        (window.UIHelper.immediateZoomToScale):
     13
    1142019-08-21  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/LayoutTests/resources/ui-helper.js

    r248433 r248977  
    709709    }
    710710
     711    static immediateZoomToScale(scale)
     712    {
     713        const uiScript = `uiController.immediateZoomToScale(${scale})`;
     714        return new Promise(resolve => testRunner.runUIScript(uiScript, resolve));
     715    }
     716
    711717    static typeCharacter(characterString)
    712718    {
  • trunk/Source/WebCore/ChangeLog

    r248974 r248977  
     12019-08-21  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Do not adjust viewport if editing selection is already visible
     4        https://bugs.webkit.org/show_bug.cgi?id=200907
     5        <rdar://problem/53903417>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Test: fast/scrolling/ios/autoscroll-input-when-very-zoomed.html
     10
     11        Currently due to scrolling being mostly handled by integers, we are getting
     12        issues with rounding errors when trying to adjust the viewport while
     13        editing text when we are significantly zoomed in. The real fix would be to
     14        start dealing with scrolling with floats/doubles, but until such time,
     15        we should early out of adjusting selections that we are certain are currently
     16        visible.
     17
     18        * rendering/RenderLayer.cpp:
     19        (WebCore::RenderLayer::scrollRectToVisible):
     20
    1212019-08-21  Tim Horton  <timothy_horton@apple.com>
    222
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r248846 r248977  
    27022702
    27032703            LayoutRect revealRect = getRectToExpose(viewRect, targetRect, insideFixed, options.alignX, options.alignY);
    2704             ScrollOffset clampedScrollPosition = roundedIntPoint(revealRect.location()).constrainedBetween(minScrollPosition, maxScrollPosition);
    2705             frameView.setScrollPosition(clampedScrollPosition);
     2704            // Avoid scrolling to the rounded value of revealRect.location() if we don't actually need to scroll
     2705            if (revealRect != viewRect) {
     2706                ScrollOffset clampedScrollPosition = roundedIntPoint(revealRect.location()).constrainedBetween(minScrollPosition, maxScrollPosition);
     2707                frameView.setScrollPosition(clampedScrollPosition);
     2708            }
    27062709
    27072710            // This is the outermost view of a web page, so after scrolling this view we
Note: See TracChangeset for help on using the changeset viewer.