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

Unified Diff: LayoutTests/fast/css/media-query-basing-rem-unit.html

Issue 18360007: MediaQueryEvaluator should use default style for evaluating "rem". Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added layout test for seamless iframe Created 7 years, 5 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 | LayoutTests/fast/css/media-query-basing-rem-unit-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/media-query-basing-rem-unit.html
diff --git a/LayoutTests/fast/css/media-query-basing-rem-unit.html b/LayoutTests/fast/css/media-query-basing-rem-unit.html
new file mode 100644
index 0000000000000000000000000000000000000000..b0b0e7da3fe34d38930ddb5fab7f08ef4dea8798
--- /dev/null
+++ b/LayoutTests/fast/css/media-query-basing-rem-unit.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+<style>
+div { margin: 5px 0; font-size: 16px; background: rgba(255,255,255,.5); }
+#rem { width: 50rem; }
+#control { width: calc(50 * 16px); }
+
+html { font-size: 8px; }
+body { font-size: 16px; margin: 0; background: green; }
+@media (min-width: 50rem) and (max-width: 799px) { body { background: red; } }
+</style>
+</head>
+<body>
+<pre id='console'></pre>
+<div>Resize the window to be larger than #1, but smaller than #2. If the screen turns red, the browser is basing 'rem' units in MQs on style data, which is a spec violation. (It should be equal to the initial font size, same as the 'em' unit, to avoid circularity issues.)</div>
+<div id=rem>#1: 50rem (based on style data)</div>
+<div id=control>#2: 50 * 16px (assumed to be the initial font size)</div>
+<script>
+description('Test for issue 258200:CSS Media Queries are basing "rem" unit on style data.');
+shouldBe('window.getComputedStyle(document.body).backgroundColor', '"rgb(0, 128, 0)"');
+window.resizeTo(700, 600);
+document.body.offsetLeft;
+shouldBe('window.getComputedStyle(document.body).backgroundColor', '"rgb(0, 128, 0)"');
+</script>
+</body>
+<script src="../js/resources/js-test-post.js"></script>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/css/media-query-basing-rem-unit-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698