Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b0dfdebfdb99e029777f57fa38d6360f71a4537f
https://github.com/WebKit/WebKit/commit/b0dfdebfdb99e029777f57fa38d6360f71a4537f
Author: Qianlang Chen <[email protected]>
Date: 2026-08-27 (Thu, 27 Aug 2026)
Changed paths:
M LayoutTests/inspector/layers/layers-anonymous-expected.txt
M LayoutTests/inspector/layers/layers-anonymous.html
M
LayoutTests/inspector/layers/layers-blending-compositing-reasons-expected.txt
M LayoutTests/inspector/layers/layers-blending-compositing-reasons.html
M LayoutTests/inspector/layers/layers-compositing-reasons-expected.txt
M LayoutTests/inspector/layers/layers-compositing-reasons.html
M LayoutTests/inspector/layers/layers-for-node-expected.txt
M LayoutTests/inspector/layers/layers-for-node.html
M LayoutTests/inspector/layers/layers-generated-content-expected.txt
M LayoutTests/inspector/layers/layers-generated-content.html
M LayoutTests/inspector/layers/layers-reflected-content-expected.txt
M LayoutTests/inspector/layers/layers-reflected-content.html
A LayoutTests/inspector/layers/resources/layer-utilities.js
M LayoutTests/platform/mac/TestExpectations
Log Message:
-----------
[Site Isolation] Web Inspector: Rework protocol tests in inspector/layers to
prep for frame target enablement
rdar://185371675
https://bugs.webkit.org/show_bug.cgi?id=322150
Reviewed by BJ Burg.
This is a step toward enabling frame target, vending them and using them
in the frontend, by preemptively reworking layout tests that fail when
frame targets are enabled by a fix to webkit.org/b/321734.
Protocol tests send every command to the main frame's inspector
controller first, and only the domains that frame does not serve fall
back to the page, because InspectorStubFrontend is created with
DispatchBackendTarget::MainFrame. DOM is served per frame and LayerTree
is not, so DOM.getDocument is answered by FrameDOMAgent and primes that
agent's node-id space, while LayerTree.layersForNode keeps resolving
node ids through the page's InspectorDOMAgent, whose document was never
requested. The two id spaces are disjoint, and the command fails with
"Missing node for given nodeId".
A protocol test cannot choose which target a command goes to, and there
is no plan to teach it how. These tests are rewritten as frontend tests
instead, where WI.domManager sources nodes from the page target for
both sides of the call, which is also the path the product itself
takes.
All six tests in the directory are converted, not only the three the
EWS run reported as regressions. The other three failed identically,
but already carried lenient Pass Failure expectations, so their
failures counted as expected results and never surfaced. Those
expectations are removed. The rewritten tests wait for an event the
page sends once the new layer has reached the layer tree, instead of
re-reading the tree after a bare requestAnimationFrame, and they report
only the geometry they assert on instead of serializing every layer.
- LayerTree.layerTreeDidChange would be the more direct thing to wait
for, since the backend dispatches it at the end of the compositing
update that creates the layer, but it cannot be used here. The agent
sends that event at most once per LayerTree.layersForNode call, so any
unrelated compositing update between the test's first request and its
mutation consumes the one event the mutation would have produced, and
the test would then be left waiting for an event that never arrives.
- The recorded layer set changes as a side effect. layers-for-node used
to record six layers before its mutation, including a second
window-sized layer, where the converted test records five. Five is
what the neighboring layer-tree-manager.html asserts for the same set
of composited divs, and that test has never needed a lenient
expectation. The old test read the tree immediately after enabling the
agent and receiving the first layerTreeDidChange, which is a different
point in the layer-tree lifecycle than where the converted test reads
it.
No behavior change. The tests in inspector/layers that used to be
protocol tests now progress when frame targets are surfaced and used.
* LayoutTests/inspector/layers/layers-anonymous-expected.txt:
* LayoutTests/inspector/layers/layers-anonymous.html:
* LayoutTests/inspector/layers/layers-blending-compositing-reasons-expected.txt:
* LayoutTests/inspector/layers/layers-blending-compositing-reasons.html:
* LayoutTests/inspector/layers/layers-compositing-reasons-expected.txt:
* LayoutTests/inspector/layers/layers-compositing-reasons.html:
* LayoutTests/inspector/layers/layers-for-node-expected.txt:
* LayoutTests/inspector/layers/layers-for-node.html:
* LayoutTests/inspector/layers/layers-generated-content-expected.txt:
* LayoutTests/inspector/layers/layers-generated-content.html:
* LayoutTests/inspector/layers/layers-reflected-content-expected.txt:
* LayoutTests/inspector/layers/layers-reflected-content.html:
* LayoutTests/inspector/layers/resources/layer-utilities.js: Added.
(TestPage.registerInitializer.window.getLayersForNode):
(TestPage.registerInitializer.window.getReasonsForCompositingLayer):
(TestPage.registerInitializer.async let):
(TestPage.registerInitializer.window.getDocumentAndLayers):
* LayoutTests/platform/mac/TestExpectations:
Canonical link: https://commits.webkit.org/319986@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications