Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit fa816d5

Browse files
dbaronmoz-wptsync-bot
authored andcommitted
Bug 1945294 [wpt PR 50424] - Don't clear ForceReattachLayoutTree state on <slot> with display lock., a=testonly
Automatic update from web-platform-tests Don't clear ForceReattachLayoutTree state on <slot> with display lock. This fixes a regression that started occurring frequently with text between MathJax elements inside of a <details> element (which uses content-visibility, and thus display lock). The regression resulted from changes to the internals of the <details> element. When detaching the layout tree for this particular case of <slot> elements with display lock, this restores the ForceReattachLayoutTree state that existed before so that it's still set when the display lock is no longer present. Fixed: 383593255 Change-Id: Ib1dab4da0b1211ecf35dd6e11201cc35064e466a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6220858 Commit-Queue: David Baron <[email protected]> Reviewed-by: Ian Kilpatrick <[email protected]> Cr-Commit-Position: refs/heads/main@{#1414486} -- wpt-commits: 1630698f22d6f9b631733118a01a95928d4a7342 wpt-pr: 50424
1 parent 3146269 commit fa816d5

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
4+
<div>
5+
<div>math</div>
6+
after
7+
<p></p>
8+
</div>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE HTML>
2+
<html class="reftest-wait">
3+
<link rel="help" href="https://issues.chromium.org/383593255">
4+
<link rel="match" href="dynamic-change-with-slotted-text-ref.html">
5+
6+
<div>
7+
$$\text{math}$$
8+
after
9+
<p></p>
10+
</div>
11+
12+
<script>
13+
14+
let div = document.querySelector("div");
15+
let shadow = div.attachShadow({mode: "open"});
16+
shadow.innerHTML = "<slot style='display:block;content-visibility: hidden'></slot>";
17+
let slot = shadow.querySelector("slot");
18+
19+
requestAnimationFrame(() => {
20+
getComputedStyle(div.querySelector("p")).width;
21+
let t1 = div.firstChild;
22+
let t2 = t1.splitText(1);
23+
let t3 = t2.splitText(15);
24+
let d = document.createElement("div");
25+
d.innerText = "math";
26+
t2.replaceWith(d);
27+
requestAnimationFrame(() => {
28+
slot.style.contentVisibility = "";
29+
document.documentElement.classList.remove("reftest-wait");
30+
});
31+
});
32+
</script>

0 commit comments

Comments
 (0)