Commit e547ca2c authored by Fergal Daly's avatar Fergal Daly Committed by Commit Bot

[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/+/1862134Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706285}
parent 4ea8c209
<!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>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment