WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-62797-20111024165026.patch (text/plain), 30.08 KB, created by
Simon Fraser (smfr)
on 2011-10-24 16:50:27 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2011-10-24 16:50:27 PDT
Size:
30.08 KB
patch
obsolete
>Subversion Revision: 98288 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 236cff4a31d8747c4037cee79e65338b02f1405b..9ed3ea10261ee90b69aa0305b16b1b71658dc773 100755 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,39 @@ >+2011-10-24 Simon Fraser <simon.fraser@apple.com> >+ >+ REGRESSION (r88580): Cursor fails to change to pointer on embedded Google maps popups >+ https://bugs.webkit.org/show_bug.cgi?id=62797 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When hit testing through transformed layers, RenderLayer would simply use >+ the composited bounds of the layer as the localHitTestRect for hit testing sublayers. >+ However, this broke hit testing on pages that have a composited, non-transformed layer >+ which falls outside the bounds of its parent, composited-transformed layer, like Google >+ Maps. >+ >+ Fix by mapping the hitTestRect through transforms. However this is tricky, because >+ mapping a rect into the coordinate system of a layer can result in invalid rectangles >+ when point projection results in a negative w component. Fix TransformationMatrix::projectPoint() >+ to detect this case and replace X and Y with large values, and add boundsOfProjectedQuad(), which >+ maps rectangles with possibly-infinite location or bounds into rects which are representable >+ in an IntRect. >+ >+ Tests: transforms/3d/hit-testing/composited-hit-test.html >+ transforms/3d/hit-testing/rotated-hit-test-with-child.html >+ transforms/3d/hit-testing/rotated-hit-test2.html >+ >+ * platform/graphics/transforms/TransformationMatrix.cpp: >+ (WebCore::TransformationMatrix::projectPoint): >+ (WebCore::TransformationMatrix::projectQuad): >+ (WebCore::clampEdgeValue): >+ (WebCore::TransformationMatrix::boundsOfProjectedQuad): >+ * platform/graphics/transforms/TransformationMatrix.h: >+ * rendering/HitTestingTransformState.cpp: >+ (WebCore::HitTestingTransformState::boundsOfMappedQuad): >+ * rendering/HitTestingTransformState.h: >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::hitTestLayer): >+ > 2011-10-21 Nat Duca <nduca@chromium.org> > > [chromium] Add isTraceEventEnabled to PlatformSupport. >diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp >index 847817e195a5e6166735af13ea1d166f91e2e388..dacfaee2e68af0242e06523475c6f4fbf70e9137 100644 >--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp >+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp >@@ -36,6 +36,8 @@ > #include <wtf/Assertions.h> > #include <wtf/MathExtras.h> > >+using namespace std; >+ > namespace WebCore { > > // >@@ -532,7 +534,7 @@ TransformationMatrix& TransformationMatrix::flipY() > return scaleNonUniform(1.0f, -1.0f); > } > >-FloatPoint TransformationMatrix::projectPoint(const FloatPoint& p) const >+FloatPoint TransformationMatrix::projectPoint(const FloatPoint& p, bool* clamped) const > { > // This is basically raytracing. We have a point in the destination > // plane with z=0, and we cast a ray parallel to the z-axis from that >@@ -546,16 +548,24 @@ FloatPoint TransformationMatrix::projectPoint(const FloatPoint& p) const > // intersection point as a distance d from R0 in units of Rd by: > // > // d = -dot (Pn', R0) / dot (Pn', Rd) >+ if (clamped) >+ *clamped = false; > > double x = p.x(); > double y = p.y(); > double z = -(m13() * x + m23() * y + m43()) / m33(); > >+ // FIXME: use multVecMatrix() > double outX = x * m11() + y * m21() + z * m31() + m41(); > double outY = x * m12() + y * m22() + z * m32() + m42(); > > double w = x * m14() + y * m24() + z * m34() + m44(); >- if (w != 1 && w != 0) { >+ if (w <= 0) { >+ outX = copysign(numeric_limits<int>::max(), outX); >+ outY = copysign(numeric_limits<int>::max(), outY); >+ if (clamped) >+ *clamped = true; >+ } else if (w != 1) { > outX /= w; > outY /= w; > } >@@ -570,9 +580,39 @@ FloatQuad TransformationMatrix::projectQuad(const FloatQuad& q) const > projectedQuad.setP2(projectPoint(q.p2())); > projectedQuad.setP3(projectPoint(q.p3())); > projectedQuad.setP4(projectPoint(q.p4())); >+ > return projectedQuad; > } > >+static float clampEdgeValue(float f) >+{ >+ ASSERT(!isnan(f)); >+ return min<float>(max<float>(f, -numeric_limits<int>::max() / 2), numeric_limits<int>::max() / 2); >+} >+ >+IntRect TransformationMatrix::clampedBoundsOfProjectedQuad(const FloatQuad& q) const >+{ >+ FloatRect mappedQuadBounds = projectQuad(q).boundingBox(); >+ >+ float left = clampEdgeValue(floorf(mappedQuadBounds.x())); >+ float top = clampEdgeValue(floorf(mappedQuadBounds.y())); >+ >+ float right; >+ if (isinf(mappedQuadBounds.x()) && isinf(mappedQuadBounds.width())) >+ right = numeric_limits<int>::max() / 2; >+ else >+ right = clampEdgeValue(ceilf(mappedQuadBounds.maxX())); >+ >+ float bottom; >+ if (isinf(mappedQuadBounds.y()) && isinf(mappedQuadBounds.height())) >+ bottom = numeric_limits<int>::max() / 2; >+ else >+ bottom = clampEdgeValue(ceilf(mappedQuadBounds.maxY())); >+ >+ return IntRect(clampToInteger(left), clampToInteger(top), >+ clampToInteger(right - left), clampToInteger(bottom - top)); >+} >+ > FloatPoint TransformationMatrix::mapPoint(const FloatPoint& p) const > { > if (isIdentityOrTranslation()) >diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h >index c19c3c11323b74a56e1351868dbaf5605da9edd9..0450ad7b4e93a5334d2df8dfa104f9e86e31e4a1 100644 >--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h >+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h >@@ -156,9 +156,12 @@ public: > // a ray perpendicular to the source plane and computing > // the local x,y position of the point where that ray intersects > // with the destination plane. >- FloatPoint projectPoint(const FloatPoint&) const; >+ FloatPoint projectPoint(const FloatPoint&, bool* clamped = 0) const; > // Projects the four corners of the quad > FloatQuad projectQuad(const FloatQuad&) const; >+ // Projects the four corners of the quad and takes a bounding box, >+ // while sanitizing values created when the w component is negative. >+ IntRect clampedBoundsOfProjectedQuad(const FloatQuad&) const; > > double m11() const { return m_matrix[0][0]; } > void setM11(double f) { m_matrix[0][0] = f; } >diff --git a/Source/WebCore/rendering/HitTestingTransformState.cpp b/Source/WebCore/rendering/HitTestingTransformState.cpp >index fbb5b105691b41abdbd51fa7b398278c1b6a9552..cb1e1d6cbbf1b57bcebc960b5d0dc50835b1823b 100644 >--- a/Source/WebCore/rendering/HitTestingTransformState.cpp >+++ b/Source/WebCore/rendering/HitTestingTransformState.cpp >@@ -73,4 +73,9 @@ FloatQuad HitTestingTransformState::mappedQuad() const > return m_accumulatedTransform.inverse().projectQuad(m_lastPlanarQuad); > } > >+IntRect HitTestingTransformState::boundsOfMappedQuad() const >+{ >+ return m_accumulatedTransform.inverse().clampedBoundsOfProjectedQuad(m_lastPlanarQuad); >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/rendering/HitTestingTransformState.h b/Source/WebCore/rendering/HitTestingTransformState.h >index ecee9140d6fa7c03887eeda7201a1054af02b13c..6aea66c63bbab337557e00b463187e07920ec7dd 100644 >--- a/Source/WebCore/rendering/HitTestingTransformState.h >+++ b/Source/WebCore/rendering/HitTestingTransformState.h >@@ -58,6 +58,7 @@ public: > > FloatPoint mappedPoint() const; > FloatQuad mappedQuad() const; >+ IntRect boundsOfMappedQuad() const; > void flatten(); > > FloatPoint m_lastPlanarPoint; >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index a133fc189ab30ab73b9a7b1582213b7bf6c96442..51568e5f8a1a4032329e3e2241cb68b1dba3e743 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -3142,14 +3142,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont > // We can't just map hitTestPoint and hitTestRect because they may have been flattened (losing z) > // by our container. > LayoutPoint localPoint = roundedLayoutPoint(newTransformState->mappedPoint()); >- LayoutRect localHitTestRect; >-#if USE(ACCELERATED_COMPOSITING) >- if (isComposited()) { >- // It doesn't make sense to project hitTestRect into the plane of this layer, so use the same bounds we use for painting. >- localHitTestRect = backing()->compositedBounds(); >- } else >-#endif >- localHitTestRect = newTransformState->mappedQuad().enclosingBoundingBox(); >+ LayoutRect localHitTestRect = newTransformState->boundsOfMappedQuad(); > > // Now do a hit test with the root layer shifted to be us. > return hitTestLayer(this, containerLayer, request, result, localHitTestRect, localPoint, true, newTransformState.get(), zOffset); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index a0020ee2d92d787c9bfd2319c550524d32d2413e..73288ce2218420ffc1d338717888526389b501ac 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,24 @@ >+2011-10-24 Simon Fraser <simon.fraser@apple.com> >+ >+ REGRESSION (r88580): Cursor fails to change to pointer on embedded Google maps popups >+ https://bugs.webkit.org/show_bug.cgi?id=62797 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ New tests for hit testing through various configurations of 3D transforms. >+ >+ * platform/mac/transforms/3d/hit-testing/rotated-hit-test-expected.png: Removed. >+ * platform/mac/transforms/3d/hit-testing/rotated-hit-test-expected.txt: Removed. >+ * transforms/3d/hit-testing/composited-hit-test-expected.txt: Added. >+ * transforms/3d/hit-testing/composited-hit-test.html: Added. >+ * transforms/3d/hit-testing/resources/hit-test-utils.js: Added. >+ * transforms/3d/hit-testing/rotated-hit-test-expected.txt: Added. >+ * transforms/3d/hit-testing/rotated-hit-test-with-child-expected.txt: Added. >+ * transforms/3d/hit-testing/rotated-hit-test-with-child.html: Added. >+ * transforms/3d/hit-testing/rotated-hit-test.html: >+ * transforms/3d/hit-testing/rotated-hit-test2-expected.txt: Added. >+ * transforms/3d/hit-testing/rotated-hit-test2.html: Added. >+ > 2011-10-24 Levi Weintraub <leviw@chromium.org> > > Adding Chromium expectations from http://trac.webkit.org/changeset/98263 >diff --git a/LayoutTests/platform/mac/transforms/3d/hit-testing/rotated-hit-test-expected.png b/LayoutTests/platform/mac/transforms/3d/hit-testing/rotated-hit-test-expected.png >deleted file mode 100644 >index 452870aceedb438fe3ad6f44bdbb43bc3fd007b7..0000000000000000000000000000000000000000 >GIT binary patch >literal 0 >HcmV?d00001 > >literal 14520 >zcmeHO`9IX#{~udPS5!BOm}$4WDrB9ZEGZST?=h4$#yXgxg-RMX%VaOIWxYuWgPZKj >z$To<XWQ&op4Q9s7e5ZRa<MI6$KJyda?{l87^Lm}vd7kI%HRJJ(YX*V>VgdjFK=88R >zB~t)^2Lu3cTk-E=JxL9^cbD};IzZ1Vz~wg7#S<3j4N!Jbc5!i0Q#t>Kk{VRm^@0mj >z`P?nmL#4CMYOb!XZUTFBrdbFJcP?JMarxp!&<%fIw>w@?03d|x;Z3aPL7m?jDn5lh >z$N6nM_q`2?KYrP|=(b+J3Vr`A&)>cR-|NM@p1VBgqe5IbU77o6^7|JVyxz}OyP1)a >z@I_ZeqlY$nQurdNTdzdrm%4nezR#U&=tivIRY?)PK?H!HfA4v6B=4kPi)r@$J6_?s >z9-EH<&$9REoIhp$b^hAPT{`z+l(3m0xKNa>MPnE(_-$}WYVZ5h-4E!HZw9HuGUX&u >zKLP6l+>bN~ucTW7_z4q3%kwC;YoQ^3R|?5$eYQRx4pElxMjBU{b)D*i+&8?CNcJ<; >zPRGS2;v{z8@o{Tz6~<hT&#UQND7y73{o2~TcudAB;#vh>`_r*cdykZW^{e7C$xjEs >z-<`)_Pk)ZqI(k@nb;Ie<2eHBp<xjsm3LBrvzUeotAh`6Rly0$XbnkBbg?3lxNSKY` >zb=*~-jp`V_h|{=(W#5A>OvXb|2i@`gV<f#1?y^7jN&F`ETdJVp4PiZA=NIKSAkms) >zO6TADgH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=e-j1bBtF{!WY6VqM >z%`oBKW7x$w=YwmL6MDW9Dt<UwYj5!U)CI4q>^{~mX)Kf#&@|@M$ZxC3CrkqyLrY8u >zp#?Mvg~KXwVBe}@FZ%aJmuSVq#r0)r14KeG*y}-=<)b&2lc}MbUl%iuD3|xk`VNrx >z6)HAkDVsCymH6ts6DZBM=|~1;f)XbG6}$X=Jm)%j;%b<n;{&TQ8*^`u8-+RrrDb(J >zS>g39mi5#DKkvX5YA5|fpc!SjLm`(oE`+QquIN^u;_J9K@*0H|@+?6g#rqDuMErOa >z^UP8(ZPfC<gWzrD+M`Of8vY|aGa`+-VZ=<7YTZ&?t^@o7BB0n|p(<4Zxw$lv<#X1{ >z-*HSWL5#ts$8TB3%AG>|7!AyDrm&2?Ms0;jJ!rA5(Y(Y>l01fj9~p(~6;q+138=eW >zn!eBv#2N`^O~7oGXtvLdG9753fuJP$;rdDbE={C4F(Y<<oQHx0A5HHe6Lv#Y^o >zy_#4mYwKM(P&EUE(}&Z~(Zj(z#Q&8jH6ak};|0`?6e+!Z4{y_Ox-$Jh!3WCQ^` >zer}20zS|(WTwEu|dn(xs!5Q-F_;cd&j}YV}11A}_i}C-G!Doc%2>=|r^y|9-93tVc >zCkVn}2@XsAf0p1d1BV$n%<ykFjUy&GVv<vFamq}NQ2OVCB@P{O=#WE)96IFCA%_k* >leP>QT{(rUE9>v_<L7h!s_ljy}{VO8ivfi~zrMgb{{tu=e2iE`q > >diff --git a/LayoutTests/platform/mac/transforms/3d/hit-testing/rotated-hit-test-expected.txt b/LayoutTests/platform/mac/transforms/3d/hit-testing/rotated-hit-test-expected.txt >deleted file mode 100644 >index 9b70f08612a1b0bcbfbba7f4673174b084549411..0000000000000000000000000000000000000000 >--- a/LayoutTests/platform/mac/transforms/3d/hit-testing/rotated-hit-test-expected.txt >+++ /dev/null >@@ -1,14 +0,0 @@ >-layer at (0,0) size 800x600 >- RenderView at (0,0) size 800x600 >-layer at (0,0) size 800x600 >- RenderBlock {HTML} at (0,0) size 800x600 >- RenderBody {BODY} at (8,8) size 784x584 >- RenderBlock {DIV} at (0,202) size 784x18 >- RenderText {#text} at (0,0) size 124x18 >- text run at (0,0) width 124: "Found box1: PASS" >- RenderBR {BR} at (124,14) size 0x0 >-layer at (8,8) size 202x202 >- RenderBlock {DIV} at (0,0) size 202x202 [border: (1px solid #000000)] >- RenderText {#text} at (0,0) size 0x0 >-layer at (9,9) size 200x200 >- RenderBlock {DIV} at (1,1) size 200x200 [bgcolor=#808080] >diff --git a/LayoutTests/transforms/3d/hit-testing/composited-hit-test-expected.txt b/LayoutTests/transforms/3d/hit-testing/composited-hit-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9733366b32eb9c4f25fb4d834fe9c303d13a5a08 >--- /dev/null >+++ b/LayoutTests/transforms/3d/hit-testing/composited-hit-test-expected.txt >@@ -0,0 +1,5 @@ >+Element at 48, 48 has id "container": PASS >+Element at 75, 75 has id "target": PASS >+Element at 100, 100 has id "target": PASS >+Element at 125, 125 has id "target": PASS >+ >diff --git a/LayoutTests/transforms/3d/hit-testing/composited-hit-test.html b/LayoutTests/transforms/3d/hit-testing/composited-hit-test.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c1e7ce1ee839d67e913f49b0ba9003557392f7d5 >--- /dev/null >+++ b/LayoutTests/transforms/3d/hit-testing/composited-hit-test.html >@@ -0,0 +1,64 @@ >+<html> >+<head> >+ <style> >+ body { >+ margin: 0; >+ } >+ >+ #canvas { >+ width: 200px; >+ height: 200px; >+ position: relative; >+ background-color: silver; >+ -webkit-transform: translateZ(0px); >+ } >+ >+ #container { >+ left: 0px; >+ top: 0px; >+ z-index: 1; >+ border: 2px solid green; >+ -webkit-transform: translateZ(0px); >+ } >+ >+ .box { >+ position: absolute; >+ height: 100px; >+ width: 100px; >+ } >+ >+ #target { >+ left: 50px; >+ top: 50px; >+ background-color: blue; >+ cursor: pointer; >+ } >+ >+ .box:hover { >+ background-color: orange !important; >+ } >+ #results { >+ margin: 10px; >+ } >+ </style> >+ <script src="resources/hit-test-utils.js"></script> >+ <script> >+ const hitTestData = [ >+ { 'point': [48, 48], 'target' : 'container' }, >+ { 'point': [75, 75], 'target' : 'target' }, >+ { 'point': [100, 100], 'target' : 'target' }, >+ { 'point': [125, 125], 'target' : 'target' }, >+ ]; >+ window.addEventListener('load', runTest, false); >+ </script> >+</head> >+<body> >+ <div id="canvas"> >+ <div id="container" class="box"> >+ <div id="target" class="box"> >+ </div> >+ </div> >+ </div> >+ <div id="results"></div> >+</body> >+</html> >diff --git a/LayoutTests/transforms/3d/hit-testing/resources/hit-test-utils.js b/LayoutTests/transforms/3d/hit-testing/resources/hit-test-utils.js >new file mode 100644 >index 0000000000000000000000000000000000000000..a24a33a38d41d70fc22f39c354c37f52318327bb >--- /dev/null >+++ b/LayoutTests/transforms/3d/hit-testing/resources/hit-test-utils.js >@@ -0,0 +1,20 @@ >+if (window.layoutTestController) >+ layoutTestController.dumpAsText(); >+ >+function log(s) >+{ >+ var results = document.getElementById('results'); >+ results.innerHTML += s + '<br>'; >+} >+ >+function runTest() >+{ >+ for (var i = 0; i < hitTestData.length; ++i) { >+ var test = hitTestData[i]; >+ var hit = document.elementFromPoint(test.point[0], test.point[1]); >+ if (hit.id == test.target) >+ log('Element at ' + test.point[0] + ', ' + test.point[1] + ' has id \"' + hit.id + '\": PASS'); >+ else >+ log('Element at ' + test.point[0] + ', ' + test.point[1] + ' is ' + hit.id + ': FAIL'); >+ } >+} >diff --git a/LayoutTests/transforms/3d/hit-testing/rotated-hit-test-expected.txt b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..35ae72dbcdb1ee5d1c62d7d5a755d1e2c6cd95e0 >--- /dev/null >+++ b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test-expected.txt >@@ -0,0 +1,9 @@ >+Element at 85, 100 has id "left": PASS >+Element at 155, 80 has id "top": PASS >+Element at 230, 80 has id "right": PASS >+Element at 155, 220 has id "bottom": PASS >+Element at 60, 60 has id "container": PASS >+Element at 100, 100 has id "container": PASS >+Element at 240, 240 has id "container": PASS >+Element at 200, 200 has id "container": PASS >+ >diff --git a/LayoutTests/transforms/3d/hit-testing/rotated-hit-test-with-child-expected.txt b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test-with-child-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..64ad5ebcfc19248771ad03f9f73e93fd2c5f2ae2 >--- /dev/null >+++ b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test-with-child-expected.txt >@@ -0,0 +1,5 @@ >+Element at 30, 30 has id "box1": PASS >+Element at 80, 100 has id "box1": PASS >+Element at 100, 120 has id "box2": PASS >+Element at 200, 250 has id "box2": PASS >+ >diff --git a/LayoutTests/transforms/3d/hit-testing/rotated-hit-test-with-child.html b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test-with-child.html >new file mode 100644 >index 0000000000000000000000000000000000000000..bfe5bfc6229c956a35d817e874ab2bff04d27adc >--- /dev/null >+++ b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test-with-child.html >@@ -0,0 +1,64 @@ >+<html> >+<head> >+ <style type="text/css" media="screen"> >+ >+ div:hover { >+ outline: 2px solid orange; >+ } >+ #container { >+ width: 200px; >+ height: 200px; >+ border: 1px solid black; >+ -webkit-perspective: 500px; >+ } >+ >+ .box { >+ width: 200px; >+ height: 200px; >+ position: absolute; >+ background-color: gray; >+ } >+ >+ .middle { >+ -webkit-transform-origin: 10% 50%; >+ -webkit-transform: rotateY(40deg); >+ } >+ >+ .box:hover { >+ background-color: orange !important; >+ } >+ >+ .child { >+ position: absolute; >+ top: 100px; >+ left: 100px; >+ background-color: blue; >+ -webkit-transform: translateZ(1px); >+ } >+ >+ #results { >+ margin-top: 100px; >+ } >+ </style> >+ <script src="resources/hit-test-utils.js"></script> >+ <script> >+ const hitTestData = [ >+ { 'point': [30, 30], 'target' : 'box1' }, >+ { 'point': [80, 100], 'target' : 'box1' }, >+ { 'point': [100, 120], 'target' : 'box2' }, >+ { 'point': [200, 250], 'target' : 'box2' }, >+ ]; >+ window.addEventListener('load', runTest, false); >+ </script> >+</head> >+<body> >+ >+<div id="container"> >+ <div class="middle box" id="box1"> >+ <div class="child box" id="box2"></div> >+ </div> >+</div> >+ >+<div id="results"></div> >+</body> >+</html> >diff --git a/LayoutTests/transforms/3d/hit-testing/rotated-hit-test.html b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test.html >index 2ca836ac603c1e0861354a5a81c319eb4bdc4cd1..52cc7d44a562eb4766d3713f00a144dd5797e108 100644 >--- a/LayoutTests/transforms/3d/hit-testing/rotated-hit-test.html >+++ b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test.html >@@ -1,60 +1,73 @@ > <html> > <head> >- <title>Hit testing of almost edge-on elements</title> >- <style type="text/css" media="screen"> >- >- div:hover { >- outline: 2px solid orange; >- } >+ <style type="text/css"> >+ body { >+ margin: 0; >+ } > #container { > width: 200px; > height: 200px; >+ margin: 50px; > border: 1px solid black; >- -webkit-perspective: 500; >+ -webkit-perspective: 500px; > } > > .box { >- display: inline-block; >+ position: absolute; > width: 200px; > height: 200px; > background-color: gray; >+ opacity: 0.75; >+ } >+ >+ #left { > -webkit-transform-origin: 10% 50%; > -webkit-transform: rotateY(90deg); > } >- .box:hover { >- background-color: orange; >+ >+ #top { >+ -webkit-transform-origin: 50% 10%; >+ -webkit-transform: rotateX(-90deg); > } >- </style> >- <script type="text/javascript" charset="utf-8"> >- function log(s) >- { >- var results = document.getElementById('results'); >- results.innerHTML += s + '<br>'; >+ >+ #right { >+ -webkit-transform-origin: 90% 50%; >+ -webkit-transform: rotateY(-90deg); > } > >- function runTest() >- { >- var firstHit = document.elementFromPoint(40, 150); >- >- var box1 = document.getElementById('box1'); >- var container = document.getElementById('container'); >+ #bottom { >+ -webkit-transform-origin: 50% 90%; >+ -webkit-transform: rotateX(90deg); >+ } > >- if (firstHit == box1) >- log('Found box1: PASS'); >- else >- log('Found ' + firstHit.id + ' : FAIL'); >+ .box:hover { >+ background-color: orange; > } >- >+ </style> >+ <script src="resources/hit-test-utils.js"></script> >+ <script> >+ const hitTestData = [ >+ { 'point': [85, 100], 'target' : 'left' }, >+ { 'point': [155, 80], 'target' : 'top' }, >+ { 'point': [230, 80], 'target' : 'right' }, >+ { 'point': [155, 220], 'target' : 'bottom' }, >+ { 'point': [60, 60], 'target' : 'container' }, >+ { 'point': [100, 100], 'target' : 'container' }, >+ { 'point': [240, 240], 'target' : 'container' }, >+ { 'point': [200, 200], 'target' : 'container' }, >+ ]; >+ window.addEventListener('load', runTest, false); > </script> > </head> >-<body onload="runTest()"> >+<body> > > <div id="container"> >- <div class="box" id="box1"></div> >-</div> >- >-<div id="results"> >+ <div class="box" id="left"></div> >+ <div class="box" id="top"></div> >+ <div class="box" id="right"></div> >+ <div class="box" id="bottom"></div> > </div> > >+<div id="results"></div> > </body> > </html> >diff --git a/LayoutTests/transforms/3d/hit-testing/rotated-hit-test2-expected.txt b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test2-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..5df5f69d70afb7532d919c56d25469773d8784cf >--- /dev/null >+++ b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test2-expected.txt >@@ -0,0 +1,9 @@ >+Element at 170, 250 has id "left": PASS >+Element at 260, 170 has id "top": PASS >+Element at 330, 250 has id "right": PASS >+Element at 260, 330 has id "bottom": PASS >+Element at 60, 60 has id "container": PASS >+Element at 160, 160 has id "container": PASS >+Element at 190, 190 has id "container": PASS >+Element at 310, 310 has id "container": PASS >+ >diff --git a/LayoutTests/transforms/3d/hit-testing/rotated-hit-test2.html b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test2.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c008bbbcde8a739de6718ff31c2f842a7428e58d >--- /dev/null >+++ b/LayoutTests/transforms/3d/hit-testing/rotated-hit-test2.html >@@ -0,0 +1,79 @@ >+<html> >+<head> >+ <style> >+ body { >+ margin: 0; >+ } >+ >+ #container { >+ width: 400px; >+ height: 400px; >+ margin: 50px; >+ border: 1px solid black; >+ -webkit-perspective: 500px; >+ } >+ >+ .box { >+ position: absolute; >+ width: 200px; >+ height: 200px; >+ background-color: gray; >+ opacity: 0.75; >+ } >+ >+ #left { >+ -webkit-transform: rotateY(-75deg); >+ left: 20px; >+ top: 100px; >+ } >+ >+ #top { >+ -webkit-transform: rotateX(75deg); >+ top: 20px; >+ left: 100px; >+ } >+ >+ #right { >+ -webkit-transform: rotateY(75deg); >+ left: 180px; >+ top: 100px; >+ } >+ >+ #bottom { >+ -webkit-transform: rotateX(-75deg); >+ top: 180px; >+ left: 100px; >+ } >+ >+ .box:hover { >+ background-color: orange; >+ } >+ </style> >+ <script src="resources/hit-test-utils.js"></script> >+ <script> >+ const hitTestData = [ >+ { 'point': [170, 250], 'target' : 'left' }, >+ { 'point': [260, 170], 'target' : 'top' }, >+ { 'point': [330, 250], 'target' : 'right' }, >+ { 'point': [260, 330], 'target' : 'bottom' }, >+ { 'point': [60, 60], 'target' : 'container' }, >+ { 'point': [160, 160], 'target' : 'container' }, >+ { 'point': [190, 190], 'target' : 'container' }, >+ { 'point': [310, 310], 'target' : 'container' }, >+ ]; >+ window.addEventListener('load', runTest, false); >+ </script> >+</head> >+<body> >+ >+<div id="container"> >+ <div class="box" id="left"></div> >+ <div class="box" id="top"></div> >+ <div class="box" id="right"></div> >+ <div class="box" id="bottom"></div> >+</div> >+ >+<div id="results"></div> >+ >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
cmarrin
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 62797
:
97462
|
97464
|
106164
|
106170
|
112262
| 112275