OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>This test ensures that when an image changes, but doesn't change size (li ke in an Animated GIF), we don't force a Layout.</title> | 2 <title>This test ensures that when an image changes, but doesn't change size (li ke in an Animated GIF), we don't force a Layout.</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="float: left;"> | 5 <div style="float: left;"> |
6 <img style="max-width: 100%" src="../replaced/resources/1x1-blue.png"> | 6 <img style="max-width: 100%" src="../replaced/resources/1x1-blue.png"> |
7 </div> | 7 </div> |
8 <script> | 8 <script> |
9 //TODO(siva.gunturi): Use async_test and use asserts on image.onload and window. onload. | 9 async_test(function(t) { |
10 test(function() { | 10 window.onload = t.step_func(function() { |
11 document.documentElement.offsetTop; | 11 document.documentElement.offsetTop; |
12 var img = document.querySelector("img"); | 12 var img = document.querySelector("img"); |
13 img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS 7AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAGUEx URf8AAAAAAEGjEgMAAAAMSURBVHjaYmAACDAAAAIAAU9tWeEAAAAASUVORK5CYII="; | 13 img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAA oyzS7AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAA GUExURf8AAAAAAEGjEgMAAAAMSURBVHjaYmAACDAAAAIAAU9tWeEAAAAASUVORK5CYII="; |
14 assert_equals(internals.needsLayoutCount(), 0); | 14 img.onload = t.step_func_done(function() { |
fs
2016/08/17 08:56:08
Does it still work/pass if you assert needsLayoutC
sivag
2016/08/17 09:00:09
yes it works fine.
fs
2016/08/17 10:27:46
Could you add that assertion too then? =)
sivag
2016/08/17 10:41:09
Done.
| |
15 assert_equals(internals.needsLayoutCount(), 0); | |
16 }); | |
17 }); | |
15 }); | 18 }); |
16 </script> | 19 </script> |
OLD | NEW |