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

Unified Diff: third_party/WebKit/LayoutTests/fast/replaced/aspect-ratio-of-replaced-child-with-max-height.html

Issue 2683793007: Keep the aspect ratio of child with percentage max-height when the size of its container changes (Closed)
Patch Set: Updated LayoutReplaced::needsPreferredWidthsRecalculation Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/replaced/aspect-ratio-of-replaced-child-with-max-height-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/replaced/aspect-ratio-of-replaced-child-with-max-height.html
diff --git a/third_party/WebKit/LayoutTests/fast/replaced/aspect-ratio-of-replaced-child-with-max-height.html b/third_party/WebKit/LayoutTests/fast/replaced/aspect-ratio-of-replaced-child-with-max-height.html
new file mode 100644
index 0000000000000000000000000000000000000000..5eeb47cad15a28972805f9eb17b22fedd6e88161
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/replaced/aspect-ratio-of-replaced-child-with-max-height.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<style>
+#container {
+ background-color: lime;
+}
+
+img, canvas {
+ max-height: 100%;
+}
+</style>
+
+<p>
+Tests that a replaced child with percentage max-height should keep the aspect
+ratio when the size of its container changes.
+</p>
+
+<div id="container">
+ <img src="resources/square-blue-100x100.png" data-expected-width="50"
+ data-expected-height="50">
+ <canvas width="400" height="400" data-expected-width="50"
+ data-expected-height="50"></canvas>
+</div>
+
+<script src="../../resources/check-layout.js"></script>
+
+<script>
+ function runTest() {
+ document.body.offsetTop;
+ var container = document.getElementById('container');
+ container.style.height = "50px";
+ document.body.offsetTop;
+ checkLayout("#container");
+ }
+window.onload = runTest;
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/replaced/aspect-ratio-of-replaced-child-with-max-height-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698