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

Unified Diff: Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

Issue 11753015: Merge 138717 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 12 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 | « LayoutTests/platform/chromium/fast/events/touch/compositor-touch-hit-rects.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
===================================================================
--- Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (revision 138737)
+++ Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (working copy)
@@ -179,15 +179,20 @@
}
#if ENABLE(TOUCH_EVENT_TRACKING)
-static void accumulateRendererTouchEventTargetRects(Vector<IntRect>& rects, const RenderObject* renderer)
+static void accumulateRendererTouchEventTargetRects(Vector<IntRect>& rects, const RenderObject* renderer, const IntRect& parentRect = IntRect())
{
- // FIXME: This method is O(N^2) as it walks the tree to the root for every renderer. RenderGeometryMap would fix this.
- rects.append(enclosingIntRect(renderer->clippedOverflowRectForRepaint(0)));
- if (renderer->isRenderBlock()) {
- const RenderBlock* block = toRenderBlock(renderer);
- for (RenderObject* child = block->firstChild(); child; child = child->nextSibling())
- accumulateRendererTouchEventTargetRects(rects, child);
+ IntRect adjustedParentRect = parentRect;
+ if (parentRect.isEmpty() || renderer->isFloating() || renderer->isPositioned() || renderer->hasTransform()) {
+ // FIXME: This method is O(N^2) as it walks the tree to the root for every renderer. RenderGeometryMap would fix this.
+ IntRect r = enclosingIntRect(renderer->clippedOverflowRectForRepaint(0));
+ if (!r.isEmpty() && !parentRect.contains(r)) {
+ rects.append(r);
+ adjustedParentRect = r;
+ }
}
+
+ for (RenderObject* child = renderer->firstChild(); child; child = child->nextSibling())
+ accumulateRendererTouchEventTargetRects(rects, child, adjustedParentRect);
}
static void accumulateDocumentEventTargetRects(Vector<IntRect>& rects, const Document* document)
@@ -203,8 +208,11 @@
continue;
if (touchTarget == document) {
- if (RenderView* view = document->renderView())
- rects.append(enclosingIntRect(view->clippedOverflowRectForRepaint(0)));
+ if (RenderView* view = document->renderView()) {
+ IntRect r = enclosingIntRect(view->clippedOverflowRectForRepaint(0));
+ if (!r.isEmpty())
+ rects.append(r);
+ }
return;
}
« no previous file with comments | « LayoutTests/platform/chromium/fast/events/touch/compositor-touch-hit-rects.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698