Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: LayoutTests/fast/css/style-scoped/style-scoped-remove-scoped.html

Issue 325663003: Remove scoped styles (retry) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix layout test (and expectation) Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script type="text/javascript">
5 function log(msg)
6 {
7 document.getElementById('console').appendChild(document.createTextNo de(msg + '\n'));
8 }
9
10 function test(id)
11 {
12 var elem = document.getElementById(id);
13 log(id + ': ' + document.defaultView.getComputedStyle(elem, null).ge tPropertyValue('color'));
14 }
15
16 function testAll()
17 {
18 test('S1');
19 test('P1');
20 test('R1');
21 test('S2');
22 test('P2');
23 test('R2');
24 test('S3');
25 test('P3');
26 test('R3');
27 }
28
29 function runTests()
30 {
31 if (window.testRunner) {
32 testRunner.dumpAsText();
33 testRunner.waitUntilDone();
34 }
35
36 log('--- ORIGINAL ---');
37 testAll();
38
39 log('--- AFTER UN-SETTING @SCOPED ---');
40 document.getElementById('STYLE').removeAttribute('scoped');
41 setTimeout(function() {
42 testAll();
43 log('--- FINISHED ---');
44 if (window.testRunner)
45 testRunner.notifyDone();
46 }, 0);
47 }
48 </script>
49 <style type="text/css" scoped>
50 body { color: black; }
51 </style>
52 </head>
53 <body onload="runTests();">
54 <p>Test removing the 'scoped' attribute on a &lt;style&gt; element</p>
55 <div>
56 <span id="S1">Text</span>
57 <p id="P1">Text</p>
58 <pre id="R1">Text</p>
59 </div>
60 <div>
61 <style id="STYLE" type="text/css" scoped>
62 div { color: red; }
63 p { color: green; }
64 p ~ div pre { color: blue; } /* should NOT apply while scoped! */
65 </style>
66 <span id="S2">Text</span>
67 <p id="P2">Text</p>
68 <pre id="R2">Text</p>
69 </div>
70 <div>
71 <span id="S3">Text</span>
72 <p id="P3">Text</p>
73 <pre id="R3">Text</p>
74 </div>
75 <pre id="console"></pre>
76 </body>
77 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698