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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/media-attr-non-matching-dynamic.html

Issue 2829873002: Collect media query results for non-matching stylesheets. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/ActiveStyleSheets.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/media-attr-non-matching-dynamic.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/media-attr-non-matching-dynamic.html b/third_party/WebKit/LayoutTests/fast/css/media-attr-non-matching-dynamic.html
new file mode 100644
index 0000000000000000000000000000000000000000..86fbd88c9c6324b53d5c328b0ccdfb0c8b685553
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/media-attr-non-matching-dynamic.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+ iframe {
+ height: 50px;
+ width: 50px;
+ }
+</style>
+<iframe></iframe>
+<script>
+ test(() => {
+ var iframe = document.querySelector("iframe");
+ var doc = iframe.contentDocument;
+ var style = doc.createElement("style");
+ style.setAttribute("media", "(min-width: 100px)");
+ style.textContent = "body { background: green }";
+ doc.head.appendChild(style);
+ assert_equals(doc.defaultView.getComputedStyle(doc.body).backgroundColor, "rgba(0, 0, 0, 0)");
+ iframe.setAttribute("style", "height: 100px; width: 100px");
+ assert_equals(doc.defaultView.getComputedStyle(doc.body).backgroundColor, "rgb(0, 128, 0)");
+ }, "Sheet with initially non-matching viewport media query applies after resize");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/ActiveStyleSheets.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698