Skip to content

Commit 5121369

Browse files
Update both GeometryUtils endpoints before conversion
Updating a source node does not force layout for a relativeTo endpoint in an unrelated display-locked subtree of the same document. Update the target endpoint separately. Make the target update unconditional whenever a target exists. A clean lifecycle update is a no-op. Avoiding endpoint relationship logic keeps the update correct across shadow trees and future lifecycle changes. Add WPT coverage using source and target nodes in separate content- visibility locks. Bug: 427918516 Change-Id: I082d236c655bb5669f98e8649c9f36313b8ddd02 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8227484 Reviewed-by: Philip Rogers <pdr@chromium.org> Reviewed-by: Stefan Zager <szager@chromium.org> Commit-Queue: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1682689}
1 parent 389fb4a commit 5121369

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

css/cssom-view/cssom-geometryutils-lifecycle.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,26 @@
5353
assert_approx_equals(bounds.y, rect.y - stageRect.y, 0.01,
5454
"y coordinate");
5555
}, "getBoxQuads() immediately after a transform style update");
56+
57+
test(t => {
58+
const sourceLock = document.createElement("div");
59+
sourceLock.style.contentVisibility = "hidden";
60+
const source = document.createElement("div");
61+
source.style.cssText = "width:20px;height:20px";
62+
sourceLock.appendChild(source);
63+
64+
const targetLock = document.createElement("div");
65+
targetLock.style.contentVisibility = "hidden";
66+
const target = document.createElement("div");
67+
target.style.cssText = "width:20px;height:20px";
68+
targetLock.appendChild(target);
69+
70+
document.body.append(sourceLock, targetLock);
71+
t.add_cleanup(() => {
72+
sourceLock.remove();
73+
targetLock.remove();
74+
});
75+
76+
assert_equals(source.getBoxQuads({relativeTo: target}).length, 1);
77+
}, "getBoxQuads() updates unrelated display-locked endpoints");
5678
</script>

0 commit comments

Comments
 (0)