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

Unified Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove validity rect as per Elliott's request Created 5 years, 6 months 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 | « Source/core/layout/LayoutView.cpp ('k') | Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index 7bfe447d7838fa4c8164ef98652e2532612b2982..071e55c5c9152cec9febd3bec566eceef9121af1 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -1580,17 +1580,15 @@ static inline LayoutRect frameVisibleRect(LayoutObject* layoutObject)
bool DeprecatedPaintLayer::hitTest(HitTestResult& result)
{
- return hitTest(result.hitTestRequest(), result.hitTestLocation(), result);
-}
-
-bool DeprecatedPaintLayer::hitTest(const HitTestRequest& request, const HitTestLocation& hitTestLocation, HitTestResult& result)
-{
ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant());
// LayoutView should make sure to update layout before entering hit testing
ASSERT(!layoutObject()->frame()->view()->layoutPending());
ASSERT(!layoutObject()->document().layoutView()->needsLayout());
+ const HitTestRequest& request = result.hitTestRequest();
+ const HitTestLocation& hitTestLocation = result.hitTestLocation();
+
// Start with frameVisibleRect to ensure we include the scrollbars.
LayoutRect hitTestArea = frameVisibleRect(layoutObject());
if (request.ignoreClipping())
@@ -1607,6 +1605,9 @@ bool DeprecatedPaintLayer::hitTest(const HitTestRequest& request, const HitTestL
if (!request.isChildFrameHitTest() && ((request.active() || request.release()) || (request.move() && hitTestArea.contains(hitPoint.x(), hitPoint.y()))) && isRootLayer()) {
layoutObject()->updateHitTestResult(result, toLayoutView(layoutObject())->flipForWritingMode(hitTestLocation.point()));
insideLayer = this;
+
+ // Don't cache this result since it really wasn't a true hit.
+ result.setCacheable(false);
}
}
« no previous file with comments | « Source/core/layout/LayoutView.cpp ('k') | Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698