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

Changeset 243416 in webkit


Ignore:
Timestamp:
Mar 23, 2019, 3:00:44 PM (7 years ago)
Author:
Simon Fraser
Message:

REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
https://bugs.webkit.org/show_bug.cgi?id=137043
rdar://problem/16595330

Reviewed by Zalan Bujtas.

Source/WebCore:

Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
to the UI process, and use it to set UIScrollView indicators visible or not.

Tests: fast/scrolling/ios/scrollbar-hiding.html:

  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):

  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::operator<<):

  • page/scrolling/ScrollingCoordinatorTypes.h:
  • page/scrolling/ScrollingTreeNode.h:
  • page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:

(WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):

  • page/scrolling/ScrollingTreeScrollingNode.h:
  • platform/ScrollableArea.h:

(WebCore::ScrollableArea::horizontalScrollbarHiddenByStyle const):
(WebCore::ScrollableArea::verticalScrollbarHiddenByStyle const):

  • rendering/RenderLayer.cpp:

(WebCore::scrollbarHiddenByStyle):
(WebCore::RenderLayer::horizontalScrollbarHiddenByStyle const):
(WebCore::RenderLayer::verticalScrollbarHiddenByStyle const):

  • rendering/RenderLayer.h:

Source/WebKit:

Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
to the UI process, and use it to set UIScrollView indicators visible or not.

The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
tests, so would never get called.

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
(IPC::ArgumentCoder<ScrollableAreaParameters>::decode):

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:

