Bug 1588809 [wpt PR 19702] - [CSS] Add test to to ensure that ::part overrides inline-style., a=testonly

Automatic update from web-platform-tests
[CSS] Add test to to ensure that ::part overrides inline-style.

This test is already passing for blink but some other browsers fail.

This test is a clone of simple.html but moves the color inline.

Bug: 1014400
Change-Id: I4810222d43f99ae229afa58458e1830202b7d444
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862134
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706285}

--

wpt-commits: 8f14d88acb82bedaaa4bfacd7e9b6d262e21cdc2
wpt-pr: 19702
This commit is contained in:
Fergal Daly 2019-10-22 10:21:14 +00:00 коммит произвёл James Graham
Родитель 5df81e77ff
Коммит 4f36743828
1 изменённых файлов: 29 добавлений и 0 удалений

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

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Shadow Parts - Simple Inline</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::part(partp) { color: green; }</style>
<script>installCustomElement("custom-element", "custom-element-template");</script>
<template id="custom-element-template">
<span id="part" part="partp" style="color: red">This text</span>
</template>
The following text should be green:
<custom-element id="c-e"></custom-element>
<script>
"use strict";
const colorGreen = "rgb(0, 128, 0)";
test(function() {
const el = getElementByShadowIds(document, ["c-e", "part"]);
assert_equals(window.getComputedStyle(el).color, colorGreen);
}, "Part in selected host is styled");
</script>
</body>
</html>