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

Unified Diff: third_party/WebKit/Source/core/layout/HitTestResult.h

Issue 1630793002: Stop hit testing culled inlines when a match is found (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simpler approach, but duplicated code Created 4 years, 11 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: third_party/WebKit/Source/core/layout/HitTestResult.h
diff --git a/third_party/WebKit/Source/core/layout/HitTestResult.h b/third_party/WebKit/Source/core/layout/HitTestResult.h
index 156f2fda6e0bf6c983b3c989ea2d1ff5018c9ea8..ebae7fde9710a1a938cf64cf1210be752f82ae18 100644
--- a/third_party/WebKit/Source/core/layout/HitTestResult.h
+++ b/third_party/WebKit/Source/core/layout/HitTestResult.h
@@ -28,7 +28,6 @@
#include "core/layout/HitTestRequest.h"
#include "platform/geometry/FloatQuad.h"
#include "platform/geometry/FloatRect.h"
-#include "platform/geometry/LayoutRect.h"
#include "platform/heap/Handle.h"
#include "platform/text/TextDirection.h"
#include "wtf/Forward.h"
@@ -47,11 +46,19 @@ class Image;
class KURL;
class Node;
class LayoutObject;
+class Region;
class Scrollbar;
+// List-based hit test testing can continue even after a hit has been found.
+// This is used to support fuzzy matching with rect-based hit tests as well as
+// penetrating tests which collect all nodes (see: HitTestRequest::RequestType).
+enum ListBasedHitTestBehavior {
+ ContinueHitTesting,
+ StopHitTesting
+};
+
class CORE_EXPORT HitTestResult {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
-
public:
typedef WillBeHeapListHashSet<RefPtrWillBeMember<Node>> NodeSet;
@@ -137,8 +144,13 @@ public:
bool isCacheable() const { return m_cacheable; }
void setCacheable(bool cacheable) { m_cacheable = cacheable; }
- // Return true if the test is a list-based test and we should continue testing.
- bool addNodeToListBasedTestResult(Node*, const HitTestLocation& pointInContainer, const LayoutRect& = LayoutRect());
+ // TODO(pdr): When using the default rect argument, this function does not
+ // check if the tapped area is entirely contained by the HitTestLocation's
+ // bounding box. Callers should pass a LayoutRect as the third parameter so
+ // hit testing can early-out when a tapped area is covered.
+ ListBasedHitTestBehavior addNodeToListBasedTestResult(Node*, const HitTestLocation&, const LayoutRect& = LayoutRect());
+ ListBasedHitTestBehavior addNodeToListBasedTestResult(Node*, const HitTestLocation&, const Region&);
+
void append(const HitTestResult&);
// If m_listBasedTestResult is 0 then set it to a new NodeSet. Return *m_listBasedTestResult. Lazy allocation makes

Powered by Google App Engine
This is Rietveld 408576698