Skip to content

Commit 1b3124b

Browse files
Fix NeedsLayoutTreeUpdateForNodeIncludingDisplayLocked
This patch makes NeedsLayoutTreeUpdateForNodeIncludingDisplayLocked consider nodes which aren't in the flat tree. Fixed: 1251931 Change-Id: I00382a6950f0f019f61f4e4bc43c5339146b6a2f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3184902 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#934798}
1 parent d1a5b4c commit 1b3124b

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html style="display:none">
3+
4+
<link rel=author href="mailto:jarhar@chromium.org">
5+
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1251931">
6+
7+
<script src="/resources/testharness.js"></script>
8+
<script src="/resources/testharnessreport.js"></script>
9+
10+
<div style="content-visibility:hidden"></div>
11+
12+
<script>
13+
test(() => {
14+
document.documentElement.offsetTop;
15+
document.documentElement.style.display = "block";
16+
assert_equals(getComputedStyle(document.documentElement).color, 'rgb(0, 0, 0)');
17+
}, `Verifies that ComputedStyle gets updated when the documentElement's style is dirtied in the presence of content-visibility.`);
18+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<link rel=author href="mailto:jarhar@chromium.org">
3+
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1251931">
4+
5+
<div>
6+
<template shadowroot=open></template>
7+
<span id="outside"></span>
8+
</div>
9+
<div style="content-visibility:hidden"></div>
10+
<script>
11+
getComputedStyle(outside).color;
12+
outside.style.color = "green";
13+
getComputedStyle(outside).color;
14+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<link rel=author href="mailto:jarhar@chromium.org">
3+
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1251931">
4+
5+
<style>
6+
.a + .b { color: green }
7+
</style>
8+
<div id="host">
9+
<div>
10+
<div>
11+
<div id="a"></div><div id="b" class="b"></div>
12+
</div>
13+
</div>
14+
</div>
15+
<div style="content-visibility:hidden"></div>
16+
<script>
17+
host.attachShadow({mode:"open"});
18+
document.body.offsetTop;
19+
a.className = "a";
20+
getComputedStyle(b).color;
21+
</script>

0 commit comments

Comments
 (0)