(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

LayoutTests:

Test that dumps the UI-side scrolling tree, showing e.g. "horizontal scrollbar hidden by style"
in the dump.

This test was previously a render tree dump, which did not test whether scrollbars were visible.

  • fast/scrolling/ios/scrollbar-hiding-expected.txt:
  • fast/scrolling/ios/scrollbar-hiding.html:
  • platform/ios/fast/scrolling/ios/scrollbar-hiding-expected.txt: Removed.
Location:
trunk
Files:
1 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243415 r243416  
     12019-03-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
     4        https://bugs.webkit.org/show_bug.cgi?id=137043
     5        rdar://problem/16595330
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Test that dumps the UI-side scrolling tree, showing e.g. "horizontal scrollbar hidden by style"
     10        in the dump.
     11
     12        This test was previously a render tree dump, which did not test whether scrollbars were visible.
     13
     14        * fast/scrolling/ios/scrollbar-hiding-expected.txt:
     15        * fast/scrolling/ios/scrollbar-hiding.html:
     16        * platform/ios/fast/scrolling/ios/scrollbar-hiding-expected.txt: Removed.
     17
    1182019-03-23  Zalan Bujtas  <zalan@apple.com>
    219
  • trunk/LayoutTests/fast/scrolling/ios/scrollbar-hiding-expected.txt

    r200609 r243416  
    1 layer at (0,0) size 800x1600
    2   RenderView at (0,0) size 800x600
    3 layer at (0,0) size 800x1600
    4   RenderBlock {HTML} at (0,0) size 800x1600
    5     RenderBody {BODY} at (8,8) size 784x1584
    6       RenderBlock {DIV} at (0,0) size 442x392
    7         RenderBlock {H2} at (0,19) size 442x31
    8           RenderText {#text} at (0,1) size 50x28
    9             text run at (0,1) width 50: "Both"
    10       RenderText {#text} at (0,0) size 0x0
    11       RenderBlock {DIV} at (0,396) size 442x392
    12         RenderBlock {H2} at (0,19) size 442x31
    13           RenderText {#text} at (0,1) size 155x28
    14             text run at (0,1) width 155: "Just horizontal"
    15       RenderText {#text} at (0,0) size 0x0
    16       RenderBlock {DIV} at (0,792) size 442x392
    17         RenderBlock {H2} at (0,19) size 442x31
    18           RenderText {#text} at (0,1) size 126x28
    19             text run at (0,1) width 126: "Just vertical"
    20       RenderText {#text} at (0,0) size 0x0
    21       RenderBlock {DIV} at (0,1188) size 442x392
    22         RenderBlock {H2} at (0,19) size 442x31
    23           RenderText {#text} at (0,1) size 125x28
    24             text run at (0,1) width 125: "None visible"
    25       RenderText {#text} at (0,0) size 0x0
    26 layer at (28,78) size 402x302 clip at (29,79) size 400x300 scrollWidth 600 scrollHeight 528
    27   RenderBlock {DIV} at (20,69) size 402x303 [border: (1px solid #000000)]
    28     RenderBlock {DIV} at (1,1) size 600x528
    29       RenderText {#text} at (0,2) size 600x524
    30         text run at (0,2) width 565: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor"
    31         text run at (0,26) width 587: "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud"
    32         text run at (0,50) width 600: "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure"
    33         text run at (0,74) width 571: "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
    34         text run at (0,98) width 571: "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt"
    35         text run at (0,122) width 191: "mollit anim id est laborum. "
    36         text run at (190,122) width 394: "Lorem ipsum dolor sit amet, consectetur adipisicing elit,"
    37         text run at (0,146) width 560: "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad"
    38         text run at (0,170) width 533: "minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea"
    39         text run at (0,194) width 576: "commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse"
    40         text run at (0,218) width 599: "cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,"
    41         text run at (0,242) width 424: "sunt in culpa qui officia deserunt mollit anim id est laborum. "
    42         text run at (423,242) width 154: "Lorem ipsum dolor sit"
    43         text run at (0,266) width 564: "amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et"
    44         text run at (0,290) width 577: "dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco"
    45         text run at (0,314) width 511: "laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in"
    46         text run at (0,338) width 591: "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur"
    47         text run at (0,362) width 592: "sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id"
    48         text run at (0,386) width 93: "est laborum. "
    49         text run at (92,386) width 447: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do"
    50         text run at (0,410) width 555: "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim"
    51         text run at (0,434) width 561: "veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo"
    52         text run at (0,458) width 595: "consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore"
    53         text run at (0,482) width 599: "eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa"
    54         text run at (0,506) width 325: "qui officia deserunt mollit anim id est laborum."
    55 layer at (28,474) size 402x302 clip at (29,475) size 400x300 scrollWidth 600 scrollHeight 528
    56   RenderBlock {DIV} at (20,69) size 402x303 [border: (1px solid #000000)]
    57     RenderBlock {DIV} at (1,1) size 600x528
    58       RenderText {#text} at (0,2) size 600x524
    59         text run at (0,2) width 565: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor"
    60         text run at (0,26) width 587: "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud"
    61         text run at (0,50) width 600: "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure"
    62         text run at (0,74) width 571: "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
    63         text run at (0,98) width 571: "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt"
    64         text run at (0,122) width 191: "mollit anim id est laborum. "
    65         text run at (190,122) width 394: "Lorem ipsum dolor sit amet, consectetur adipisicing elit,"
    66         text run at (0,146) width 560: "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad"
    67         text run at (0,170) width 533: "minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea"
    68         text run at (0,194) width 576: "commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse"
    69         text run at (0,218) width 599: "cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,"
    70         text run at (0,242) width 424: "sunt in culpa qui officia deserunt mollit anim id est laborum. "
    71         text run at (423,242) width 154: "Lorem ipsum dolor sit"
    72         text run at (0,266) width 564: "amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et"
    73         text run at (0,290) width 577: "dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco"
    74         text run at (0,314) width 511: "laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in"
    75         text run at (0,338) width 591: "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur"
    76         text run at (0,362) width 592: "sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id"
    77         text run at (0,386) width 93: "est laborum. "
    78         text run at (92,386) width 447: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do"
    79         text run at (0,410) width 555: "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim"
    80         text run at (0,434) width 561: "veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo"
    81         text run at (0,458) width 595: "consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore"
    82         text run at (0,482) width 599: "eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa"
    83         text run at (0,506) width 325: "qui officia deserunt mollit anim id est laborum."
    84 layer at (28,870) size 402x302 clip at (29,871) size 400x300 scrollWidth 600 scrollHeight 528
    85   RenderBlock {DIV} at (20,69) size 402x303 [border: (1px solid #000000)]
    86     RenderBlock {DIV} at (1,1) size 600x528
    87       RenderText {#text} at (0,2) size 600x524
    88         text run at (0,2) width 565: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor"
    89         text run at (0,26) width 587: "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud"
    90         text run at (0,50) width 600: "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure"
    91         text run at (0,74) width 571: "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
    92         text run at (0,98) width 571: "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt"
    93         text run at (0,122) width 191: "mollit anim id est laborum. "
    94         text run at (190,122) width 394: "Lorem ipsum dolor sit amet, consectetur adipisicing elit,"
    95         text run at (0,146) width 560: "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad"
    96         text run at (0,170) width 533: "minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea"
    97         text run at (0,194) width 576: "commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse"
    98         text run at (0,218) width 599: "cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,"
    99         text run at (0,242) width 424: "sunt in culpa qui officia deserunt mollit anim id est laborum. "
    100         text run at (423,242) width 154: "Lorem ipsum dolor sit"
    101         text run at (0,266) width 564: "amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et"
    102         text run at (0,290) width 577: "dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco"
    103         text run at (0,314) width 511: "laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in"
    104         text run at (0,338) width 591: "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur"
    105         text run at (0,362) width 592: "sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id"
    106         text run at (0,386) width 93: "est laborum. "
    107         text run at (92,386) width 447: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do"
    108         text run at (0,410) width 555: "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim"
    109         text run at (0,434) width 561: "veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo"
    110         text run at (0,458) width 595: "consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore"
    111         text run at (0,482) width 599: "eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa"
    112         text run at (0,506) width 325: "qui officia deserunt mollit anim id est laborum."
    113 layer at (28,1266) size 402x302 clip at (29,1267) size 400x300 scrollWidth 600 scrollHeight 528
    114   RenderBlock {DIV} at (20,69) size 402x303 [border: (1px solid #000000)]
    115     RenderBlock {DIV} at (1,1) size 600x528
    116       RenderText {#text} at (0,2) size 600x524
    117         text run at (0,2) width 565: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor"
    118         text run at (0,26) width 587: "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud"
    119         text run at (0,50) width 600: "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure"
    120         text run at (0,74) width 571: "dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
    121         text run at (0,98) width 571: "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt"
    122         text run at (0,122) width 191: "mollit anim id est laborum. "
    123         text run at (190,122) width 394: "Lorem ipsum dolor sit amet, consectetur adipisicing elit,"
    124         text run at (0,146) width 560: "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad"
    125         text run at (0,170) width 533: "minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea"
    126         text run at (0,194) width 576: "commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse"
    127         text run at (0,218) width 599: "cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,"
    128         text run at (0,242) width 424: "sunt in culpa qui officia deserunt mollit anim id est laborum. "
    129         text run at (423,242) width 154: "Lorem ipsum dolor sit"
    130         text run at (0,266) width 564: "amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et"
    131         text run at (0,290) width 577: "dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco"
    132         text run at (0,314) width 511: "laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in"
    133         text run at (0,338) width 591: "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur"
    134         text run at (0,362) width 592: "sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id"
    135         text run at (0,386) width 93: "est laborum. "
    136         text run at (92,386) width 447: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do"
    137         text run at (0,410) width 555: "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim"
    138         text run at (0,434) width 561: "veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo"
    139         text run at (0,458) width 595: "consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore"
    140         text run at (0,482) width 599: "eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa"
    141         text run at (0,506) width 325: "qui officia deserunt mollit anim id est laborum."
     1Both
     2
     3 
     4Just horizontal
     5
     6 
     7Just vertical
     8
     9None visible
     10
     11 
     12(scrolling tree
     13  (frame scrolling node
     14    (scrollable area size width=800 height=600)
     15    (total content size width=800 height=600)
     16    (last committed scroll position (0,0))
     17    (scrollable area parameters
     18      (horizontal scroll elasticity 1)
     19      (vertical scroll elasticity 1)
     20      (horizontal scrollbar mode 0)
     21      (vertical scrollbar mode 0))
     22    (layout viewport (0,0) width=800 height=600)
     23    (min layoutViewport origin (0,0))
     24    (max layoutViewport origin (0,0))
     25    (behavior for fixed 0)
     26    (overflow scrolling node
     27      (scrollable area size width=200 height=100)
     28      (total content size width=400 height=200)
     29      (last committed scroll position (0,0))
     30      (scrollable area parameters
     31        (horizontal scroll elasticity 1)
     32        (vertical scroll elasticity 1)
     33        (horizontal scrollbar mode 0)
     34        (vertical scrollbar mode 0)
     35        (has enabled horizontal scrollbar 1)
     36        (has enabled vertical scrollbar 1)))
     37    (overflow scrolling node
     38      (scrollable area size width=200 height=100)
     39      (total content size width=400 height=200)
     40      (last committed scroll position (0,0))
     41      (scrollable area parameters
     42        (horizontal scroll elasticity 1)
     43        (vertical scroll elasticity 1)
     44        (horizontal scrollbar mode 0)
     45        (vertical scrollbar mode 0)
     46        (has enabled horizontal scrollbar 1)
     47        (has enabled vertical scrollbar 1)
     48        (vertical scrollbar hidden by style 1)))
     49    (overflow scrolling node
     50      (scrollable area size width=200 height=100)
     51      (total content size width=400 height=200)
     52      (last committed scroll position (0,0))
     53      (scrollable area parameters
     54        (horizontal scroll elasticity 1)
     55        (vertical scroll elasticity 1)
     56        (horizontal scrollbar mode 0)
     57        (vertical scrollbar mode 0)
     58        (has enabled horizontal scrollbar 1)
     59        (has enabled vertical scrollbar 1)
     60        (horizontal scrollbar hidden by style 1)))
     61    (overflow scrolling node
     62      (scrollable area size width=200 height=100)
     63      (total content size width=400 height=200)
     64      (last committed scroll position (0,0))
     65      (scrollable area parameters
     66        (horizontal scroll elasticity 1)
     67        (vertical scroll elasticity 1)
     68        (horizontal scrollbar mode 0)
     69        (vertical scrollbar mode 0)
     70        (has enabled horizontal scrollbar 1)
     71        (has enabled vertical scrollbar 1)
     72        (horizontal scrollbar hidden by style 1)
     73        (vertical scrollbar hidden by style 1)))))
  • trunk/LayoutTests/fast/scrolling/ios/scrollbar-hiding.html

    r243347 r243416  
    22<html>
    33<head>
    4   <style type="text/css" media="screen">
     4    <style>
     5        ::-webkit-scrollbar {
     6            width: 16px;
     7            height: 16px;
     8            background-color: silver;
     9        }
    510
    6     ::-webkit-scrollbar {
    7         width: 16px;
    8         height: 16px;
    9         background-color: silver;
    10     }
     11        ::-webkit-scrollbar-track {
     12            -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
     13            border-radius: 10px;
     14        }
    1115
    12     ::-webkit-scrollbar-track {
    13         -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
    14         border-radius: 10px;
    15     }
     16        ::-webkit-scrollbar-thumb {
     17            border-radius: 10px;
     18            -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
     19        }
    1620
    17     ::-webkit-scrollbar-thumb {
    18         border-radius: 10px;
    19         -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
    20     }
    21    
    22     .container {
    23       display: inline-block;
    24     }
     21        .container {
     22            display: inline-block;
     23        }
    2524
    26     .overflowing {
    27       margin: 20px;
    28       font-family: Helvetica;
    29       line-height: 150%;
    30       height: 300px;
    31       width: 400px;
    32       border: 1px solid black;
    33       overflow: scroll;
    34       -webkit-overflow-scrolling: touch;
    35     }
    36    
    37     .contents {
    38       width: 150%;
    39     }
    40    
    41     ::-webkit-scrollbar {
    42       display: none;
    43     }
    44    
    45     .vertical::-webkit-scrollbar:vertical {
    46       display: block;
    47     }
     25        .overflowing {
     26            margin: 20px;
     27            height: 100px;
     28            width: 200px;
     29            border: 1px solid black;
     30            overflow: scroll;
     31            -webkit-overflow-scrolling: touch;
     32        }
    4833
    49     .horizontal::-webkit-scrollbar:horizontal {
    50       display: block;
    51     }
    52    
    53   </style>
     34        .contents {
     35            width: 200%;
     36            height: 200%;
     37        }
     38
     39        ::-webkit-scrollbar {
     40            display: none;
     41        }
     42
     43        .vertical::-webkit-scrollbar:vertical {
     44            display: block;
     45        }
     46
     47        .horizontal::-webkit-scrollbar:horizontal {
     48            display: block;
     49        }
     50    </style>
     51    <script>
     52        if (window.testRunner) {
     53            testRunner.waitUntilDone();
     54            testRunner.dumpAsText();
     55        }
     56
     57        function getScrollingTreeUIScript(x, y)
     58        {
     59            return `(function() {
     60                return uiController.scrollingTreeAsText;
     61            })();`;
     62        }
     63
     64        function doTest()
     65        {
     66            if (!testRunner.runUIScript)
     67                return
     68
     69            testRunner.runUIScript(getScrollingTreeUIScript(), function(scrollingTree) {
     70                document.getElementById('scrolling-tree').textContent = scrollingTree;
     71                testRunner.notifyDone();
     72            });
     73        }
     74       
     75        window.addEventListener('load', doTest, false);
     76    </script>
    5477</head>
    5578<body>
    56 
    5779  <div class="container">
    5880    <h2>Both</h2>
    5981    <div class="overflowing accelerated horizontal vertical">
    6082      <div class="contents">
    61         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    62         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    63         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    64         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    6583      </div>
    6684    </div>
    6785  </div>
    68 
    6986  <div class="container">
    7087    <h2>Just horizontal</h2>
    7188    <div class="overflowing accelerated horizontal">
    7289      <div class="contents">
    73         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    74         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    75         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    76         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    7790      </div>
    7891    </div>
    7992  </div>
    80 
    8193  <div class="container">
    8294    <h2>Just vertical</h2>
    8395    <div class="overflowing accelerated vertical">
    8496      <div class="contents">
    85         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    86         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    87         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    88         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    8997      </div>
    9098    </div>
    9199  </div>
    92 
    93100  <div class="container">
    94101    <h2>None visible</h2>
    95102    <div class="overflowing accelerated">
    96103      <div class="contents">
    97         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    98         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    99         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    100         Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    101104      </div>
    102105    </div>
    103106  </div>
     107<pre id="scrolling-tree"></pre>
    104108</body>
    105109</html>
  • trunk/Source/WebCore/ChangeLog

    r243414 r243416  
     12019-03-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
     4        https://bugs.webkit.org/show_bug.cgi?id=137043
     5        rdar://problem/16595330
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
     10        to the UI process, and use it to set UIScrollView indicators visible or not.
     11
     12        Tests: fast/scrolling/ios/scrollbar-hiding.html:
     13
     14        * page/scrolling/AsyncScrollingCoordinator.cpp:
     15        (WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
     16        * page/scrolling/ScrollingCoordinator.cpp:
     17        (WebCore::operator<<):
     18        * page/scrolling/ScrollingCoordinatorTypes.h:
     19        * page/scrolling/ScrollingTreeNode.h:
     20        * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
     21        (WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
     22        * page/scrolling/ScrollingTreeScrollingNode.h:
     23        * platform/ScrollableArea.h:
     24        (WebCore::ScrollableArea::horizontalScrollbarHiddenByStyle const):
     25        (WebCore::ScrollableArea::verticalScrollbarHiddenByStyle const):
     26        * rendering/RenderLayer.cpp:
     27        (WebCore::scrollbarHiddenByStyle):
     28        (WebCore::RenderLayer::horizontalScrollbarHiddenByStyle const):
     29        (WebCore::RenderLayer::verticalScrollbarHiddenByStyle const):
     30        * rendering/RenderLayer.h:
     31
    1322019-03-23  Zalan Bujtas  <zalan@apple.com>
    233
  • trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp

    r242913 r243416  
    654654    scrollParameters.horizontalScrollbarMode = scrollableArea.horizontalScrollbarMode();
    655655    scrollParameters.verticalScrollbarMode = scrollableArea.verticalScrollbarMode();
     656    scrollParameters.horizontalScrollbarHiddenByStyle = scrollableArea.horizontalScrollbarHiddenByStyle();
     657    scrollParameters.verticalScrollbarHiddenByStyle = scrollableArea.verticalScrollbarHiddenByStyle();
    656658    scrollParameters.useDarkAppearanceForScrollbars = scrollableArea.useDarkAppearanceForScrollbars();
    657659
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r242913 r243416  
    436436    ts.dumpProperty("horizontal scrollbar mode", scrollableAreaParameters.horizontalScrollbarMode);
    437437    ts.dumpProperty("vertical scrollbar mode", scrollableAreaParameters.verticalScrollbarMode);
     438
    438439    if (scrollableAreaParameters.hasEnabledHorizontalScrollbar)
    439440        ts.dumpProperty("has enabled horizontal scrollbar", scrollableAreaParameters.hasEnabledHorizontalScrollbar);
     
    441442        ts.dumpProperty("has enabled vertical scrollbar", scrollableAreaParameters.hasEnabledVerticalScrollbar);
    442443
     444    if (scrollableAreaParameters.horizontalScrollbarHiddenByStyle)
     445        ts.dumpProperty("horizontal scrollbar hidden by style", scrollableAreaParameters.horizontalScrollbarHiddenByStyle);
     446    if (scrollableAreaParameters.verticalScrollbarHiddenByStyle)
     447        ts.dumpProperty("vertical scrollbar hidden by style", scrollableAreaParameters.verticalScrollbarHiddenByStyle);
     448
    443449    return ts;
    444450}
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinatorTypes.h

    r242913 r243416  
    6767    bool hasEnabledVerticalScrollbar { false };
    6868
     69    bool horizontalScrollbarHiddenByStyle { false };
     70    bool verticalScrollbarHiddenByStyle { false };
     71
    6972    bool useDarkAppearanceForScrollbars { false };
    7073
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.h

    r242913 r243416  
    4242class ScrollingTreeScrollingNode;
    4343
    44 class ScrollingTreeNode : public RefCounted<ScrollingTreeNode> {
     44class ScrollingTreeNode : public ThreadSafeRefCounted<ScrollingTreeNode> {
    4545    friend class ScrollingTree;
    4646public:
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeOverflowScrollingNode.cpp

    r242997 r243416  
    4444{
    4545    ts << "overflow scrolling node";
    46     ScrollingTreeNode::dumpProperties(ts, behavior);
     46    ScrollingTreeScrollingNode::dumpProperties(ts, behavior);
    4747}
    4848
  • trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h

    r243316 r243416  
    6565    const FloatSize& scrollableAreaSize() const { return m_scrollableAreaSize; }
    6666    const FloatSize& totalContentsSize() const { return m_totalContentsSize; }
     67
     68    bool horizontalScrollbarHiddenByStyle() const { return m_scrollableAreaParameters.horizontalScrollbarHiddenByStyle; }
     69    bool verticalScrollbarHiddenByStyle() const { return m_scrollableAreaParameters.verticalScrollbarHiddenByStyle; }
    6770
    6871#if ENABLE(CSS_SCROLL_SNAP)
  • trunk/Source/WebCore/platform/ScrollableArea.h

    r242333 r243416  
    111111    virtual ScrollbarMode verticalScrollbarMode() const { return ScrollbarAuto; }
    112112
     113    virtual bool horizontalScrollbarHiddenByStyle() const { return false; }
     114    virtual bool verticalScrollbarHiddenByStyle() const { return false; }
     115
    113116    bool inLiveResize() const { return m_inLiveResize; }
    114117    WEBCORE_EXPORT virtual void willStartLiveResize();
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r243275 r243416  
    31203120}
    31213121
     3122static bool scrollbarHiddenByStyle(Scrollbar* scrollbar)
     3123{
     3124    if (!scrollbar || !scrollbar->isCustomScrollbar())
     3125        return false;
     3126
     3127    std::unique_ptr<RenderStyle> scrollbarStyle = static_cast<RenderScrollbar*>(scrollbar)->getScrollbarPseudoStyle(ScrollbarBGPart, PseudoId::Scrollbar);
     3128
     3129    return scrollbarStyle && scrollbarStyle->display() == DisplayType::None;
     3130}
     3131
     3132bool RenderLayer::horizontalScrollbarHiddenByStyle() const
     3133{
     3134    return scrollbarHiddenByStyle(horizontalScrollbar());
     3135}
     3136
     3137bool RenderLayer::verticalScrollbarHiddenByStyle() const
     3138{
     3139    return scrollbarHiddenByStyle(verticalScrollbar());
     3140}
     3141
    31223142static inline RenderElement* rendererForScrollbar(RenderLayerModelObject& renderer)
    31233143{
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r243209 r243416  
    439439    bool hasVerticalScrollbar() const { return verticalScrollbar(); }
    440440
     441    bool horizontalScrollbarHiddenByStyle() const override;
     442    bool verticalScrollbarHiddenByStyle() const override;
     443
    441444    // ScrollableArea overrides
    442445    ScrollPosition scrollPosition() const override { return m_scrollPosition; }
     
    445448    Scrollbar* verticalScrollbar() const override { return m_vBar.get(); }
    446449    ScrollableArea* enclosingScrollableArea() const override;
     450
    447451    bool isScrollableOrRubberbandable() override;
    448452    bool hasScrollableOrRubberbandableAncestor() override;
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r243309 r243416  
    44294429}
    44304430
    4431 static bool scrollbarHasDisplayNone(Scrollbar* scrollbar)
    4432 {
    4433     if (!scrollbar || !scrollbar->isCustomScrollbar())
    4434         return false;
    4435 
    4436     std::unique_ptr<RenderStyle> scrollbarStyle = static_cast<RenderScrollbar*>(scrollbar)->getScrollbarPseudoStyle(ScrollbarBGPart, PseudoId::Scrollbar);
    4437     return scrollbarStyle && scrollbarStyle->display() == DisplayType::None;
    4438 }
    4439 
    44404431void LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer(RenderLayer& layer)
    44414432{
     
    44434434    ASSERT(backing);
    44444435
    4445     bool allowHorizontalScrollbar = !scrollbarHasDisplayNone(layer.horizontalScrollbar());
    4446     bool allowVerticalScrollbar = !scrollbarHasDisplayNone(layer.verticalScrollbar());
     4436    bool allowHorizontalScrollbar = !layer.horizontalScrollbarHiddenByStyle();
     4437    bool allowVerticalScrollbar = !layer.verticalScrollbarHiddenByStyle();
    44474438    m_chromeClient.addOrUpdateScrollingLayer(layer.renderer().element(), backing->scrollContainerLayer()->platformLayer(), backing->scrolledContentsLayer()->platformLayer(),
    44484439        layer.reachableTotalContentsSize(), allowHorizontalScrollbar, allowVerticalScrollbar);
  • trunk/Source/WebKit/ChangeLog

    r243415 r243416  
     12019-03-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
     4        https://bugs.webkit.org/show_bug.cgi?id=137043
     5        rdar://problem/16595330
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
     10        to the UI process, and use it to set UIScrollView indicators visible or not.
     11       
     12        The scroll snap changes in ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren() fix a bug
     13        where hasChangedProperty(HorizontalSnapOffsets) was nested inside another set of hasChangedProperty()
     14        tests, so would never get called.
     15
     16        * Shared/WebCoreArgumentCoders.cpp:
     17        (IPC::ArgumentCoder<ScrollableAreaParameters>::encode):
     18        (IPC::ArgumentCoder<ScrollableAreaParameters>::decode):
     19        * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
     20        (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):
     21
    1222019-03-23  Zalan Bujtas  <zalan@apple.com>
    223
  • trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp

    r243163 r243416  
    21002100    encoder << parameters.hasEnabledVerticalScrollbar;
    21012101
     2102    encoder << parameters.horizontalScrollbarHiddenByStyle;
     2103    encoder << parameters.verticalScrollbarHiddenByStyle;
     2104
    21022105    encoder << parameters.useDarkAppearanceForScrollbars;
    21032106}
     
    21182121        return false;
    21192122    if (!decoder.decode(params.hasEnabledVerticalScrollbar))
     2123        return false;
     2124
     2125    if (!decoder.decode(params.horizontalScrollbarHiddenByStyle))
     2126        return false;
     2127    if (!decoder.decode(params.verticalScrollbarHiddenByStyle))
    21202128        return false;
    21212129
  • trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm

    r242356 r243416  
    263263            scrollView.contentInset = insets;
    264264        }
     265        END_BLOCK_OBJC_EXCEPTIONS
     266    }
    265267
    266268#if ENABLE(CSS_SCROLL_SNAP)
    267         // FIXME: If only one axis snaps in 2D scrolling, the other axis will decelerate fast as well. Is this what we want?
    268         if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::HorizontalSnapOffsets) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::VerticalSnapOffsets))
    269             scrollView.decelerationRate = scrollingNode().horizontalSnapOffsets().size() || scrollingNode().verticalSnapOffsets().size() ? UIScrollViewDecelerationRateFast : UIScrollViewDecelerationRateNormal;
    270 #endif
     269    // FIXME: If only one axis snaps in 2D scrolling, the other axis will decelerate fast as well. Is this what we want?
     270    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::HorizontalSnapOffsets) || scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::VerticalSnapOffsets)) {
     271        BEGIN_BLOCK_OBJC_EXCEPTIONS
     272        UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
     273        ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
     274
     275        scrollView.decelerationRate = scrollingNode().horizontalSnapOffsets().size() || scrollingNode().verticalSnapOffsets().size() ? UIScrollViewDecelerationRateFast : UIScrollViewDecelerationRateNormal;
     276#endif
     277        END_BLOCK_OBJC_EXCEPTIONS
     278    }
     279
     280    if (scrollingStateNode.hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaParams)) {
     281        BEGIN_BLOCK_OBJC_EXCEPTIONS
     282        UIScrollView *scrollView = (UIScrollView *)[scrollLayer() delegate];
     283        ASSERT([scrollView isKindOfClass:[UIScrollView self]]);
     284
     285        [scrollView setShowsHorizontalScrollIndicator:!scrollingNode().horizontalScrollbarHiddenByStyle()];
     286        [scrollView setShowsVerticalScrollIndicator:!scrollingNode().verticalScrollbarHiddenByStyle()];
     287
    271288        END_BLOCK_OBJC_EXCEPTIONS
    272289    }
Note: See TracChangeset for help on using the changeset viewer.