зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
2273c857cb
Коммит
78accb587b
|
@ -551669,7 +551669,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"css/cssom/getComputedStyle-pseudo.html": [
|
||||
"d3ef09fb6092078562f8923879b9ece97938df47",
|
||||
"1e5befe5a5494fef67f7c001301f0caddf1aa060",
|
||||
"testharness"
|
||||
],
|
||||
"css/cssom/historical.html": [
|
||||
|
|
|
@ -44,6 +44,16 @@
|
|||
content: "foo";
|
||||
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>
|
||||
<div id="test">
|
||||
<div id="contents"></div>
|
||||
|
@ -51,6 +61,7 @@
|
|||
<div id="flex"></div>
|
||||
<div id="flex-no-pseudo"></div>
|
||||
<div id="contents-pseudos"></div>
|
||||
<div id="contents-pseudos-dynamic"></div>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
|
@ -109,6 +120,22 @@ test(function() {
|
|||
"display: contents in " + pseudo + " should reflect other non-inherited properties in CSSOM");
|
||||
});
|
||||
}, "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() {
|
||||
var div = document.getElementById('test');
|
||||
assert_throws(new TypeError(), () => getComputedStyle(div, "totallynotapseudo"),
|
||||
|
|
Загрузка…
Ссылка в новой задаче