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

Unified Diff: Source/core/layout/HitTestLocation.cpp

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
Index: Source/core/layout/HitTestLocation.cpp
diff --git a/Source/core/layout/HitTestLocation.cpp b/Source/core/layout/HitTestLocation.cpp
index fd37f2de430119602396189090ad599dcfc75ad1..65e66e13cc454d8723f4b37eb3e4a6f73b994fc1 100644
--- a/Source/core/layout/HitTestLocation.cpp
+++ b/Source/core/layout/HitTestLocation.cpp
@@ -122,7 +122,6 @@ bool HitTestLocation::intersectsRect(const RectType& rect, const RectType& bound
{
// FIXME: When the hit test is not rect based we should use rect.contains(m_point).
// That does change some corner case tests though.
-
// First check if rect even intersects our bounding box.
if (!rect.intersects(boundingBox))
return false;
@@ -141,11 +140,17 @@ bool HitTestLocation::intersectsRect(const RectType& rect, const RectType& bound
bool HitTestLocation::intersects(const LayoutRect& rect) const
{
+ if (!m_isRectBased)
+ return rect.contains(m_point);
+
return intersectsRect(rect, LayoutRect(m_boundingBox));
}
bool HitTestLocation::intersects(const FloatRect& rect) const
{
+ if (!m_isRectBased)
+ return rect.contains(FloatPoint(m_point));
+
return intersectsRect(rect, FloatRect(m_boundingBox));
}

Powered by Google App Engine
This is Rietveld 408576698