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

Unified Diff: LayoutTests/svg/foreignObject/fO-percentage-height-style.html

Issue 218403009: Map width/height to style for foreignObject (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added SVG DOM change to test Created 6 years, 9 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/foreignObject/fO-percentage-height-style.html
diff --git a/LayoutTests/svg/foreignObject/fO-percentage-height-style.html b/LayoutTests/svg/foreignObject/fO-percentage-height-style.html
new file mode 100644
index 0000000000000000000000000000000000000000..2397096eb0a5363637121e931179e6ce6e97924b
--- /dev/null
+++ b/LayoutTests/svg/foreignObject/fO-percentage-height-style.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<script src="../../resources/js-test.js"></script>
+<svg viewBox="0 0 250 250">
+ <title>Test use of percentages inside foreignObject</title>
+ <foreignobject width="250" height="250">
+ <svg style="height:100%; background: blue">
+ </svg>
+ </foreignObject>
+</svg>
+<script>
+ var nestedSvg = document.querySelectorAll('svg')[1];
+ shouldBe("nestedSvg.offsetHeight", "250");
+
+ nestedSvg.style.height = "50%";
+ shouldBe("nestedSvg.offsetHeight", "125");
+
+ var foreignObject = nestedSvg.parentNode;
+ foreignObject.height.baseVal.value = 400;
+ shouldBe("nestedSvg.offsetHeight", "200");
+</script>

Powered by Google App Engine
This is Rietveld 408576698