Bug 1313753 - Test case for correctness of visible regions of preserve-3d. r=mattwoodrow a=test-only
authorThinker K.F. Li <thinker@codemud.net>
Thu, 16 Feb 2017 22:52:00 -0500
changeset 354348 85400a46019b9663ff62727565a8e478dd1577e1
parent 354347 db5e61ac282d94631be31bd6f5d2e85d75d289b5
child 354349 da123a8b468f6004cef07a9d8a1c7a59c1434be8
push id6897
push userryanvm@gmail.com
push dateTue, 21 Feb 2017 21:41:19 +0000
treeherdermozilla-esr52@0316bb85a29c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, test-only
bugs1313753
milestone52.0
Bug 1313753 - Test case for correctness of visible regions of preserve-3d. r=mattwoodrow a=test-only
dom/tests/mochitest/general/mochitest.ini
dom/tests/mochitest/general/test_bug1313753.html
--- a/dom/tests/mochitest/general/mochitest.ini
+++ b/dom/tests/mochitest/general/mochitest.ini
@@ -68,16 +68,17 @@ skip-if = (toolkit == 'android') # Disab
 subsuite = clipboard
 [test_bug1012662_noeditor.html]
 subsuite = clipboard
 skip-if = (toolkit == 'android') # Disabled on Android, see bug 1230231
 [test_bug1161721.html]
 [test_bug1170911.html]
 subsuite = clipboard
 [test_bug1208217.html]
+[test_bug1313753.html]
 [test_clientRects.html]
 [test_clipboard_disallowed.html]
 [test_clipboard_events.html]
 subsuite = clipboard
 [test_consoleAPI.html]
 [test_contentViewer_overrideDPPX.html]
 [test_DOMMatrix.html]
 [test_domWindowUtils.html]
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/general/test_bug1313753.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Test for bug 1313753</title>
+<script type="application/javascript"
+        src="/tests/SimpleTest/SimpleTest.js"></script>
+<div id="log"></div>
+<script>
+function runTest() {
+    // Change visible region of |closure| element.
+    document.getElementById("target").classList.add("rotate");
+    window.setTimeout(function() {
+	var target = document.getElementById("target");
+	var bounds = target.getBoundingClientRect();
+	var x = bounds.x + bounds.width / 2;
+	var y = bounds.y + bounds.height / 2;
+	is(document.elementFromPoint(x, y).id, target.id,
+	  "it should be |target| element if visible regions of closure is correct");
+	SimpleTest.finish();
+    }, 0);
+}
+
+SimpleTest.waitForExplicitFinish();
+SimpleTest.waitForFocus(runTest);
+</script>
+
+<style>
+.panel {
+    transform: rotateX(-150deg);
+    backface-visibility: hidden;
+    transform-origin: 0px 0px;
+    position: absolute;
+    display: block;
+    width: 100px;
+    height: 100px;
+    background-color: green;
+}
+#closure .rotate {
+    transform: rotateX(0deg);
+}
+#closure {
+    perspective: 100px;
+    width: 200px;
+    z-index: 1;
+}
+#outer {
+    height: 400px;
+    width: 200px;
+}
+</style>
+<div id="outer">
+  <div id="closure">
+    <div style="transform-style: preserve-3d;">
+	<div style="transform-style: preserve-3d; background-color: blue;">
+	  <ul>
+	    <li><div id="target" class="panel"></div>
+	    </li>
+	  </ul>
+	</div>
+    </div>
+  </div>
+</div>