summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/attribute-selector-hyphen-dynamic-no-elementstyle.html
blob: d59529f72a9103453c3a243276fea3ed3a297cdc (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
35
36
37
<!doctype html>
<html>
<head>
    <style>
        span { display: none }
        *[test|="0"] #sp { color: green; display: block}
    </style>
</head>
<body onload="startTest();">
    <div test="1">
    <p>
    Test for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=60752">https://bugs.webkit.org/show_bug.cgi?id=60752</a>
    </p>
    <p>This test checks whether CSS attribute selector [att|=val] is re-evaluated after attribute changes in DOM elements which have no style associated with them.</p>
    <span id="sp">PASSED</span>
    </div>

    <script>
        function change() {
            var element = document.getElementsByTagName('div')[0];
            element.attributes.test.value = "0-updated";
            if (window.testRunner) {
                testRunner.notifyDone();
            }
        }
        function startTest() {
            if (window.testRunner) {
                testRunner.dumpAsText();
                testRunner.waitUntilDone();
            }
            // Trigger an attribute change after all load processing is done. Doing the change
            // here immediately does not exhibit the problem.
            setTimeout("change();", 0);
        }
    </script>
</body>
</html>