dom/tests/mochitest/webcomponents/test_style_fallback_content.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=806506
     5 -->
     6 <head>
     7   <title>Test for styling fallback content</title>
     8   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    10 </head>
    11 <body>
    12 <div id="grabme"></div>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=806506">Bug 806506</a>
    14 <script>
    15 var host = document.getElementById("grabme");
    16 var shadow = host.createShadowRoot();
    17 shadow.innerHTML = '<style id="innerstyle"></style><span id="container"><content><span id="innerspan">Hello</span></content></span>';
    18 var innerStyle = shadow.getElementById("innerstyle");
    20 innerStyle.innerHTML = '#innerspan { margin-top: 10px; }';
    21 var innerSpan = shadow.getElementById("innerspan");
    22 is(getComputedStyle(innerSpan, null).getPropertyValue("margin-top"), "10px", "Default content should be style by id selector.");
    24 innerStyle.innerHTML = '#container > content > #innerspan { margin-top: 30px; }';
    25 is(getComputedStyle(innerSpan, null).getPropertyValue("margin-top"), "30px", "Default content should be style by child combinators.");
    26 </script>
    27 </body>
    28 </html>

mercurial