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

Unified Diff: Source/core/rendering/RenderLayer.cpp

Issue 81153002: Fix hover area for divs with css transforms Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: adding layout test that fails with this approach. Created 7 years, 1 month 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
« no previous file with comments | « LayoutTests/transforms/3d/hit-testing/hover-rotated-with-children-negative-z-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 56c3a037b42130706c012b16a46797bc0057ff76..b04105ff7804f2bb99c9d54f563523385a0e8251 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -2729,8 +2729,14 @@ bool RenderLayer::isInTopLayerSubtree() const
static double computeZOffset(const HitTestingTransformState& transformState)
{
// We got an affine transform, so no z-offset
- if (transformState.m_accumulatedTransform.isAffine())
- return 0;
+ if (transformState.m_accumulatedTransform.isAffine()) {
+ // Non transformed layers are 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.
+ return -std::numeric_limits<int>::max();
+ }
// Flatten the point into the target plane
FloatPoint targetPoint = transformState.mappedPoint();
« no previous file with comments | « LayoutTests/transforms/3d/hit-testing/hover-rotated-with-children-negative-z-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698