dom/tests/mochitest/webcomponents/test_style_fallback_content.html
author Mike Park <mikeparkms@gmail.com>
Wed, 25 Oct 2017 14:36:03 -0400
changeset 444610 4e0bc9f7b713ffe30665cc4c8a5fb1e4daaea97f
parent 173935 1ac0576fa66f9a9ccfc7aefd8b1ab9c9ecaf8001
child 452261 b647cd8f54368a02c67c14025d8e0a21ae01d18c
permissions -rw-r--r--
Bug 1411402 - Change mouse cursor when hovering/clicking shapes highlighter markers. r=pbro MozReview-Commit-ID: 9idXQmwatiW

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=806506
-->
<head>
  <title>Test for styling fallback content</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<div id="grabme"></div>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=806506">Bug 806506</a>
<script>
var host = document.getElementById("grabme");
var shadow = host.createShadowRoot();
shadow.innerHTML = '<style id="innerstyle"></style><span id="container"><content><span id="innerspan">Hello</span></content></span>';
var innerStyle = shadow.getElementById("innerstyle");

innerStyle.innerHTML = '#innerspan { margin-top: 10px; }';
var innerSpan = shadow.getElementById("innerspan");
is(getComputedStyle(innerSpan, null).getPropertyValue("margin-top"), "10px", "Default content should be style by id selector.");

innerStyle.innerHTML = '#container > content > #innerspan { margin-top: 30px; }';
is(getComputedStyle(innerSpan, null).getPropertyValue("margin-top"), "30px", "Default content should be style by child combinators.");
</script>
</body>
</html>