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

Side by Side Diff: LayoutTests/userstyles/insert-stylesheets.html

Issue 66383005: Remove the concept of user stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix WebFrameCSSCallbackTest tests Created 7 years, 1 month 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 <style>
5 .styled {
6 background-color: red;
7 width: 0;
8 height: 100px;
9 }
10 </style>
11 <script src="../resources/js-test.js"></script>
12 </head>
13 <body>
14 <p>This test requires testRunner and window.internals.</p>
15 <div id="test" class="styled"></div>
16 <script>
17 function test()
18 {
19 if (!window.testRunner)
20 return;
21 testRunner.dumpAsText();
22 window.testElement = document.getElementById("test");
23 shouldBe("getComputedStyle(testElement).backgroundColor", "'rgb(255, 0, 0)'" );
24 shouldBe("testElement.offsetWidth", "0");
25
26 if (!window.internals)
27 return;
28
29 // The author style above should override this user style.
30 internals.insertUserCSS(document, "body .styled { background-color: green; w idth: 100px; }");
31 shouldBe("getComputedStyle(testElement).backgroundColor", "'rgb(255, 0, 0)'" );
32 shouldBe("testElement.offsetWidth", "0");
33
34 // Since this style is more specific, it should override the original author style above.
35 internals.insertAuthorCSS(document, "body .styled { background-color: green; width: 100px; }");
36 shouldBe("getComputedStyle(testElement).backgroundColor", "'rgb(0, 128, 0)'" );
37 shouldBe("testElement.offsetWidth", "100");
38 }
39
40 test();
41 </script>
42 </body>
43 </html>
OLDNEW
« no previous file with comments | « LayoutTests/printing/page-rule-selection.html ('k') | LayoutTests/userstyles/insert-stylesheets-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698