Bug 1590234 [wpt PR 19815] - Don't generate pseudo element inside display:none., a=testonly

Automatic update from web-platform-tests
Don't generate pseudo element inside display:none.

We checked for non-null GetComputedStyle(), but it may also be non-null
inside display:none when ensured from getComputedStyle(). Skip
generating pseudo elements for that case. This caused a DCHECK failure
due to an incorrect marking for layout tree re-attachment inside
display:none.

Bug: 1013570
Change-Id: I75318b9d3bed1ed68dab232d90bbdc9b68655152
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872096
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708147}

--

wpt-commits: 03f4ea383cd4d9c5e8f46f9f405833e96a3a4809
wpt-pr: 19815
This commit is contained in:
Rune Lillesveen 2019-10-26 22:35:10 +00:00 коммит произвёл moz-wptsync-bot
Родитель d3bad77ca8
Коммит fee19f58e4
1 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,19 @@
<!doctype html>
<title>CSS Test: Invalidating style inside display:none with ::before should not crash.</title>
<link rel="help" href="https://crbug.com/1013570">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#outer { display: none }
#outer::before { content: " "; }
</style>
<div id="outer">
<div id="inner"></div>
</div>
<script>
test(() => {
assert_equals(getComputedStyle(inner).color, "rgb(0, 0, 0)");
inner.style.color = "green";
assert_equals(getComputedStyle(inner).color, "rgb(0, 128, 0)");
}, "Invalidating style inside display:none with ::before should not crash.");
</script>