Changeset 276562 in webkit
- Timestamp:
- Apr 24, 2021, 7:12:07 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 15 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/model-element/model-element-contents-layer-updates-expected.txt (added)
-
LayoutTests/model-element/model-element-contents-layer-updates-with-clipping-expected.txt (added)
-
LayoutTests/model-element/model-element-contents-layer-updates-with-clipping.html (added)
-
LayoutTests/model-element/model-element-contents-layer-updates.html (added)
-
LayoutTests/model-element/model-element-graphics-layers-opacity.html (modified) (1 diff)
-
LayoutTests/model-element/resources/cube.usdz (added)
-
LayoutTests/platform/ios-wk2/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/mac/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/GraphicsLayerClient.h (modified) (1 diff)
-
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (modified) (7 diffs)
-
Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/ca/PlatformCALayer.h (modified) (1 diff)
-
Source/WebCore/testing/Internals.cpp (modified) (1 diff)
-
Source/WebCore/testing/Internals.h (modified) (1 diff)
-
Source/WebCore/testing/Internals.idl (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276558 r276562 1 2021-04-24 Tim Horton <timothy_horton@apple.com> 2 3 Changing the source of a model element with clipping applied does not update the model 4 https://bugs.webkit.org/show_bug.cgi?id=224917 5 6 Reviewed by Simon Fraser. 7 8 * model-element/model-element-contents-layer-updates-expected.txt: Added. 9 * model-element/model-element-contents-layer-updates-with-clipping-expected.txt: Added. 10 * model-element/model-element-contents-layer-updates-with-clipping.html: Added. 11 * model-element/model-element-contents-layer-updates.html: Added. 12 * model-element/resources/cube.usdz: Added. 13 * platform/ios-wk2/TestExpectations: 14 * platform/mac/TestExpectations: 15 Add tests that ensure that adding a <model> with one source, then changing 16 it to another, correctly updates the content layer. Test this both 17 with and without clipping (the without-clipping case passed before this change, 18 with-clipping failed). 19 20 These tests only work on Cocoa ports with UI-side compositing enabled 21 because they depend on the PlatformCALayer subclass holding on to the model 22 data (and logging its size) in order to distinguish between the two models. 23 1 24 2021-04-24 Julian Gonzalez <julian_a_gonzalez@apple.com> 2 25 -
trunk/LayoutTests/model-element/model-element-graphics-layers-opacity.html
r276327 r276562 26 26 model.ready.then(value => { 27 27 if (window.testRunner) 28 layers.innerText = window.internals.platformLayerTreeAsText(model , window.internals.PLATFORM_LAYER_TREE_INCLUDE_OPACITY);28 layers.innerText = window.internals.platformLayerTreeAsText(model); 29 29 model.remove(); 30 30 }, reason => { -
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r276391 r276562 46 46 fast/visual-viewport/rubberbanding-viewport-rects.html [ Pass ] 47 47 fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html [ Pass ] 48 49 model-element/model-element-contents-layer-updates-with-clipping.html [ Pass ] 50 model-element/model-element-contents-layer-updates.html [ Pass ] 48 51 49 52 # Pending SDK changes, re-skip these tests that are un-skipped above. -
trunk/LayoutTests/platform/mac/TestExpectations
r276520 r276562 67 67 fast/dom/Window/slow-unload-handler.html 68 68 fast/dom/Window/slow-unload-handler-only-frame-is-stopped.html 69 70 # This test only works with UI-side compositing 71 model-element/model-element-contents-layer-updates-with-clipping.html [ Skip ] 72 model-element/model-element-contents-layer-updates.html [ Skip ] 69 73 70 74 # Accessibility tests for notifications that don't exist or aren't needed on Mac OS X. -
trunk/Source/WebCore/ChangeLog
r276558 r276562 1 2021-04-24 Tim Horton <timothy_horton@apple.com> 2 3 Changing the source of a model element with clipping applied does not update the model 4 https://bugs.webkit.org/show_bug.cgi?id=224917 5 6 Reviewed by Simon Fraser. 7 8 Tests: model-element/model-element-contents-layer-updates-with-clipping.html 9 model-element/model-element-contents-layer-updates.html 10 11 Previously, a <model> with a contents clipping layer (e.g. border-radius) 12 would not reparent its contents layer in the right place when setContentsToModel 13 was called again (because the source changed), leaving the old model 14 contents layer in place. 15 16 * platform/graphics/ca/GraphicsLayerCA.cpp: 17 (WebCore::GraphicsLayerCA::updateSublayerList): 18 Ensure that updateSublayerList always parents contentsLayer in one of its two homes: 19 under contentsClippingLayer, if it exists; otherwise, directly under the primary layer. 20 21 (WebCore::GraphicsLayerCA::setContentsToModel): 22 Drive-by fix a bug revealed by the tests for this patch: when swapping out the 23 contents layer in setContentsToModel, we also need to mark ContentsRectsChanged, 24 or the new contents layer will not get its bounds set during the subsequent flush. 25 26 (WebCore::GraphicsLayerCA::setContentsToPlatformLayer): 27 Remove special-case code that was added to fix this bug just for setContentsToPlatformLayer; 28 this case is now correctly handled for all contents layers by updateSublayerList. 29 30 (WebCore::GraphicsLayerCA::dumpInnerLayer const): 31 * platform/graphics/GraphicsLayerClient.h: 32 * platform/graphics/ca/PlatformCALayer.cpp: 33 (WebCore::PlatformCALayer::dumpAdditionalProperties): 34 * platform/graphics/ca/PlatformCALayer.h: 35 * testing/Internals.cpp: 36 (WebCore::toPlatformLayerTreeFlags): 37 * testing/Internals.h: 38 * testing/Internals.idl: 39 Add a bit to platformLayerTreeAsText() that makes PlatformCALayerRemoteModelHosting 40 dump the size of the model that it is hosting, which is used in the test for this bug. 41 42 Remove the IncludeOpacity bit since we can just always log opacity if it's not the default. 43 1 44 2021-04-24 Julian Gonzalez <julian_a_gonzalez@apple.com> 2 45 -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r276327 r276562 91 91 Debug = 1 << 0, 92 92 IgnoreChildren = 1 << 1, 93 Include Opacity= 1 << 2,93 IncludeModels = 1 << 2, 94 94 }; 95 95 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r276513 r276562 1241 1241 noteSublayersChanged(); 1242 1242 1243 noteLayerPropertyChanged( OpacityChanged);1243 noteLayerPropertyChanged(ContentsRectsChanged | OpacityChanged); 1244 1244 } 1245 1245 #endif … … 1249 1249 if (m_contentsLayer && platformLayer == m_contentsLayer->platformLayer()) 1250 1250 return; 1251 1252 if (m_contentsClippingLayer && m_contentsLayer)1253 m_contentsLayer->removeFromSuperlayer();1254 1251 1255 1252 // FIXME: The passed in layer might be a raw layer or an externally created … … 1271 1268 m_contentsLayerPurpose = platformLayer ? purpose : ContentsLayerPurpose::None; 1272 1269 1273 if (m_contentsClippingLayer && m_contentsLayer)1274 m_contentsClippingLayer->appendSublayer(*m_contentsLayer);1275 1276 1270 noteSublayersChanged(); 1277 1271 noteLayerPropertyChanged(ContentsPlatformLayerChanged); … … 2031 2025 }; 2032 2026 2027 auto appendContentsLayer = [&](PlatformCALayerList& list) { 2028 if (m_contentsVisible && m_contentsLayer) 2029 list.append(m_contentsLayer); 2030 }; 2031 2033 2032 auto appendClippingLayers = [&](PlatformCALayerList& list) { 2034 if (!m_contentsVisible) 2035 return; 2036 2037 if (m_contentsClippingLayer) { 2033 if (m_contentsVisible && m_contentsClippingLayer) 2038 2034 list.append(m_contentsClippingLayer); 2039 return;2040 }2041 2042 if (m_contentsLayer)2043 list.append(m_contentsLayer);2044 2035 }; 2045 2036 … … 2048 2039 list.appendVector(*customSublayers); 2049 2040 2050 appendClippingLayers(list); 2041 if (m_contentsClippingLayer) 2042 appendClippingLayers(list); 2043 else 2044 appendContentsLayer(list); 2051 2045 }; 2052 2046 … … 2077 2071 2078 2072 bool clippingLayerHostsChildren = m_contentsRectClipsDescendants && m_contentsClippingLayer; 2079 if ( clippingLayerHostsChildren) {2073 if (m_contentsClippingLayer) { 2080 2074 PlatformCALayerList clippingChildren; 2081 buildChildLayerList(clippingChildren); 2075 if (clippingLayerHostsChildren) 2076 buildChildLayerList(clippingChildren); 2077 appendContentsLayer(clippingChildren); 2082 2078 m_contentsClippingLayer->setSublayers(clippingChildren); 2083 2079 } … … 3982 3978 ts << indent << "(bounds " << layer->bounds().width() << " " << layer->bounds().height() << ")\n"; 3983 3979 3984 if ( flags.contains(PlatformLayerTreeAsTextFlags::IncludeOpacity))3980 if (layer->opacity() != 1) 3985 3981 ts << indent << "(opacity " << layer->opacity() << ")\n"; 3986 3982 3987 3983 if (layer->isHidden()) 3988 3984 ts << indent << "(hidden)\n"; 3985 3986 layer->dumpAdditionalProperties(ts, flags); 3989 3987 3990 3988 if (!flags.contains(PlatformLayerTreeAsTextFlags::IgnoreChildren)) { -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp
r274033 r276562 199 199 } 200 200 201 void PlatformCALayer::dumpAdditionalProperties(TextStream&, OptionSet<PlatformLayerTreeAsTextFlags>) 202 { 203 } 204 201 205 TextStream& operator<<(TextStream& ts, PlatformCALayer::LayerType layerType) 202 206 { -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r276085 r276562 301 301 302 302 void moveToLayerPool(); 303 304 virtual void dumpAdditionalProperties(TextStream&, OptionSet<PlatformLayerTreeAsTextFlags>); 303 305 304 306 protected: -
trunk/Source/WebCore/testing/Internals.cpp
r276414 r276562 2862 2862 if (flags & Internals::PLATFORM_LAYER_TREE_IGNORES_CHILDREN) 2863 2863 platformLayerTreeFlags.add(PlatformLayerTreeAsTextFlags::IgnoreChildren); 2864 if (flags & Internals::PLATFORM_LAYER_TREE_INCLUDE_ OPACITY)2865 platformLayerTreeFlags.add(PlatformLayerTreeAsTextFlags::Include Opacity);2864 if (flags & Internals::PLATFORM_LAYER_TREE_INCLUDE_MODELS) 2865 platformLayerTreeFlags.add(PlatformLayerTreeAsTextFlags::IncludeModels); 2866 2866 return platformLayerTreeFlags; 2867 2867 } -
trunk/Source/WebCore/testing/Internals.h
r276414 r276562 426 426 PLATFORM_LAYER_TREE_DEBUG = 1, 427 427 PLATFORM_LAYER_TREE_IGNORES_CHILDREN = 2, 428 PLATFORM_LAYER_TREE_INCLUDE_ OPACITY= 4,428 PLATFORM_LAYER_TREE_INCLUDE_MODELS = 4, 429 429 }; 430 430 ExceptionOr<String> platformLayerTreeAsText(Element&, unsigned short flags) const; -
trunk/Source/WebCore/testing/Internals.idl
r276414 r276562 505 505 const unsigned short PLATFORM_LAYER_TREE_DEBUG = 1; 506 506 const unsigned short PLATFORM_LAYER_TREE_IGNORES_CHILDREN = 2; 507 const unsigned short PLATFORM_LAYER_TREE_INCLUDE_ OPACITY= 4;507 const unsigned short PLATFORM_LAYER_TREE_INCLUDE_MODELS = 4; 508 508 DOMString platformLayerTreeAsText(Element element, optional unsigned short flags = 0); 509 509 -
trunk/Source/WebKit/ChangeLog
r276545 r276562 1 2021-04-24 Tim Horton <timothy_horton@apple.com> 2 3 Changing the source of a model element with clipping applied does not update the model 4 https://bugs.webkit.org/show_bug.cgi?id=224917 5 6 Reviewed by Simon Fraser. 7 8 * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.h: 9 * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.mm: 10 (WebKit::PlatformCALayerRemoteModelHosting::dumpAdditionalProperties): 11 Add a bit to platformLayerTreeAsText() that makes PlatformCALayerRemoteModelHosting 12 dump the size of the model that it is hosting, which is used in the test for this bug. 13 1 14 2021-04-23 Kate Cheney <katherine_cheney@apple.com> 2 15 -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.h
r274033 r276562 43 43 44 44 void populateCreationProperties(RemoteLayerTreeTransaction::LayerCreationProperties&, const RemoteLayerTreeContext&, WebCore::PlatformCALayer::LayerType) override; 45 46 void dumpAdditionalProperties(TextStream&, OptionSet<PlatformLayerTreeAsTextFlags>) final; 45 47 46 48 Ref<Model> m_model; -
trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.mm
r274033 r276562 67 67 } 68 68 69 void PlatformCALayerRemoteModelHosting::dumpAdditionalProperties(TextStream& ts, OptionSet<PlatformLayerTreeAsTextFlags> flags) 70 { 71 if (flags.contains(PlatformLayerTreeAsTextFlags::IncludeModels)) 72 ts << indent << "(model data size " << m_model->data()->size() << ")\n"; 73 } 74 69 75 } // namespace WebKit
Note:
See TracChangeset
for help on using the changeset viewer.