layout/style/test/test_background_blend_mode.html

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <title>Test for miscellaneous computed style issues</title>
     5   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     6   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     7 </head>
     8 <body>
     9 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a>
    10 <p id="display"></p>
    11 <div id="content" style="display: none">
    13 </div>
    14 <pre id="test">
    15 <script type="application/javascript">
    17 /** Test for miscellaneous computed style issues **/
    19 var frame_container = document.getElementById("display");
    20 var noframe_container = document.getElementById("content");
    22 function test_bug_841601() {
    23   // Test handling of background-blend-mode
    24   var p = document.createElement("p");
    25   var cs = getComputedStyle(p, "");
    27   frame_container.appendChild(p);
    28   is(cs.backgroundBlendMode, "normal",
    29      "default value of background-blend-mode");
    31   p.setAttribute("style", "background-blend-mode: normal, invalid");
    32   cs = getComputedStyle(p, "");
    33   is(cs.backgroundBlendMode, "normal",
    34      "set invalid blendmode");
    36   p.setAttribute("style", "background-blend-mode: normal, normal");
    37   cs = getComputedStyle(p, "");
    38   is(cs.backgroundBlendMode, "normal, normal",
    39      "set normal blendmode twice");
    41   p.setAttribute("style", "background-blend-mode: normal, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color, luminosity");
    42   cs = getComputedStyle(p, "");
    43   is(cs.backgroundBlendMode, "normal, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color, luminosity",
    44      "set all blendmodes");
    46   p.parentNode.removeChild(p);
    48   SimpleTest.finish();
    49 }
    51 SimpleTest.waitForExplicitFinish();
    52 SpecialPowers.pushPrefEnv({ "set": [["layout.css.background-blend-mode.enabled", true]] },
    53                           test_bug_841601);
    55 </script>
    56 </pre>
    57 </body>
    58 </html>

mercurial