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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/document-metadata/the-style-element/style_scoped.html

Issue 1144143009: W3C Test: Import web-platform-tests/html/semantics (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 <meta charset="utf-8">
5 <title>HTML Test: The scoped attribute must apply the style information only to its parent element</title>
6 <link rel="author" title="Intel" href="http://www.intel.com/">
7 <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-style-sc oped">
8 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-style-ele ment">
9 <script src="../../../../../../resources/testharness.js"></script>
10 <script src="../../../../../../resources/testharnessreport.js"></script>
11 <style>
12 #test {
13 width: 50px;
14 }
15 </style>
16 </head>
17 <body>
18 <div id="log"></div>
19 <div id="test"></div>
20 <div>
21 <style id="style">
22 #test {
23 width: 100px;
24 }
25 </style>
26 <div>
27 <script>
28 test(function() {
29 var testElement = document.getElementById("test");
30 var style = document.getElementById("style");
31 var width1, width2;
32
33 width1 = window.getComputedStyle(testElement, false)["width"];
34 assert_equals(width1, "100px", "The style 'width' should be applied.");
35
36 style.scoped = true;
37 width2 = window.getComputedStyle(testElement, false)["width"];
38 assert_equals(width2, "50px", "The width should not be applied.");
39 }, "The scoped attribute is present, the style information must be applied only to its parent element");
40 </script>
41 </body>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698