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

Unified Diff: LayoutTests/svg/custom/stf-container-with-intrinsic-ratio-svg.html

Issue 325183002: Make preferred widths for replaced content independent on available width (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more test Created 6 years, 6 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
Index: LayoutTests/svg/custom/stf-container-with-intrinsic-ratio-svg.html
diff --git a/LayoutTests/svg/custom/stf-container-with-intrinsic-ratio-svg.html b/LayoutTests/svg/custom/stf-container-with-intrinsic-ratio-svg.html
new file mode 100644
index 0000000000000000000000000000000000000000..e7f8cf7b0e87936a78b0cae55dee9cec9d7f9acf
--- /dev/null
+++ b/LayoutTests/svg/custom/stf-container-with-intrinsic-ratio-svg.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style type="text/css">
+ body > div { width: 100px }
+ #stf1 { float: left }
+ #stf2 { position: absolute }
+ #stf3 { display: table-cell }
+</style>
+<div>
+ <div id="stf1">
+ <svg viewBox='0 0 1 1'></svg>
+ </div>
+ <div id="stf2">
+ <svg viewBox='0 0 1 1'></svg>
+ </div>
+ <div id="stf3">
+ <svg viewBox='0 0 1 1'></svg>
+ </div>
+</div>
+<script>
+ test(function() {
+ var r = document.getElementById('stf1').getBoundingClientRect();
+ assert_equals(r.width, 0);
+ }, "Test floated element width with replaced element with intrinsic ratio but no dimensions");
+ test(function() {
+ var r = document.getElementById('stf2').getBoundingClientRect();
+ assert_equals(r.width, 0);
+ }, "Test absolute positioned element width with replaced element with intrinsic ratio but no dimensions");
+ test(function() {
+ var r = document.getElementById('stf3').getBoundingClientRect();
+ assert_true(r.width == 1 || r.width == 0); // Unclear if width should be 0 or 1. (Firefox and Blink doesn't agree)
pdr. 2014/06/18 17:48:43 Lets pick one but leave the comment. This will let
davve 2014/06/18 19:16:47 Fair. Will fix grammar in the comment though :)
+ }, "Test table cell width with replaced element with intrinsic ratio but no dimensions");
+</script>

Powered by Google App Engine
This is Rietveld 408576698