Commit 19e8f142 authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@fb04aed6ac840bd35178406583af6da6759c3566

Using wpt-import in Chromium 4c506633.

Build: https://ci.chromium.org/buildbot/chromium.infra.cron/wpt-importer/19959

Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

TBR=robertma

No-Export: true
Change-Id: Ie639f1ae90f0457d75ae9efc7b810b8d2f35d559
Reviewed-on: https://chromium-review.googlesource.com/1111907
Commit-Queue: Blink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Reviewed-by: default avatarBlink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569649}
parent c68b3219
<!doctype html>
<meta charset="utf-8">
<title>CSSOM: getComputedStyle gets invalidated for display: none elements (inheritance)</title>
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle">
<link rel="help" href="https://bugs.webkit.org/show_bug.cgi?id=186882">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<style>
#undisplayed, #host {
display: none;
color: red;
}
</style>
<div id="undisplayed"><div id="child"></div></div>
<div id="host"></div>
<script>
test(function() {
let undisplayed_style = getComputedStyle(undisplayed);
let undisplayed_child_style = getComputedStyle(child);
assert_equals(undisplayed_style.color, "rgb(255, 0, 0)");
assert_equals(undisplayed_child_style.color, "rgb(255, 0, 0)");
undisplayed.style.color = "green";
assert_equals(undisplayed_style.color, "rgb(0, 128, 0)");
assert_equals(undisplayed_child_style.color, "rgb(0, 128, 0)");
}, "getComputedStyle gets invalidated in display: none subtrees due to inherited changes to an ancestor");
test(function() {
host.attachShadow({ mode: 'open' }).innerHTML = `
<div></div>
`;
let host_style = getComputedStyle(host);
let shadow_style = getComputedStyle(host.shadowRoot.firstElementChild);
assert_equals(host_style.color, "rgb(255, 0, 0)");
assert_equals(shadow_style.color, "rgb(255, 0, 0)");
host.style.color = "green";
assert_equals(host_style.color, "rgb(0, 128, 0)");
assert_equals(shadow_style.color, "rgb(0, 128, 0)");
}, "getComputedStyle gets invalidated in display: none subtrees due to inherited changes to an ancestor shadow host");
</script>
<!doctype html>
<meta charset="utf-8">
<title>CSSOM: getComputedStyle gets invalidated for display: none elements (rules)</title>
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle">
<link rel="help" href="https://bugs.webkit.org/show_bug.cgi?id=186882">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<style>
#undisplayed {
display: none;
color: red;
}
.sibling + #undisplayed {
color: green;
}
.sibling + #undisplayed > div {
color: yellow;
}
</style>
<div id="helper"></div>
<div id="undisplayed"><div id="child"></div></div>
<script>
test(function() {
let undisplayed_style = getComputedStyle(undisplayed);
let undisplayed_child_style = getComputedStyle(child);
assert_equals(undisplayed_style.color, "rgb(255, 0, 0)");
assert_equals(undisplayed_child_style.color, "rgb(255, 0, 0)");
helper.classList.add("sibling");
assert_equals(undisplayed_style.color, "rgb(0, 128, 0)");
assert_equals(undisplayed_child_style.color, "rgb(255, 255, 0)");
}, "getComputedStyle gets invalidated in display: none subtrees due to rule matching changes");
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment