summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/duplicate-property-in-rule-important.html
blob: fb6047c161b4d3b2099cb58bda5574c83b98fded (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
    <head>
        <title>Property is declared twice in rule</title>
        <style type="text/css">
            div
            {
                color: red;
                color: green !important;
                color: yellow;
                width: 1px;
                width: 2px !important;
                width: 3px !important;
            }
        </style>
    <script>
    if (window.testRunner)
        window.testRunner.dumpAsText();
    </script>
    </head>
    <body>
        <div>This text should be green and the page should have no other style.</div>
        <div id="testresult">Fail</div>
        <script type="text/javascript">
            if(document.styleSheets[0].cssRules[0].style.length == 2 &&
               document.styleSheets[0].cssRules[0].style.getPropertyValue("color") == "green" &&
               document.styleSheets[0].cssRules[0].style.getPropertyPriority("color") == "important" &&
               document.styleSheets[0].cssRules[0].style.getPropertyValue("width") == "3px" &&
               document.styleSheets[0].cssRules[0].style.getPropertyPriority("width") == "important")
            {
                document.getElementById("testresult").innerHTML = "Pass";
            }
        </script>
    </body>
</html>