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

Changeset 267067 in webkit


Ignore:
Timestamp:
Sep 14, 2020, 7:17:25 PM (6 years ago)
Author:
Simon Fraser
Message:

REGRESSION (Async overflow scroll): Code snippets on getkirby.com appear and disappear as content is scrolled
https://bugs.webkit.org/show_bug.cgi?id=216490
<rdar://problem/67018073>

Reviewed by Zalan Bujtas.
Source/WebCore:

The content in question had a z-order layer tree like this:

A (0,0) width=997 height=829 (layerID 20) {sc 2} RenderView

+ B (0,0) width=997 height=8 RenderBlock HTML class='no-js'

+ C (0,0) width=997 height=829 RenderFlexibleBox MAIN

n D (0,0) width=256 height=829 RenderFlexibleBox NAV class='left panel'

n E (0,0) width=256 height=829 (layerID 25) {sc 3} RenderBlock DIV class='scroller'

n F (256,0) width=741 height=829 RenderFlexibleBox ARTICLE class='main panel'

n G (0,0) width=741 height=829 (layerID 26) {sc 4} RenderBlock DIV class='scroller'

n H (0,-816) width=741 height=2810 RenderBlock DIV class='article-content'

+ I (0,0) width=256 height=1000 (layerID 27) overlap RenderBlock (relative positioned) DIV class='content'
+ J (10,300) width=721 height=202 (layerID 28) overlap RenderBlock (relative positioned) DIV class='relative-box'
+ K (10,802) width=721 height=202 (layerID 29) overlap RenderBlock (relative positioned) DIV class='relative-box'
+ L (10,1304) width=721 height=202 (layerID 30) overlap RenderBlock (relative positioned) DIV class='relative-box'
+ M (10,1806) width=721 height=202 (layerID 31) overlap RenderBlock (relative positioned) DIV class='relative-box'
+ M (10,2308) width=721 height=202 (layerID 32) overlap RenderBlock (relative positioned) DIV class='relative-box'

When layer 'G' is scrolled, the code would find the paint-order parent, F, which is normal-flow because it has overflow:hidden,
and would call setDescendantsNeedUpdateBackingAndHierarchyTraversal() on it. However, that doesn't go high enough, because
we need to update J-M since their ancestor clipping stacks have geometry that relies on the scroll position of G. If we don't
update that geometry, GraphicsLayers have an incorrect notion of what's visible, and we don't attach backing store.

The fix is to climb up to the stacking context B and call setDescendantsNeedUpdateBackingAndHierarchyTraversal() on it.

Test: compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::scrollTo):

LayoutTests:

  • compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment-expected.txt: Added.
  • compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment.html: Added.
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r267066 r267067  
     12020-09-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (Async overflow scroll): Code snippets on getkirby.com appear and disappear as content is scrolled
     4        https://bugs.webkit.org/show_bug.cgi?id=216490
     5        <rdar://problem/67018073>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment-expected.txt: Added.
     10        * compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment.html: Added.
     11
    1122020-09-14  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt

    r266825 r267067  
    8888                (GraphicsLayer
    8989                  (position 23.00 23.00)
     90                  (bounds origin 0.00 150.00)
    9091                  (bounds 195.00 210.00)
    9192                  (clips 1)
  • trunk/LayoutTests/platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/clipped-layer-in-overflow-nested-expected.txt

    r246725 r267067  
    7777                (GraphicsLayer
    7878                  (position 23.00 23.00)
     79                  (bounds origin 0.00 150.00)
    7980                  (bounds 210.00 210.00)
    8081                  (clips 1)
  • trunk/Source/WebCore/ChangeLog

    r267066 r267067  
     12020-09-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (Async overflow scroll): Code snippets on getkirby.com appear and disappear as content is scrolled
     4        https://bugs.webkit.org/show_bug.cgi?id=216490
     5        <rdar://problem/67018073>
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        The content in question had a z-order layer tree like this:
     10
     11            A (0,0) width=997 height=829 (layerID 20) {sc 2} RenderView
     12              + B (0,0) width=997 height=8 RenderBlock  HTML  class='no-js'
     13                + C (0,0) width=997 height=829 RenderFlexibleBox  MAIN
     14                  n D (0,0) width=256 height=829 RenderFlexibleBox  NAV  class='left panel'
     15                    n E (0,0) width=256 height=829 (layerID 25) {sc 3} RenderBlock  DIV  class='scroller'
     16                  n F (256,0) width=741 height=829 RenderFlexibleBox  ARTICLE  class='main panel'
     17                    n G (0,0) width=741 height=829 (layerID 26) {sc 4} RenderBlock  DIV  class='scroller'
     18                      n H (0,-816) width=741 height=2810 RenderBlock  DIV  class='article-content'
     19                + I (0,0) width=256 height=1000 (layerID 27) overlap RenderBlock (relative positioned)  DIV  class='content'
     20                + J (10,300) width=721 height=202 (layerID 28) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
     21                + K (10,802) width=721 height=202 (layerID 29) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
     22                + L (10,1304) width=721 height=202 (layerID 30) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
     23                + M (10,1806) width=721 height=202 (layerID 31) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
     24                + M (10,2308) width=721 height=202 (layerID 32) overlap RenderBlock (relative positioned)  DIV  class='relative-box'
     25
     26        When layer 'G' is scrolled, the code would find the paint-order parent, F, which is normal-flow because it has overflow:hidden,
     27        and would call setDescendantsNeedUpdateBackingAndHierarchyTraversal() on it. However, that doesn't go high enough, because
     28        we need to update J-M since their ancestor clipping stacks have geometry that relies on the scroll position of G. If we don't
     29        update that geometry, GraphicsLayers have an incorrect notion of what's visible, and we don't attach backing store.
     30
     31        The fix is to climb up to the stacking context B and call setDescendantsNeedUpdateBackingAndHierarchyTraversal() on it.
     32
     33        Test: compositing/scrolling/async-overflow-scrolling/nested-scrollers-backing-attachment.html
     34
     35        * rendering/RenderLayer.cpp:
     36        (WebCore::RenderLayer::scrollTo):
     37
    1382020-09-14  Chris Dumez  <cdumez@apple.com>
    239
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r267002 r267067  
    27302730
    27312731                // Scroll position can affect the location of a composited descendant (which may be a sibling in z-order),
    2732                 // so trigger a descendant walk from the paint-order parent.
    2733                 if (auto* paintParent = paintOrderParent())
     2732                // so trigger a descendant walk from the stacking context.
     2733                if (auto* paintParent = stackingContext())
    27342734                    paintParent->setDescendantsNeedUpdateBackingAndHierarchyTraversal();
    27352735            }
Note: See TracChangeset for help on using the changeset viewer.