Skip to content

Commit 891bc02

Browse files
lilleschromium-wpt-export-bot
authored andcommitted
Mark for whitespace reattachment based on layout object parent
The existing code marked based on light tree parent, which did not work correctly for slotted elements. Instead keep track of the last layout object parent which got a child removed during the detach part of a DOM or flat tree removal. The marking is only done for the closest LayoutObject parent of the detached subtree. If the marking was done for every LayoutObject removal in the subtree, the style recalc root would not be updated correctly and we would have a less optimal recalc root as we try to update the recalc root after the removal is complete. Fixes two correctness issues and prepares for using the same framework for doing the same for list item updates. Bug: 1244080, 1247079, 1239137 Change-Id: Iacfe010c50f3f33a5e45b3ea996a3f42cb465f84 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3172622 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Reviewed-by: Morten Stenshorne <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#924258}
1 parent 4c4af6e commit 891bc02

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<meta charset="utf-8">
3+
<title>Remove display:contents with block child and whitespace sibling</title>
4+
<link rel="help" href="https://drafts.csswg.org/css-display-3/#valdef-display-contents">
5+
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-rules">
6+
<link rel="match" href="../../reference/pass_if_two_words.html">
7+
<p>There should be a space between "two" and "words" below.</p>
8+
two<div id="rm" style="display:contents"><div></div></div> <span>words</span>
9+
<script>
10+
rm.offsetTop;
11+
rm.remove();
12+
</script>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<link rel="help" href="https://drafts.csswg.org/css-text-3/#white-space-rules">
3+
<link rel="match" href="../../reference/pass_if_two_words.html">
4+
<p>There should be a space between "two" and "words" below.</p>
5+
<div id="host">two<div id="rm"></div> <span>words</span></div>
6+
<script>
7+
let root = host.attachShadow({mode:"open"});
8+
root.innerHTML = "<slot></slot>";
9+
host.offsetTop;
10+
rm.slot = "unknown";
11+
</script>

0 commit comments

Comments
 (0)