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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/css-link-media-change.html

Issue 1793933002: Don't trigger a link resource fetch on media change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test and made mediaChanged() virtual Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/css/css-link-media-change.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/css-link-media-change.html b/third_party/WebKit/LayoutTests/fast/css/css-link-media-change.html
new file mode 100644
index 0000000000000000000000000000000000000000..57f1e6b7304bdffb296a3727b6e2a5dcf97fe0cb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/css-link-media-change.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<style>#t1 { color: green }</style>
+<link id="link" rel="stylesheet" href="data:text/css,#t1{color:red}" media="(min-width: 1px)"></link>
+<div id="t1">This text should be green</div>
+<script>
+description("Check that changing media attribute on loaded link works");
+
+shouldBeEqualToString("getComputedStyle(t1).color", "rgb(255, 0, 0)");
+
+link.setAttribute("media", "(max-width: 1px)");
+shouldBeEqualToString("getComputedStyle(t1).color", "rgb(0, 128, 0)");
+</script>

Powered by Google App Engine
This is Rietveld 408576698