gecko-dev/testing/web-platform/tests/css/css-shadow-parts/invalidation-change-part-name-forward.html
Fergal Daly 1a25a26ee3 Bug 1512908 [wpt PR 14427] - CSS: Migrate css-shadow-parts tests to wpt., a=testonly
Automatic update from web-platform-tests
CSS: Migrate css-shadow-parts tests to wpt.

The spec is now at first public working draft, so moving the forwarding
tests under wpt/.

Remove entire directory and references to it (the flag expectations
file already skips everything in external, the tests are still skipped
in their new location).

Change-Id: I5ddaab9d7e956aa1624dfda531d8548640c7cee4
Reviewed-on: https://chromium-review.googlesource.com/c/1368858
Commit-Queue: Fergal Daly <fergal@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615039}

--

wpt-commits: 226f3b50a6b97f30196a6625d70ee79437a60635
wpt-pr: 14427
2018-12-14 13:54:41 +00:00

34 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>CSS Shadow Parts - Invalidation change part name forward</title>
<meta href="mailto:fergal@chromium.org" rel="author" title="Fergal Daly">
<link href="http://www.google.com/" rel="author" title="Google">
<link href="https://drafts.csswg.org/css-shadow-parts/" rel="help">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/shadow-helper.js"></script>
</head>
<body>
<style>#c-e-outer::part(part-forwarded) { color: red; }</style>
<script>installCustomElement("custom-element-inner", "custom-element-inner-template");</script>
<template id="custom-element-inner-template">
<style>span { color: green; }</style>
<span id="part" part="partp">This text</span>
</template>
<script>installCustomElement("custom-element-outer", "custom-element-outer-template");</script>
<template id="custom-element-outer-template"><custom-element-inner id="c-e-inner" exportparts="partp: part-forwarded"></custom-element-inner></template>
The following text should be green:
<custom-element-outer id="c-e-outer"></custom-element-outer>
<script>
"use strict";
test(function() {
const part = getElementByShadowIds(document, ["c-e-outer", "c-e-inner", "part"]);
const before = window.getComputedStyle(part).color;
part.setAttribute("part", "new-partp");
const after = window.getComputedStyle(part).color;
assert_not_equals(before, after);
}, "Part in selected host changed color");
</script>
</body>
</html>