haikuwebkit/LayoutTests/model-element
Tim Horton c6b5e99898 Changing the source of a model element with clipping applied does not update the model
https://bugs.webkit.org/show_bug.cgi?id=224917

Reviewed by Simon Fraser.

Source/WebCore:

Tests: model-element/model-element-contents-layer-updates-with-clipping.html
       model-element/model-element-contents-layer-updates.html

Previously, a <model> with a contents clipping layer (e.g. border-radius)
would not reparent its contents layer in the right place when setContentsToModel
was called again (because the source changed), leaving the old model
contents layer in place.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateSublayerList):
Ensure that updateSublayerList always parents contentsLayer in one of its two homes:
under contentsClippingLayer, if it exists; otherwise, directly under the primary layer.

(WebCore::GraphicsLayerCA::setContentsToModel):
Drive-by fix a bug revealed by the tests for this patch: when swapping out the
contents layer in setContentsToModel, we also need to mark ContentsRectsChanged,
or the new contents layer will not get its bounds set during the subsequent flush.

(WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
Remove special-case code that was added to fix this bug just for setContentsToPlatformLayer;
this case is now correctly handled for all contents layers by updateSublayerList.

(WebCore::GraphicsLayerCA::dumpInnerLayer const):
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::dumpAdditionalProperties):
* platform/graphics/ca/PlatformCALayer.h:
* testing/Internals.cpp:
(WebCore::toPlatformLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:
Add a bit to platformLayerTreeAsText() that makes PlatformCALayerRemoteModelHosting
dump the size of the model that it is hosting, which is used in the test for this bug.

Remove the IncludeOpacity bit since we can just always log opacity if it's not the default.

Source/WebKit:

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteModelHosting.mm:
(WebKit::PlatformCALayerRemoteModelHosting::dumpAdditionalProperties):
Add a bit to platformLayerTreeAsText() that makes PlatformCALayerRemoteModelHosting
dump the size of the model that it is hosting, which is used in the test for this bug.

LayoutTests:

* model-element/model-element-contents-layer-updates-expected.txt: Added.
* model-element/model-element-contents-layer-updates-with-clipping-expected.txt: Added.
* model-element/model-element-contents-layer-updates-with-clipping.html: Added.
* model-element/model-element-contents-layer-updates.html: Added.
* model-element/resources/cube.usdz: Added.
* platform/ios-wk2/TestExpectations:
* platform/mac/TestExpectations:
Add tests that ensure that adding a <model> with one source, then changing
it to another, correctly updates the content layer. Test this both
with and without clipping (the without-clipping case passed before this change,
with-clipping failed).

These tests only work on Cocoa ports with UI-side compositing enabled
because they depend on the PlatformCALayer subclass holding on to the model
data (and logging its size) in order to distinguish between the two models.


Canonical link: https://commits.webkit.org/236998@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276562 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-25 02:12:07 +00:00
..
resources Changing the source of a model element with clipping applied does not update the model 2021-04-25 02:12:07 +00:00
model-element-contents-layer-updates-expected.txt Changing the source of a model element with clipping applied does not update the model 2021-04-25 02:12:07 +00:00
model-element-contents-layer-updates-with-clipping-expected.txt Changing the source of a model element with clipping applied does not update the model 2021-04-25 02:12:07 +00:00
model-element-contents-layer-updates-with-clipping.html Changing the source of a model element with clipping applied does not update the model 2021-04-25 02:12:07 +00:00
model-element-contents-layer-updates.html Changing the source of a model element with clipping applied does not update the model 2021-04-25 02:12:07 +00:00
model-element-expected.txt
model-element-graphics-layers-expected.txt <model> should create a model-owning compositing layer 2021-03-06 11:13:42 +00:00
model-element-graphics-layers-opacity-expected.txt Separated models don't get opacity set on them at all 2021-04-20 23:21:06 +00:00
model-element-graphics-layers-opacity.html Changing the source of a model element with clipping applied does not update the model 2021-04-25 02:12:07 +00:00
model-element-graphics-layers.html Separated models don't get opacity set on them at all 2021-04-20 23:21:06 +00:00
model-element-ready-expected.txt HTMLModelElement needs a renderer 2021-02-23 01:43:27 +00:00
model-element-ready-load-aborted-expected.txt
model-element-ready-load-aborted.html REGRESSION (r274033): [ macOS/iOS ] model-element/model-element-ready-load-aborted.html is text failing 2021-03-09 01:49:58 +00:00
model-element-ready-load-failed-expected.txt
model-element-ready-load-failed.html
model-element-ready.html
model-element-renderer-expected.txt <model> should create a model-owning compositing layer 2021-03-06 11:13:42 +00:00
model-element-renderer-no-source-expected.txt <model> should create a model-owning compositing layer 2021-03-06 11:13:42 +00:00
model-element-renderer-no-source.html Fix model test differences between platforms 2021-02-24 05:34:19 +00:00
model-element-renderer.html Fix model test differences between platforms 2021-02-24 05:34:19 +00:00
model-element-source-expected.txt
model-element-source.html
model-element.html