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

Unified Diff: third_party/WebKit/LayoutTests/virtual/stable/svg/transforms/stable/legacy-transform-box.html

Issue 2786643003: Implement support for the 'transform-box' property (Closed)
Patch Set: Rebase; fix property spec; update histogram.xml Created 3 years, 8 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: third_party/WebKit/LayoutTests/virtual/stable/svg/transforms/stable/legacy-transform-box.html
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/svg/transforms/stable/legacy-transform-box.html b/third_party/WebKit/LayoutTests/virtual/stable/svg/transforms/stable/legacy-transform-box.html
new file mode 100644
index 0000000000000000000000000000000000000000..96f6ac2eb8052b3fc81e55da22a309f22e27c7f9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/stable/svg/transforms/stable/legacy-transform-box.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Legacy transform-box behavior</title>
+<script src="../../../../../resources/testharness.js"></script>
+<script src="../../../../../resources/testharnessreport.js"></script>
+<style>
+svg {
+ background-color: red;
+}
+#r1 {
+ transform: translate(100%, 100%);
+}
+#r2 {
+ transform-origin: 150px -50%;
+ transform: rotate(90deg);
+}
+#r3 {
+ transform-origin: -50% 50px;
+ transform: rotate(90deg);
+}
+#r4 {
+ transform-origin: 100% 0%;
+ transform: rotate(-180deg);
+}
+</style>
+<svg width="200" height="200">
+ <rect id="r1" width="100" height="100" fill="green"/>
+ <rect id="r2" width="100" height="100" x="100" y="100" fill="green"/>
+ <rect id="r3" width="100" height="100" x="100" fill="green"/>
+ <rect id="r4" width="100" height="100" y="100" fill="green"/>
+</svg>
+<script>
+function assert_rect_equals(actual, expected) {
+ for (let component of ['left', 'top', 'width', 'height'])
+ assert_equals(actual[component], expected[component], component);
+}
+
+test(function() {
+ let rects = document.querySelectorAll('rect');
+ assert_rect_equals(rects[0].getBoundingClientRect(), { left: 108, top: 108, width: 100, height: 100});
+ assert_rect_equals(rects[1].getBoundingClientRect(), { left: 8, top: 8, width: 100, height: 100});
+ assert_rect_equals(rects[2].getBoundingClientRect(), { left: 8, top: 108, width: 100, height: 100});
+ assert_rect_equals(rects[3].getBoundingClientRect(), { left: 108, top: 8, width: 100, height: 100});
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698