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

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

Issue 1142283004: Implement a Hit Test Cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix git cl format mangling 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/HitTestResult.cpp
diff --git a/Source/core/layout/HitTestResult.cpp b/Source/core/layout/HitTestResult.cpp
index 526b62251bedabe4ade35baa441731b865cd72f8..cc5c22bf32775b652327aa7ff02075221058f886 100644
--- a/Source/core/layout/HitTestResult.cpp
+++ b/Source/core/layout/HitTestResult.cpp
@@ -108,6 +108,7 @@ HitTestResult& HitTestResult::operator=(const HitTestResult& other)
m_innerURLElement = other.URLElement();
m_scrollbar = other.scrollbar();
m_isOverWidget = other.isOverWidget();
+ m_validityRect = other.m_validityRect;
// Only copy the NodeSet in case of list hit test.
m_listBasedTestResult = adoptPtrWillBeNoop(other.m_listBasedTestResult ? new NodeSet(*other.m_listBasedTestResult) : 0);
@@ -115,6 +116,24 @@ HitTestResult& HitTestResult::operator=(const HitTestResult& other)
return *this;
}
+bool HitTestResult::equalForCacheability(const HitTestResult& other) const
+{
+ return m_hitTestRequest.equalForCacheability(other.m_hitTestRequest)
+ && m_innerNode == other.innerNode()
+ && m_innerPossiblyPseudoNode == other.innerPossiblyPseudoNode()
+ && m_pointInInnerNodeFrame == other.m_pointInInnerNodeFrame
+ && m_localPoint == other.localPoint()
+ && m_innerURLElement == other.URLElement()
+ && m_scrollbar == other.scrollbar()
+ && m_isOverWidget == other.isOverWidget();
+}
+
+void HitTestResult::cacheValues(const HitTestResult& other)
+{
+ *this = other;
+ m_hitTestRequest = other.m_hitTestRequest.type() & ~HitTestRequest::AvoidCache;
+}
+
DEFINE_TRACE(HitTestResult)
{
visitor->trace(m_innerNode);
@@ -219,6 +238,12 @@ bool HitTestResult::isSelected() const
return false;
}
+void HitTestResult::setValidityRect(const LayoutRect& rect)
+{
+ ASSERT(!rect.isEmpty());
+ m_validityRect = rect;
+}
+
String HitTestResult::spellingToolTip(TextDirection& dir) const
{
dir = LTR;

Powered by Google App Engine
This is Rietveld 408576698