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> |