summaryrefslogtreecommitdiffstats
path: root/layout/reftests/svg/as-image/image-orientation-viewbox-no-size.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/reftests/svg/as-image/image-orientation-viewbox-no-size.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/reftests/svg/as-image/image-orientation-viewbox-no-size.html')
-rw-r--r--layout/reftests/svg/as-image/image-orientation-viewbox-no-size.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/layout/reftests/svg/as-image/image-orientation-viewbox-no-size.html b/layout/reftests/svg/as-image/image-orientation-viewbox-no-size.html
new file mode 100644
index 000000000..6c8329188
--- /dev/null
+++ b/layout/reftests/svg/as-image/image-orientation-viewbox-no-size.html
@@ -0,0 +1,50 @@
+<!DOCTYPE>
+<head>
+ <style>
+ body {
+ border: 0px;
+ margin: 0px;
+ padding: 0px;
+ }
+ </style>
+</head>
+<body>
+ <img src="image-orientation-viewbox-no-size.svg">
+
+ <script>
+ var orientationInfo = location.search.substring(1).split("&");
+ var angle = orientationInfo[0];
+ var flip = orientationInfo[1] == "flip" ? true : false;
+
+ // Construct a style. "from-image" is special-cased.
+ var orientationStyle;
+ if (angle == "from-image") {
+ orientationStyle = "image-orientation: from-image;";
+ } else {
+ orientationStyle = "image-orientation: "
+ + angle + "deg"
+ + (flip ? " flip" : "")
+ + ";";
+ }
+
+ // Since the SVG image has no intrinsic size, we need to apply an
+ // appropriate size to the <img> element to match the reference.
+ var boxStyle;
+ if (angle == "90" || angle == "270") {
+ boxStyle = "width: 200px; height: 100px;";
+ } else {
+ boxStyle = "width: 100px; height: 200px;";
+ }
+
+ var style = "img { "
+ + orientationStyle
+ + " "
+ + boxStyle
+ + " }\n";
+
+ // Apply the style to the document.
+ var sheet = document.createElement('style');
+ sheet.innerHTML = style;
+ document.body.appendChild(sheet);
+ </script>
+</body>