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

Unified Diff: LayoutTests/svg/custom/inline-svg-use-available-width.html

Issue 341773004: Use available width for replaced element with intrinsic ratio but no dimensions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and add NeedsRebaseline to zoom test with off-by-one (or so) errors 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/svg/custom/inline-svg-use-available-width-in-stf.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/svg/custom/inline-svg-use-available-width.html
diff --git a/LayoutTests/svg/custom/inline-svg-use-available-width.html b/LayoutTests/svg/custom/inline-svg-use-available-width.html
new file mode 100644
index 0000000000000000000000000000000000000000..f2ec6f55408c4a3b81f6f38f7f8ad1af7b452792
--- /dev/null
+++ b/LayoutTests/svg/custom/inline-svg-use-available-width.html
@@ -0,0 +1,41 @@
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+ .rel {
+ position: relative;
+ width: 400px;
+ height: 200px;
+ }
+ .abs {
+ position: absolute;
+ left: 100px;
+ right: 100px;
+ }
+ .test {
+ display: block;
+ background: red;
+ }
+ .control { /* overlay to hide the red */
+ position: absolute;
+ left: 100px;
+ width: 200px;
+ height: 200px;
+ background-color: green;
+ }
+</style>
+<div class="rel">
+ <div class="abs">
+ <svg class="test" viewBox="0 0 1 1">
+ </svg>
+ </div>
+ <div class="control">
+ </div>
+</div>
+<script>
+ test(function() {
+ var bounds = document.querySelector('.test').getBoundingClientRect();
+ assert_equals(bounds.width, 200);
+ assert_equals(bounds.height, 200);
+ }, "Use available width and use intrinsic ratio to compute height");
+</script>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/svg/custom/inline-svg-use-available-width-in-stf.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698