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

Issue 81153002: Fix hover area for divs with css transforms

Created:
7 years, 1 month ago by Mihai Maerean
Modified:
7 years, 1 month ago
CC:
blink-reviews, bemjb+rendering_chromium.org, zoltan1, eae+blinkwatch, leviw+renderwatch, blink-layers+watch_chromium.org, jchaffraix+rendering
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Fix hover area for divs with css transforms The problem is that a rotated div doesn't trigger the :hover state (or the onclick javascript handler) when the Z coordinate is negative at the location of the mouse. Non transformed layers are now being hit last, not through or in-between transformed layers. The paint order says that the divs creating stacking contexts (including transforms) are painted after the other siblings so they should be hit tested in the reverse order. Also, a rotated div in a non-rotated parent should be hit in its entire area, not hit its parent's background, even if the z-coordinate is negative where the mouse is located. BUG=321959

Patch Set 1 #

Total comments: 1

Patch Set 2 : adding layout test that fails with this approach. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -2 lines) Patch
A LayoutTests/transforms/3d/hit-testing/hover-rotated-negative-z.html View 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/transforms/3d/hit-testing/hover-rotated-negative-z-expected.txt View 1 chunk +8 lines, -0 lines 0 comments Download
A LayoutTests/transforms/3d/hit-testing/hover-rotated-with-children-negative-z.html View 1 1 chunk +66 lines, -0 lines 0 comments Download
A LayoutTests/transforms/3d/hit-testing/hover-rotated-with-children-negative-z-expected.txt View 1 1 chunk +13 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderLayer.cpp View 1 chunk +8 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Mihai Maerean
Please review changes
7 years, 1 month ago (2013-11-21 16:21:21 UTC) #1
eae
https://codereview.chromium.org/81153002/diff/1/Source/core/rendering/RenderLayer.cpp File Source/core/rendering/RenderLayer.cpp (right): https://codereview.chromium.org/81153002/diff/1/Source/core/rendering/RenderLayer.cpp#newcode2738 Source/core/rendering/RenderLayer.cpp:2738: return -std::numeric_limits<int>::max(); Shouldn't this be std::numeric_limits<int>::min() or LayoutUnit::min()?
7 years, 1 month ago (2013-11-21 19:36:46 UTC) #2
shawnsingh
Mihai - can you please check if the problems you are seeing are fixed by ...
7 years, 1 month ago (2013-11-21 20:47:39 UTC) #3
Mihai Maerean
On 2013/11/21 20:47:39, shawnsingh wrote: > Mihai - can you please check if the problems ...
7 years, 1 month ago (2013-11-21 21:48:59 UTC) #4
Mihai Maerean
7 years, 1 month ago (2013-11-22 16:20:23 UTC) #5
I have added a layout test that fails with this approach.
It happens with this DOM tree:
<div id="parent">
	<div id="transformed">transformed
		<div id="child1">child 1</div>
		<div id="nonTransformedChild">non transformed child</div>
		<div id="child2">child 2</div>
	</div>
</div>

child1 and child2 are transformed and rendered on top of the
nonTransformedChild, but the hit testing doesn't hit the layers that are on top
(child1 & child2).

This new layout test (hover-rotated-with-children-negative-z.html) should be
added to the other patch (at https://codereview.chromium.org/79943002/)

Powered by Google App Engine
This is Rietveld 408576698