Bug 1470028 [wpt PR 11594] - Don't clear non-layout-object style for PseudoElements., a=testonly

Automatic update from web-platform-testsDon't clear non-layout-object style for PseudoElements.

They are only used for storing an extra ComputedStyle for
display:contents pseudo elements as the ComputedStyle for rendering uses
a display:inline with only properties inherited for the parent element.

Bug: 854563
Change-Id: I4dd3d99b0dee0b538645d005b36347b469799244
Reviewed-on: https://chromium-review.googlesource.com/1107802
Reviewed-by: Anders Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569204}

--

wpt-commits: bcae036590041ef1704e2ba337e0577dac8c11c4
wpt-pr: 11594
This commit is contained in:
Rune Lillesveen 2018-07-06 21:22:29 +00:00 committed by James Graham
parent 2273c857cb
commit 78accb587b
2 changed files with 28 additions and 1 deletions

View File

@ -551669,7 +551669,7 @@
"testharness" "testharness"
], ],
"css/cssom/getComputedStyle-pseudo.html": [ "css/cssom/getComputedStyle-pseudo.html": [
"d3ef09fb6092078562f8923879b9ece97938df47", "1e5befe5a5494fef67f7c001301f0caddf1aa060",
"testharness" "testharness"
], ],
"css/cssom/historical.html": [ "css/cssom/historical.html": [

View File

@ -44,6 +44,16 @@
content: "foo"; content: "foo";
position: absolute; position: absolute;
} }
#contents-pseudos-dynamic::before,
#contents-pseudos-dynamic::after {
display: block;
content: "foo";
position: absolute;
}
#contents-pseudos-dynamic.contents::before,
#contents-pseudos-dynamic.contents::after {
display: contents;
}
</style> </style>
<div id="test"> <div id="test">
<div id="contents"></div> <div id="contents"></div>
@ -51,6 +61,7 @@
<div id="flex"></div> <div id="flex"></div>
<div id="flex-no-pseudo"></div> <div id="flex-no-pseudo"></div>
<div id="contents-pseudos"></div> <div id="contents-pseudos"></div>
<div id="contents-pseudos-dynamic"></div>
</div> </div>
<script> <script>
test(function() { test(function() {
@ -109,6 +120,22 @@ test(function() {
"display: contents in " + pseudo + " should reflect other non-inherited properties in CSSOM"); "display: contents in " + pseudo + " should reflect other non-inherited properties in CSSOM");
}); });
}, "display: contents on pseudo-elements"); }, "display: contents on pseudo-elements");
test(function() {
var contentsPseudosDynamic = document.getElementById('contents-pseudos-dynamic');
[":before", ":after"].forEach(function(pseudo) {
assert_equals(getComputedStyle(contentsPseudosDynamic, pseudo).display, "block",
"Check that display for " + pseudo + " is block before change");
});
contentsPseudosDynamic.className = "contents";
[":before", ":after"].forEach(function(pseudo) {
assert_equals(getComputedStyle(contentsPseudosDynamic, pseudo).display, "contents",
"display: contents in " + pseudo + " should get reflected on CSSOM");
assert_equals(getComputedStyle(contentsPseudosDynamic, pseudo).width, "auto",
pseudo + " with display: contents should have no box");
assert_equals(getComputedStyle(contentsPseudosDynamic, pseudo).position, "absolute",
"display: contents in " + pseudo + " should reflect other non-inherited properties in CSSOM");
});
}, "Dynamically change to display: contents on pseudo-elements");
test(function() { test(function() {
var div = document.getElementById('test'); var div = document.getElementById('test');
assert_throws(new TypeError(), () => getComputedStyle(div, "totallynotapseudo"), assert_throws(new TypeError(), () => getComputedStyle(div, "totallynotapseudo"),