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

Unified Diff: sky/engine/core/rendering/RenderLayer.cpp

Issue 791933004: Fix hit-testing (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebased Created 6 years 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 | « no previous file | sky/tests/layout/document-elementFromPoint.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderLayer.cpp
diff --git a/sky/engine/core/rendering/RenderLayer.cpp b/sky/engine/core/rendering/RenderLayer.cpp
index 4a2072f0435e2d83e6e06f9a138a5f0c2b89cb8d..640076b6cd2eee079ffba659c73ebbe6a38d42fd 100644
--- a/sky/engine/core/rendering/RenderLayer.cpp
+++ b/sky/engine/core/rendering/RenderLayer.cpp
@@ -1511,7 +1511,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
clipper().calculateRects(clipRectsContext, hitTestRect, layerBounds, backgroundRect, foregroundRect, outlineRect);
// Next we want to see if the mouse pos is inside the child RenderObjects of the layer.
- if (isSelfPaintingLayer() && !foregroundRect.intersects(hitTestLocation)) {
+ if (isSelfPaintingLayer() && foregroundRect.intersects(hitTestLocation)) {
// Hit test with a temporary HitTestResult, because we only want to commit to 'result' if we know we're frontmost.
HitTestResult tempResult(result.hitTestLocation());
if (hitTestContents(request, tempResult, layerBounds, hitTestLocation, HitTestDescendants)
@@ -1542,7 +1542,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont
if (candidateLayer)
return candidateLayer;
- if (isSelfPaintingLayer() && !backgroundRect.intersects(hitTestLocation)) {
+ if (isSelfPaintingLayer() && backgroundRect.intersects(hitTestLocation)) {
HitTestResult tempResult(result.hitTestLocation());
if (hitTestContents(request, tempResult, layerBounds, hitTestLocation, HitTestSelf)
&& isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) {
« no previous file with comments | « no previous file | sky/tests/layout/document-elementFromPoint.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698