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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/document-metadata/the-style-element/style_media.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 style information must be applied to the environment s pecified by the media attribute</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-me dia">
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: 100px;
14 }
15 </style>
16 <style id="style">
17 #test {
18 width: 50px;
19 }
20 </style>
21 </head>
22 <body>
23 <div id="log"></div>
24 <div id="test"></div>
25 <script>
26 test(function() {
27 var testElement = document.getElementById("test");
28 var style = document.getElementById("style");
29 var width1, width2;
30
31 width1 = window.getComputedStyle(testElement, false)["width"];
32 assert_equals(width1, "50px", "The style should be applied.");
33
34 style.media = "print";
35 width2 = window.getComputedStyle(testElement, false)["width"];
36 assert_equals(width2, "100px", "The style should not be applied.");
37 }, "The style information must be applied to the environment specified by the media attribute");
38 </script>
39 </body>
40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698