Changeset 238876 in webkit


Ignore:
Timestamp:
Dec 4, 2018 2:58:36 PM (5 years ago)
Author:
Simon Fraser
Message:

REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
https://bugs.webkit.org/show_bug.cgi?id=192320
<rdar://problem/46429833>

Reviewed by Zalan Bujtas.
Source/WebCore:

Re-land r238840 with a more reliable test.

When we fall into slow scrolling mode (for example, because of background-attachment: fixed),
RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers
for viewport-constrained objects so we update them.

This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already
does enough dirtying that fixed layers nested inside scrollers get updated.

Test: compositing/fixed-with-main-thread-scrolling.html

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::updateCompositingLayers):

LayoutTests:

  • compositing/fixed-with-main-thread-scrolling-expected.html: Added.
  • compositing/fixed-with-main-thread-scrolling.html: Added.
  • platform/ios/TestExpectations:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r238875 r238876  
     12018-12-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
     4        https://bugs.webkit.org/show_bug.cgi?id=192320
     5        <rdar://problem/46429833>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * compositing/fixed-with-main-thread-scrolling-expected.html: Added.
     10        * compositing/fixed-with-main-thread-scrolling.html: Added.
     11        * platform/ios/TestExpectations:
     12
    1132018-12-04  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/LayoutTests/platform/ios/TestExpectations

    r238875 r238876  
    795795
    796796# These tests rely on EventSender.keydown(), which is not supported on iOS
     797compositing/fixed-with-main-thread-scrolling.html [ Skip ]
    797798editing/caret/emoji.html [ WontFix ]
    798799editing/deleting/5729680.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r238874 r238876  
     12018-12-04  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
     4        https://bugs.webkit.org/show_bug.cgi?id=192320
     5        <rdar://problem/46429833>
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        Re-land r238840 with a more reliable test.
     10       
     11        When we fall into slow scrolling mode (for example, because of background-attachment: fixed),
     12        RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers
     13        for viewport-constrained objects so we update them.
     14       
     15        This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already
     16        does enough dirtying that fixed layers nested inside scrollers get updated.
     17
     18        Test: compositing/fixed-with-main-thread-scrolling.html
     19
     20        * rendering/RenderLayerCompositor.cpp:
     21        (WebCore::RenderLayerCompositor::updateCompositingLayers):
     22
    1232018-12-04  Youenn Fablet  <youenn@apple.com>
    224
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r238855 r238876  
    667667        enableCompositingMode(true);
    668668
     669    bool isPageScroll = !updateRoot || updateRoot == &rootRenderLayer();
    669670    updateRoot = &rootRenderLayer();
    670671
    671672    if (updateType == CompositingUpdateType::OnScroll || updateType == CompositingUpdateType::OnCompositedScroll) {
     673        // We only get here if we didn't scroll on the scrolling thread, so this update needs to re-position viewport-constrained layers.
     674        if (m_renderView.settings().acceleratedCompositingForFixedPositionEnabled() && isPageScroll) {
     675            if (auto* viewportConstrainedObjects = m_renderView.frameView().viewportConstrainedObjects()) {
     676                for (auto* renderer : *viewportConstrainedObjects) {
     677                    if (auto* layer = renderer->layer())
     678                        layer->setNeedsCompositingGeometryUpdate();
     679                }
     680            }
     681        }
     682
    672683        // Scrolling can affect overlap. FIXME: avoid for page scrolling.
    673684        updateRoot->setDescendantsNeedCompositingRequirementsTraversal();
Note: See TracChangeset for help on using the changeset viewer.