Changeset 290785 in webkit
- Timestamp:
- Mar 3, 2022 10:25:57 AM (5 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/fast/repaint/background-attachment-fixed-in-composited-scroll-expected.txt (added)
-
LayoutTests/fast/repaint/background-attachment-fixed-in-composited-scroll.html (added)
-
LayoutTests/platform/mac-wk2/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderElement.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderLayer.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerScrollableArea.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/FillLayer.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/FillLayer.h (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r290783 r290785 1 2022-03-03 Simon Fraser <simon.fraser@apple.com> 2 3 nasa.gov page with fixed backgrounds paints incorrectly on scroll 4 https://bugs.webkit.org/show_bug.cgi?id=237405 5 <rdar://66568551> 6 7 Reviewed by Antti Koivisto. 8 9 Repaint test which is only valid for mac-wk2 (iOS does not support background-attachment:fixed). 10 11 * TestExpectations: 12 * fast/repaint/background-attachment-fixed-in-composited-scroll-expected.txt: Added. 13 * fast/repaint/background-attachment-fixed-in-composited-scroll.html: Added. 14 * platform/mac-wk2/TestExpectations: 15 1 16 2022-03-03 Jon Lee <jonlee@apple.com> 2 17 -
trunk/LayoutTests/TestExpectations
r290729 r290785 93 93 compositing/layer-creation/clipping-scope [ Skip ] 94 94 fast/repaint/background-attachment-local-scroll.html [ Skip ] 95 fast/repaint/background-attachment-fixed-in-composited-scroll.html [ Skip ] 95 96 96 97 # WebKit2 only. -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r290745 r290785 44 44 45 45 fast/repaint/background-attachment-local-scroll.html [ Pass ] 46 fast/repaint/background-attachment-fixed-in-composited-scroll.html [ Pass ] 46 47 fast/scrolling/unfocusing-page-while-keyboard-scrolling.html [ Pass ] 47 48 -
trunk/Source/WebCore/ChangeLog
r290782 r290785 1 2022-03-03 Simon Fraser <simon.fraser@apple.com> 2 3 nasa.gov page with fixed backgrounds paints incorrectly on scroll 4 https://bugs.webkit.org/show_bug.cgi?id=237405 5 <rdar://66568551> 6 7 Reviewed by Antti Koivisto. 8 9 https://www.nasa.gov/specials/artemis/ shows an issue where elements with background-attachment:fixed 10 don't repaint on scroll. This page has scrollable <html> and <body>, and the elements with fixed 11 backgrounds are composited, so this reveals that we fail to repaint composited children 12 of an overflow scroll in this case. 13 14 Fix by having RenderLayerScrollableArea::scrollTo() do repaints on slow repaint objects 15 which are scrolled by the current scroller. 16 17 Do some unrelated cleanup in code that I was going to use in this patch but turned out 18 not to need: rename hasFixedBackgroundImage() to hasAnyFixedBackground() for clarity, 19 and share the implementation with hasAnyLocalBackground(). 20 21 Test: fast/repaint/background-attachment-fixed-in-composited-scroll.html 22 23 * rendering/RenderElement.cpp: 24 (WebCore::RenderElement::styleWillChange): 25 (WebCore::RenderElement::willBeDestroyed): 26 * rendering/RenderLayer.cpp: 27 * rendering/RenderLayerScrollableArea.cpp: 28 (WebCore::RenderLayerScrollableArea::scrollTo): 29 * rendering/style/FillLayer.cpp: 30 (WebCore::FillLayer::hasImageWithAttachment const): 31 (WebCore::FillLayer::hasFixedImage const): Deleted. 32 * rendering/style/FillLayer.h: 33 * rendering/style/RenderStyle.cpp: 34 (WebCore::RenderStyle::hasAnyLocalBackground const): Deleted. 35 * rendering/style/RenderStyle.h: 36 (WebCore::RenderStyle::hasBackgroundImage const): 37 (WebCore::RenderStyle::hasAnyFixedBackground const): 38 (WebCore::RenderStyle::hasAnyLocalBackground const): 39 (WebCore::RenderStyle::hasFixedBackgroundImage const): Deleted. 40 1 41 2022-03-03 Alan Bujtas <zalan@apple.com> 2 42 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r290564 r290785 904 904 905 905 bool newStyleSlowScroll = false; 906 if (newStyle.has FixedBackgroundImage() && !settings().fixedBackgroundsPaintRelativeToDocument()) {906 if (newStyle.hasAnyFixedBackground() && !settings().fixedBackgroundsPaintRelativeToDocument()) { 907 907 newStyleSlowScroll = true; 908 908 bool drawsRootBackground = isDocumentElementRenderer() || (isBody() && !rendererHasBackground(document().documentElement()->renderer())); … … 1053 1053 document().contentChangeObserver().rendererWillBeDestroyed(*element()); 1054 1054 #endif 1055 if (m_style.has FixedBackgroundImage() && !settings().fixedBackgroundsPaintRelativeToDocument())1055 if (m_style.hasAnyFixedBackground() && !settings().fixedBackgroundsPaintRelativeToDocument()) 1056 1056 view().frameView().removeSlowRepaintObject(*this); 1057 1057 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r290770 r290785 3036 3036 return paintingReflection && !layer->has3DTransform(); 3037 3037 } 3038 3038 3039 3039 static inline bool shouldSuppressPaintingLayer(RenderLayer* layer) 3040 3040 { -
trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp
r290625 r290785 380 380 } 381 381 382 auto isScrolledBy = [](RenderObject& renderer, RenderLayer& scrollableLayer) { 383 auto layer = renderer.enclosingLayer(); 384 return layer && layer->ancestorLayerIsInContainingBlockChain(scrollableLayer); 385 }; 386 382 387 // Just schedule a full repaint of our object. 383 if (requiresRepaint) 388 if (requiresRepaint) { 384 389 renderer.repaintUsingContainer(repaintContainer, rectForRepaint); 390 391 // We also have to repaint any descendant composited layers that have fixed backgrounds. 392 if (auto slowRepaintObjects = view.frameView().slowRepaintObjects()) { 393 for (auto& renderer : *slowRepaintObjects) { 394 if (isScrolledBy(renderer, m_layer)) 395 renderer.repaint(); 396 } 397 } 398 } 385 399 386 400 // Schedule the scroll and scroll-related DOM events. -
trunk/Source/WebCore/rendering/style/FillLayer.cpp
r286795 r290785 388 388 } 389 389 390 bool FillLayer::has FixedImage() const390 bool FillLayer::hasImageWithAttachment(FillAttachment attachment) const 391 391 { 392 392 for (auto* layer = this; layer; layer = layer->m_next.get()) { 393 if (layer->m_image && layer->attachment() == FillAttachment::FixedBackground)393 if (layer->m_image && layer->attachment() == attachment) 394 394 return true; 395 395 } -
trunk/Source/WebCore/rendering/style/FillLayer.h
r286795 r290785 150 150 bool imagesAreLoaded() const; 151 151 bool hasImage() const { return m_next ? hasImageInAnyLayer() : m_image; } 152 bool has FixedImage() const;152 bool hasImageWithAttachment(FillAttachment) const; 153 153 bool hasOpaqueImage(const RenderElement&) const; 154 154 bool hasRepeatXY() const; -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r290779 r290785 1688 1688 { 1689 1689 return allLayersAreFixed(backgroundLayers()); 1690 }1691 1692 bool RenderStyle::hasAnyLocalBackground() const1693 {1694 for (auto* layer = &backgroundLayers(); layer; layer = layer->next()) {1695 if (layer->image() && layer->attachment() == FillAttachment::LocalBackground)1696 return true;1697 }1698 return false;1699 1690 } 1700 1691 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r290779 r290785 212 212 bool hasMarginAfterQuirk() const { return marginAfter().hasQuirk(); } 213 213 214 bool hasBackgroundImage() const { return m_backgroundData->background->hasImage(); }215 bool has FixedBackgroundImage() const { return m_backgroundData->background->hasFixedImage(); }214 bool hasBackgroundImage() const { return backgroundLayers().hasImage(); } 215 bool hasAnyFixedBackground() const { return backgroundLayers().hasImageWithAttachment(FillAttachment::FixedBackground); } 216 216 217 217 bool hasEntirelyFixedBackground() const; 218 bool hasAnyLocalBackground() const ;218 bool hasAnyLocalBackground() const { return backgroundLayers().hasImageWithAttachment(FillAttachment::LocalBackground); } 219 219 220 220 bool hasAppearance() const { return appearance() != NoControlPart; }
Note: See TracChangeset
for help on using the changeset viewer.