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

Changeset 243513 in webkit


Ignore:
Timestamp:
Mar 26, 2019, 12:23:52 PM (7 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] position:fixed inside oveflow:scroll is jumpy
https://bugs.webkit.org/show_bug.cgi?id=196238

Reviewed by Antti Koivisto.
Source/WebCore:

We were inadvertently making Positioned nodes for position:fixed, which is unnecessary because
Fixed nodes handle them, and harmful because they introduced unwanted layer movement.

Tests: scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree.html

scrollingcoordinator/ios/fixed-in-overflow-scroll.html

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):

LayoutTests:

fixed-in-overflow-scroll-scrolling-tree.html actually tests the fix.
For some reason fixed-in-overflow-scroll.html doesn't show the jumpiness, but it's
a good test to have nonetheless.

Other minor cleanup.

  • resources/ui-helper.js:

(window.UIHelper.immediateScrollElementAtContentPointToOffset):

  • scrollingcoordinator/ios/fixed-in-overflow-scroll-expected.html: Added.
  • scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree-expected.txt: Added.
  • scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree.html: Copied from LayoutTests/scrollingcoordinator/ios/ui-scrolling-tree.html.
  • scrollingcoordinator/ios/fixed-in-overflow-scroll.html: Added.
  • scrollingcoordinator/ios/ui-scrolling-tree.html:
Location:
trunk
Files:
3 added
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243512 r243513  
     12019-03-26  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] position:fixed inside oveflow:scroll is jumpy
     4        https://bugs.webkit.org/show_bug.cgi?id=196238
     5
     6        Reviewed by Antti Koivisto.
     7
     8        fixed-in-overflow-scroll-scrolling-tree.html actually tests the fix.
     9        For some reason fixed-in-overflow-scroll.html doesn't show the jumpiness, but it's
     10        a good test to have nonetheless.
     11
     12        Other minor cleanup.
     13
     14        * resources/ui-helper.js:
     15        (window.UIHelper.immediateScrollElementAtContentPointToOffset):
     16        * scrollingcoordinator/ios/fixed-in-overflow-scroll-expected.html: Added.
     17        * scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree-expected.txt: Added.
     18        * scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree.html: Copied from LayoutTests/scrollingcoordinator/ios/ui-scrolling-tree.html.
     19        * scrollingcoordinator/ios/fixed-in-overflow-scroll.html: Added.
     20        * scrollingcoordinator/ios/ui-scrolling-tree.html:
     21
    1222019-03-26  Andy VanWagoner  <andy@vanwagoner.family>
    223
  • trunk/LayoutTests/resources/ui-helper.js

    r243281 r243513  
    287287    }
    288288
    289     static immediateScrollElementAtContentPointToOffset(x, y, scrollX, scrollY)
    290     {
    291         if (!this.isWebKit2())
    292             return Promise.resolve();
    293 
    294         return new Promise(resolve => {
    295             testRunner.runUIScript(`
     289    static immediateScrollElementAtContentPointToOffset(x, y, scrollX, scrollY, scrollUpdatesDisabled = false)
     290    {
     291        if (!this.isWebKit2())
     292            return Promise.resolve();
     293
     294        return new Promise(resolve => {
     295            testRunner.runUIScript(`
     296                uiController.scrollUpdatesDisabled = ${scrollUpdatesDisabled};
    296297                uiController.immediateScrollElementAtContentPointToOffset(${x}, ${y}, ${scrollX}, ${scrollY});`, resolve);
    297298        });
  • trunk/LayoutTests/scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree.html

    r243512 r243513  
    1 <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
    2 
     1<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:AsyncOverflowScrollingEnabled=true ] -->
    32<html>
    43<head>
    54    <meta name="viewport" content="initial-scale=1.0">
    65    <style>
    7         body {
    8             width: 1300px;
    9             height: 2000px;
     6        .scroller {
     7            margin: 10px;
     8            height: 300px;
     9            width: 300px;
     10            border: 1px solid black;
     11            overflow: scroll;
    1012        }
    1113       
    12         .fixed {
     14        .box {
    1315            position: fixed;
    14             top: 10px;
    15             left: 12px;
    16             height: 100px;
    17             width: 100px;
    18             background-color: blue;
     16            margin-top: 200px;
     17            width: 200px;
     18            height: 200px;
     19            background-color: green;
     20        }
     21       
     22        .spacer {
     23            height: 800px;
    1924        }
    2025    </style>
     
    2530        }
    2631
    27         function getScrollingTreeUIScript(x, y)
     32        function getScrollingTreeUIScript()
    2833        {
    2934            return `(function() {
     
    4752</head>
    4853<body>
    49 <div class="fixed"></div>
     54    <div class="scroller">
     55        <div class="box"></div>
     56        <div class="spacer"></div>
     57    </div>
    5058<pre id="layers"></pre>
    5159</body>
  • trunk/LayoutTests/scrollingcoordinator/ios/ui-scrolling-tree.html

    r208666 r243513  
    11<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
    2 
    32<html>
    43<head>
     
    2524        }
    2625
    27         function getScrollingTreeUIScript(x, y)
     26        function getScrollingTreeUIScript()
    2827        {
    2928            return `(function() {
  • trunk/Source/WebCore/ChangeLog

    r243506 r243513  
     12019-03-26  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] position:fixed inside oveflow:scroll is jumpy
     4        https://bugs.webkit.org/show_bug.cgi?id=196238
     5
     6        Reviewed by Antti Koivisto.
     7       
     8        We were inadvertently making Positioned nodes for position:fixed, which is unnecessary because
     9        Fixed nodes handle them, and harmful because they introduced unwanted layer movement.
     10
     11        Tests: scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree.html
     12               scrollingcoordinator/ios/fixed-in-overflow-scroll.html
     13
     14        * rendering/RenderLayerCompositor.cpp:
     15        (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
     16
    1172019-03-26  Dean Jackson  <dino@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r243416 r243513  
    29452945        return ScrollPositioningBehavior::None;
    29462946
     2947    if (layer.renderer().isFixedPositioned())
     2948        return ScrollPositioningBehavior::None;
     2949
    29472950    auto* scrollingCoordinator = this->scrollingCoordinator();
    29482951    if (!scrollingCoordinator)
Note: See TracChangeset for help on using the changeset viewer.