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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/custom/size-follows-container-size.html

Issue 1729073002: Update SVG tests ahead of offset* removal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update flexitem.html and grid-item-display.html too Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/animate-svgsvgelement.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <style> 4 <style>
5 svg { background-color: lightblue } 5 svg { background-color: lightblue }
6 div { width: 500px; background-color: blue; padding: 1em } 6 div { width: 500px; background-color: blue; padding: 1em }
7 </style> 7 </style>
8 <div> 8 <div>
9 <svg viewBox="0 0 100 100"></svg> 9 <svg viewBox="0 0 100 100"></svg>
10 </div> 10 </div>
11 <script> 11 <script>
12 var dec_test = async_test("Test SVG dimensions after container width has shr unk"); 12 var dec_test = async_test("Test SVG dimensions after container width has shr unk");
13 var inc_test = async_test("Test SVG dimensions after container width has gro wn"); 13 var inc_test = async_test("Test SVG dimensions after container width has gro wn");
14 onload = function() { 14 onload = function() {
15 requestAnimationFrame(function() { 15 requestAnimationFrame(function() {
16 document.querySelector('div').style.width = "1000px"; 16 document.querySelector('div').style.width = "1000px";
17 inc_test.step(function() { 17 inc_test.step(function() {
18 assert_equals(document.querySelector('svg').offsetWidth, 1000); 18 var rect = document.querySelector('svg').getBoundingClientRect() ;
19 assert_equals(document.querySelector('svg').offsetHeight, 1000); 19 assert_equals(rect.width, 1000);
20 assert_equals(rect.height, 1000);
20 }); 21 });
21 inc_test.done(); 22 inc_test.done();
22 document.querySelector('div').style.width = "100px"; 23 document.querySelector('div').style.width = "100px";
23 dec_test.step(function() { 24 dec_test.step(function() {
24 assert_equals(document.querySelector('svg').offsetWidth, 100); 25 var rect = document.querySelector('svg').getBoundingClientRect() ;
25 assert_equals(document.querySelector('svg').offsetHeight, 100); 26 assert_equals(rect.width, 100);
27 assert_equals(rect.height, 100);
26 }); 28 });
27 dec_test.done(); 29 dec_test.done();
28 }); 30 });
29 }; 31 };
30 </script> 32 </script>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/custom/animate-svgsvgelement.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698