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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutInline.cpp

Issue 2616483002: Reduce rectangle merges when doing region-based hit test on text boxes (Closed)
Patch Set: Improve test to be platform agnostic. Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutInline.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index 9528aeea9873e7fdc33fa200f3e28618b6f29ab2..4b1b406c97e6e0a0808e6fafd877eb10c29d79d0 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -876,12 +876,16 @@ class HitTestCulledInlinesGeneratorContext {
const HitTestLocation& location)
: m_intersected(false), m_region(region), m_location(location) {}
void operator()(const FloatRect& rect) {
- m_intersected = m_intersected || m_location.intersects(rect);
- m_region.unite(enclosingIntRect(rect));
+ if (m_location.intersects(rect)) {
+ m_intersected = true;
+ m_region.unite(enclosingIntRect(rect));
+ }
}
void operator()(const LayoutRect& rect) {
- m_intersected = m_intersected || m_location.intersects(rect);
- m_region.unite(enclosingIntRect(rect));
+ if (m_location.intersects(rect)) {
+ m_intersected = true;
+ m_region.unite(enclosingIntRect(rect));
+ }
}
bool intersected() const { return m_intersected; }
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698