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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/sizes-changed-intrinsic-size-update.html

Issue 2292013002: Notify LayoutImage that intrinsic dimensions changed when sizes changes (Closed)
Patch Set: test improvements Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/sizes-changed-intrinsic-size-update.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/sizes-changed-intrinsic-size-update.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/sizes-changed-intrinsic-size-update.html
new file mode 100644
index 0000000000000000000000000000000000000000..408da9bc4d6ba6e66c577c8125b79cf51ff19189
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/sizes-changed-intrinsic-size-update.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<body>
+<img id="image"
+ srcset="resources/black.png 100w,
+ resources/image-set-4x.png 1600w"
+ sizes="100px"
+>
+<script>
+ var t = async_test('Make sure that a sizes change also changes the intrinsic dimensions');
+ window.onload = t.step_func(function() {
+
+ var img = document.getElementById("image");
+ img.onload = t.step_func(function() {
+ assert_equals(img.width, 1600);
+ img.onload = function(){};
+ img.sizes = "100px";
+ assert_equals(img.width, 100);
+ t.done();
+ });
+ img.sizes = "1600px";
+ });
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698