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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 1506053003: Include clip-path and border radius when hit testing boxes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Hit test in PaintLayer, add transformed clip path tests Created 5 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 | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 652637c5705bbe9e55567e01c366cc75648a5402..ff517752a44baf35333295252c5b06a374030999 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -1650,7 +1650,7 @@ PaintLayer* PaintLayer::hitTestLayer(PaintLayer* rootLayer, PaintLayer* containe
ASSERT(layoutObject()->document().lifecycle().state() >= DocumentLifecycle::CompositingClean);
if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant())
- return 0;
+ return nullptr;
ClipRectsCacheSlot clipRectsCacheSlot = result.hitTestRequest().ignoreClipping() ? RootRelativeClipRectsIgnoringViewportClip : RootRelativeClipRects;
@@ -1664,12 +1664,20 @@ PaintLayer* PaintLayer::hitTestLayer(PaintLayer* rootLayer, PaintLayer* containe
ClipRect clipRect = clipper().backgroundClipRect(ClipRectsContext(rootLayer, clipRectsCacheSlot, IncludeOverlayScrollbarSize));
// Go ahead and test the enclosing clip now.
if (!clipRect.intersects(hitTestLocation))
- return 0;
+ return nullptr;
}
return hitTestLayerByApplyingTransform(rootLayer, containerLayer, result, hitTestRect, hitTestLocation, transformState, zOffset);
}
+ if (layoutObject()->hasClipPath()) {
+ ASSERT(layoutObject()->isBox() && isSelfPaintingLayer());
+ LayoutPoint offsetToRootLayer;
+ convertToLayerCoords(rootLayer, offsetToRootLayer);
+ if (toLayoutBox(layoutObject())->hitTestClippedOutByClipPath(hitTestLocation.point(), offsetToRootLayer))
+ return nullptr;
+ }
+
// Ensure our lists and 3d status are up-to-date.
m_stackingNode->updateLayerListsIfNeeded();
update3DTransformedDescendantStatus();
@@ -1690,7 +1698,7 @@ PaintLayer* PaintLayer::hitTestLayer(PaintLayer* rootLayer, PaintLayer* containe
TransformationMatrix invertedMatrix = localTransformState->m_accumulatedTransform.inverse();
// If the z-vector of the matrix is negative, the back is facing towards the viewer.
if (invertedMatrix.m33() < 0)
- return 0;
+ return nullptr;
}
RefPtr<HitTestingTransformState> unflattenedTransformState = localTransformState;
@@ -1801,7 +1809,7 @@ PaintLayer* PaintLayer::hitTestLayer(PaintLayer* rootLayer, PaintLayer* containe
result.append(tempResult);
}
- return 0;
+ return nullptr;
}
bool PaintLayer::hitTestContentsForFragments(const PaintLayerFragments& layerFragments, HitTestResult& result,
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698