зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1510148 [wpt PR 14248] - Tidy layout tests for css-shadow-parts., a=testonly
Automatic update from web-platform-tests Tidy layout tests for css-shadow-parts. For consistency with https://crrev.com/c/1333014 - remove type="text/javascript" - replace "var" with "const" Change-Id: Ie809fa22763494fd6ca4b20112d4a3e6afdd1f0b Reviewed-on: https://chromium-review.googlesource.com/c/1350431 Reviewed-by: Hayato Ito <hayato@chromium.org> Commit-Queue: Fergal Daly <fergal@chromium.org> Cr-Commit-Position: refs/heads/master@{#611511} -- wpt-commits: f1546bdddd78f87333318d16a0b2cf9b3d1b3986 wpt-pr: 14248
This commit is contained in:
Родитель
3c2f9ed558
Коммит
49a56a9468
|
@ -20,15 +20,15 @@
|
|||
<custom-element id="c-e-1"></custom-element>
|
||||
The following text should be green:
|
||||
<custom-element id="c-e-2"></custom-element>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
const colorGreen = "rgb(0, 128, 0)";
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e-1", "part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e-1", "part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorGreen);
|
||||
}, "::part with host selector styles in first host");
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e-2", "part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e-2", "part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorGreen);
|
||||
}, "::part with host selector styles in second host");
|
||||
</script>
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
<custom-element-inner id="c-e-inner" part="c-e-part"></custom-element-inner>
|
||||
</template>
|
||||
<custom-element-outer id="c-e-outer"></custom-element-outer>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
const colorGreen = "rgb(0, 128, 0)";
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e-outer", "c-e-inner", "part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e-outer", "c-e-inner", "part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorGreen);
|
||||
}, "::part cannot be chained to reach elements in the inner host");
|
||||
test(function() {
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
</template>
|
||||
The following text should be green:
|
||||
<div><custom-element id="c-e"></custom-element></div>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
const colorGreen = "rgb(0, 128, 0)";
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorGreen);
|
||||
}, "Complex selector for host works");
|
||||
</script>
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
</template>
|
||||
The following text should be green:
|
||||
<pre><custom-element id="c-e"></custom-element></pre>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
const colorGreen = "rgb(0, 128, 0)";
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorGreen);
|
||||
}, "Non-matching complex selector for host does not style");
|
||||
</script>
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
</template>
|
||||
The following text should be green:
|
||||
<custom-element id="c-e"></custom-element>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
const colorGreen = "rgb(0, 128, 0)";
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorGreen);
|
||||
}, "Part is not styled when host is not selected");
|
||||
</script>
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
</template>
|
||||
The following text should be green:
|
||||
<custom-element id="c-e"></custom-element>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
const colorGreen = "rgb(0, 128, 0)";
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorGreen);
|
||||
}, "Part in selected host is not styled by ::part in a stylesheet inside the host");
|
||||
</script>
|
||||
|
|
|
@ -25,16 +25,16 @@
|
|||
</template>
|
||||
The following text should be green:
|
||||
<custom-element-outer id="c-e-outer"></custom-element-outer>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
const colorBlue = "rgb(0, 0, 255)";
|
||||
const colorGreen = "rgb(0, 128, 0)";
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e-outer", "green_part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e-outer", "green_part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorGreen);
|
||||
}, "Part in outer host is styled by document style sheet");
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e-outer", "c-e-inner", "blue_part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e-outer", "c-e-inner", "blue_part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorBlue);
|
||||
}, "Part in inner host is not styled by document style sheet");
|
||||
</script>
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
</template>
|
||||
The following text should be green:
|
||||
<div><custom-element id="c-e"></custom-element></div>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
test(function() {
|
||||
var part = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
var before = window.getComputedStyle(part).color;
|
||||
const part = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
const before = window.getComputedStyle(part).color;
|
||||
part.setAttribute("part", "new-partp");
|
||||
var after = window.getComputedStyle(part).color;
|
||||
const after = window.getComputedStyle(part).color;
|
||||
assert_not_equals(before, after);
|
||||
}, "Part in selected host changed color");
|
||||
</script>
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
</template>
|
||||
The following text should be green:
|
||||
<div id="elem"><custom-element id="c-e"></custom-element></div>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
test(function() {
|
||||
var part = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
var before = window.getComputedStyle(part).color;
|
||||
const part = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
const before = window.getComputedStyle(part).color;
|
||||
document.getElementById("elem").setAttribute("id", "new-elem");
|
||||
var after = window.getComputedStyle(part).color;
|
||||
const after = window.getComputedStyle(part).color;
|
||||
assert_not_equals(before, after);
|
||||
}, "Part in selected host changed color");
|
||||
</script>
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
</template>
|
||||
The following text should be green:
|
||||
<custom-element id="c-e"></custom-element>
|
||||
<script type="text/javascript">
|
||||
<script>
|
||||
"use strict";
|
||||
const colorGreen = "rgb(0, 128, 0)";
|
||||
test(function() {
|
||||
var el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
const el = getElementByShadowIds(document, ["c-e", "part"]);
|
||||
assert_equals(window.getComputedStyle(el).color, colorGreen);
|
||||
}, "Part in selected host is styled");
|
||||
</script>
|
||||
|
|
Загрузка…
Ссылка в новой задаче