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

Unified Diff: LayoutTests/svg/custom/size-follows-container-size.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: Address review comments 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/stf-container-with-intrinsic-ratio-svg.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/svg/custom/size-follows-container-size.html
diff --git a/LayoutTests/svg/custom/size-follows-container-size.html b/LayoutTests/svg/custom/size-follows-container-size.html
new file mode 100644
index 0000000000000000000000000000000000000000..eaa8c0d82fcb9cfbdb39d32b896d69f629ef5161
--- /dev/null
+++ b/LayoutTests/svg/custom/size-follows-container-size.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+ svg { background-color: lightblue }
+ div { width: 500px; background-color: blue; padding: 1em }
+</style>
+<div>
+ <svg viewBox="0 0 100 100"></svg>
+</div>
+<script>
+ var dec_test = async_test("Test SVG dimensions after container width has shrunk");
+ var inc_test = async_test("Test SVG dimensions after container width has grown");
+ onload = function() {
+ requestAnimationFrame(function() {
+ document.querySelector('div').style.width = "1000px";
+ inc_test.step(function() {
+ assert_equals(document.querySelector('svg').offsetWidth, 1000);
+ assert_equals(document.querySelector('svg').offsetHeight, 1000);
+ });
+ inc_test.done();
+ document.querySelector('div').style.width = "100px";
+ dec_test.step(function() {
+ assert_equals(document.querySelector('svg').offsetWidth, 100);
+ assert_equals(document.querySelector('svg').offsetHeight, 100);
+ });
+ dec_test.done();
+ });
+ };
+</script>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/svg/custom/stf-container-with-intrinsic-ratio-svg.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698