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

Side by Side Diff: third_party/WebKit/LayoutTests/images/zoomed-offset-size.html

Issue 2496663002: Merge css3/image/ and fast/images/ to images/ (Closed)
Patch Set: Address failing tests (3 of them) Created 4 years, 1 month 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Image should return a size of 250x166 regardless of zoom level.</title> 2 <title>Image should return a size of 250x166 regardless of zoom level.</title>
3 <script src="../../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <div style="height:166px; width:250px; overflow:hidden;"> 5 <div style="height:166px; width:250px; overflow:hidden;">
6 <img src="resources/green-256x256.jpg" style="width: 100%; height:100%"> 6 <img src="resources/green-256x256.jpg" style="width: 100%; height:100%">
7 <script> 7 <script>
8 test(function() { 8 test(function() {
9 var imageElement = document.querySelector('img'); 9 var imageElement = document.querySelector('img');
10 var wrapElement = document.querySelector('div'); 10 var wrapElement = document.querySelector('div');
11 function testSize(zoomLevel) { 11 function testSize(zoomLevel) {
12 document.body.style.zoom = zoomLevel; 12 document.body.style.zoom = zoomLevel;
13 assert_equals(imageElement.offsetWidth, 250); 13 assert_equals(imageElement.offsetWidth, 250);
14 assert_equals(imageElement.offsetHeight, 166); 14 assert_equals(imageElement.offsetHeight, 166);
15 assert_equals(wrapElement.offsetWidth, 250); 15 assert_equals(wrapElement.offsetWidth, 250);
16 assert_equals(wrapElement.offsetHeight, 166); 16 assert_equals(wrapElement.offsetHeight, 166);
17 } 17 }
18 for (var i = 90; i <= 200; i += 5) 18 for (var i = 90; i <= 200; i += 5)
19 testSize(i/100); 19 testSize(i/100);
20 document.body.style.zoom = 1.0; 20 document.body.style.zoom = 1.0;
21 }); 21 });
22 </script> 22 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698