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:
Fergal Daly 2018-11-30 18:05:01 +00:00 коммит произвёл moz-wptsync-bot
Родитель 3c2f9ed558
Коммит 49a56a9468
10 изменённых файлов: 26 добавлений и 26 удалений

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

@ -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>