author Mike Park <>
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

  <title>Test for inert elements in ShadowRoot</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<body onload="runChecks();">
<div id="grabme"></div>
<a target="_blank" href="">Bug 806506</a>

var element = document.getElementById("grabme");
var shadow = element.createShadowRoot();

// Check that <base> is inert.
shadow.innerHTML = '<base href="" />';
isnot(document.baseURI, "", "Base element should be inert in ShadowRoot.");


// Check that <link> is inert.
var numStyleBeforeLoad = document.styleSheets.length;

shadow.innerHTML = '<link id="shadowlink" rel="stylesheet" type="text/css" href="inert_style.css" /><span id="shadowspan"></span>';
shadow.applyAuthorStyles = true;
var shadowSpan = shadow.getElementById("shadowspan");
var shadowStyle = shadow.getElementById("shadowlink");

function runChecks() {
  isnot(getComputedStyle(shadowSpan, null).getPropertyValue("padding-top"), "10px", "Link element should be inert.");
  is(document.styleSheets.length, numStyleBeforeLoad, "Document style count should remain the same because the style should not be in the doucment.");
  is(shadow.styleSheets.length, 0, "Inert link should not add style to ShadowRoot.");
  // Remove link to make sure we don't get assertions.