Fix hit testing for divs with a hierarchy of css transformed and non-transformed...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Dec 2013 10:43:52 +0000 (10:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Dec 2013 10:43:52 +0000 (10:43 +0000)
commitff5b5049badeec9ed3bed31da8317137139e444b
tree07c19bd508071806694c010946f2a2f1de3593e3
parentf64999552143d4ef9d1397eb508332299f73b924
Fix hit testing for divs with a hierarchy of css transformed and non-transformed elements
https://bugs.webkit.org/show_bug.cgi?id=124777

Patch by Mihai Maerean <mmaerean@adobe.com> on 2013-12-17
Reviewed by Darin Adler.

Source/WebCore:

After bug #124647, the hit test will still behave incorrectly for transformed divs with non
transformed siblings that are all inside a transformed element (tested by the
hover-rotated-with-children-negative-z.html layout test).

The fix is to not take zOffset into account during hit-testing when child layers are in the
same 3D rendering context. Only when preserve3d is true, should hit-testing compute the
zOffset of the layers with transformations and, when two layers overlap, to return the layer
with the highest zOffset.

The patch includes the work of a.renevier from https://codereview.chromium.org/79943002/

Tests: transforms/3d/hit-testing/hover-rotated-with-children-negative-z.html
       transforms/3d/hit-testing/negative-zoffset-hit-test.html
       transforms/3d/hit-testing/overlapping-layers-hit-test.html

* rendering/RenderLayer.cpp:
(WebCore::computeZOffset):
(WebCore::RenderLayer::hitTestLayer):

LayoutTests:

* transforms/3d/hit-testing/hover-rotated-with-children-negative-z.html: Added.
* transforms/3d/hit-testing/hover-rotated-with-children-negative-z-expected.txt: Added.
* transforms/3d/hit-testing/negative-zoffset-hit-test.html: Added.
* transforms/3d/hit-testing/negative-zoffset-hit-test-expected.txt: Added.
* transforms/3d/hit-testing/overlapping-layers-hit-test.html: Added.
* transforms/3d/hit-testing/overlapping-layers-hit-test-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/transforms/3d/hit-testing/hover-rotated-with-children-negative-z-expected.txt [new file with mode: 0644]
LayoutTests/transforms/3d/hit-testing/hover-rotated-with-children-negative-z.html [new file with mode: 0644]
LayoutTests/transforms/3d/hit-testing/negative-zoffset-hit-test-expected.txt [new file with mode: 0644]
LayoutTests/transforms/3d/hit-testing/negative-zoffset-hit-test.html [new file with mode: 0644]
LayoutTests/transforms/3d/hit-testing/overlapping-layers-hit-test-expected.txt [new file with mode: 0644]
LayoutTests/transforms/3d/hit-testing/overlapping-layers-hit-test.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp