Skip to content

Commit

Permalink
Fix NeedsLayoutTreeUpdateForNodeIncludingDisplayLocked
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
josepharhar authored and chromium-wpt-export-bot committed Oct 26, 2021
1 parent d1a5b4c commit 1b3124b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html style="display:none">

<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1251931">

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<div style="content-visibility:hidden"></div>

<script>
test(() => {
document.documentElement.offsetTop;
document.documentElement.style.display = "block";
assert_equals(getComputedStyle(document.documentElement).color, 'rgb(0, 0, 0)');
}, `Verifies that ComputedStyle gets updated when the documentElement's style is dirtied in the presence of content-visibility.`);
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1251931">

<div>
<template shadowroot=open></template>
<span id="outside"></span>
</div>
<div style="content-visibility:hidden"></div>
<script>
getComputedStyle(outside).color;
outside.style.color = "green";
getComputedStyle(outside).color;
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1251931">

<style>
.a + .b { color: green }
</style>
<div id="host">
<div>
<div>
<div id="a"></div><div id="b" class="b"></div>
</div>
</div>
</div>
<div style="content-visibility:hidden"></div>
<script>
host.attachShadow({mode:"open"});
document.body.offsetTop;
a.className = "a";
getComputedStyle(b).color;
</script>

0 comments on commit 1b3124b

Please sign in to comment.