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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/css/media-query-basing-rem-unit-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../js/resources/js-test-pre.js"></script>
5 <style>
6 div { margin: 5px 0; font-size: 16px; background: rgba(255,255,255,.5); }
7 #rem { width: 50rem; }
8 #control { width: calc(50 * 16px); }
9
10 html { font-size: 8px; }
11 body { font-size: 16px; margin: 0; background: green; }
12 @media (min-width: 50rem) and (max-width: 799px) { body { background: red; } }
13 </style>
14 </head>
15 <body>
16 <pre id='console'></pre>
17 <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 s pec violation. (It should be equal to the initial font size, same as the 'em' u nit, to avoid circularity issues.)</div>
18 <div id=rem>#1: 50rem (based on style data)</div>
19 <div id=control>#2: 50 * 16px (assumed to be the initial font size)</div>
20 <script>
21 description('Test for issue 258200:CSS Media Queries are basing "rem" unit on st yle data.');
22 shouldBe('window.getComputedStyle(document.body).backgroundColor', '"rgb(0, 128, 0)"');
23 window.resizeTo(700, 600);
24 document.body.offsetLeft;
25 shouldBe('window.getComputedStyle(document.body).backgroundColor', '"rgb(0, 128, 0)"');
26 </script>
27 </body>
28 <script src="../js/resources/js-test-post.js"></script>
29 </html>
OLDNEW
« 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