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

Changeset 249011 in webkit


Ignore:
Timestamp:
Aug 22, 2019, 8:47:23 AM (7 years ago)
Author:
Kocsen Chung
Message:

Cherry-pick r248977. rdar://problem/54599960

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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248977 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-608-branch
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608-branch/LayoutTests/ChangeLog

    r248988 r249011  
     12019-08-22  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r248977. rdar://problem/54599960
     4
     5    Do not adjust viewport if editing selection is already visible
     6    https://bugs.webkit.org/show_bug.cgi?id=200907
     7    <rdar://problem/53903417>
     8   
     9    Reviewed by Simon Fraser.
     10   
     11    Source/WebCore:
     12   
     13    Test: fast/scrolling/ios/autoscroll-input-when-very-zoomed.html
     14   
     15    Currently due to scrolling being mostly handled by integers, we are getting
     16    issues with rounding errors when trying to adjust the viewport while
     17    editing text when we are significantly zoomed in. The real fix would be to
     18    start dealing with scrolling with floats/doubles, but until such time,
     19    we should early out of adjusting selections that we are certain are currently
     20    visible.
     21   
     22    * rendering/RenderLayer.cpp:
     23    (WebCore::RenderLayer::scrollRectToVisible):
     24   
     25    LayoutTests:
     26   
     27    * fast/scrolling/ios/autoscroll-input-when-very-zoomed-expected.txt: Added.
     28    * fast/scrolling/ios/autoscroll-input-when-very-zoomed.html: Added.
     29    * resources/ui-helper.js:
     30    (window.UIHelper.immediateZoomToScale):
     31   
     32   
     33    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     34
     35    2019-08-21  Megan Gardner  <megan_gardner@apple.com>
     36
     37            Do not adjust viewport if editing selection is already visible
     38            https://bugs.webkit.org/show_bug.cgi?id=200907
     39            <rdar://problem/53903417>
     40
     41            Reviewed by Simon Fraser.
     42
     43            * fast/scrolling/ios/autoscroll-input-when-very-zoomed-expected.txt: Added.
     44            * fast/scrolling/ios/autoscroll-input-when-very-zoomed.html: Added.
     45            * resources/ui-helper.js:
     46            (window.UIHelper.immediateZoomToScale):
     47
    1482019-08-21  Kocsen Chung  <kocsen_chung@apple.com>
    249
  • branches/safari-608-branch/LayoutTests/resources/ui-helper.js

    r248619 r249011  
    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    {
  • branches/safari-608-branch/Source/WebCore/ChangeLog

    r249010 r249011  
     12019-08-22  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r248977. rdar://problem/54599960
     4
     5    Do not adjust viewport if editing selection is already visible
     6    https://bugs.webkit.org/show_bug.cgi?id=200907
     7    <rdar://problem/53903417>
     8   
     9    Reviewed by Simon Fraser.
     10   
     11    Source/WebCore:
     12   
     13    Test: fast/scrolling/ios/autoscroll-input-when-very-zoomed.html
     14   
     15    Currently due to scrolling being mostly handled by integers, we are getting
     16    issues with rounding errors when trying to adjust the viewport while
     17    editing text when we are significantly zoomed in. The real fix would be to
     18    start dealing with scrolling with floats/doubles, but until such time,
     19    we should early out of adjusting selections that we are certain are currently
     20    visible.
     21   
     22    * rendering/RenderLayer.cpp:
     23    (WebCore::RenderLayer::scrollRectToVisible):
     24   
     25    LayoutTests:
     26   
     27    * fast/scrolling/ios/autoscroll-input-when-very-zoomed-expected.txt: Added.
     28    * fast/scrolling/ios/autoscroll-input-when-very-zoomed.html: Added.
     29    * resources/ui-helper.js:
     30    (window.UIHelper.immediateZoomToScale):
     31   
     32   
     33    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     34
     35    2019-08-21  Megan Gardner  <megan_gardner@apple.com>
     36
     37            Do not adjust viewport if editing selection is already visible
     38            https://bugs.webkit.org/show_bug.cgi?id=200907
     39            <rdar://problem/53903417>
     40
     41            Reviewed by Simon Fraser.
     42
     43            Test: fast/scrolling/ios/autoscroll-input-when-very-zoomed.html
     44
     45            Currently due to scrolling being mostly handled by integers, we are getting
     46            issues with rounding errors when trying to adjust the viewport while
     47            editing text when we are significantly zoomed in. The real fix would be to
     48            start dealing with scrolling with floats/doubles, but until such time,
     49            we should early out of adjusting selections that we are certain are currently
     50            visible.
     51
     52            * rendering/RenderLayer.cpp:
     53            (WebCore::RenderLayer::scrollRectToVisible):
     54
    1552019-08-22  Kocsen Chung  <kocsen_chung@apple.com>
    256
  • branches/safari-608-branch/Source/WebCore/rendering/RenderLayer.cpp

    r248653 r249011  
    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.