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

Unified Diff: trunk/Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 391483002: Revert 177812 "Migrate touch events to EventHandlerRegistry" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 5 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 | « trunk/Source/core/page/EventHandler.cpp ('k') | trunk/Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/page/scrolling/ScrollingCoordinator.cpp
===================================================================
--- trunk/Source/core/page/scrolling/ScrollingCoordinator.cpp (revision 177995)
+++ trunk/Source/core/page/scrolling/ScrollingCoordinator.cpp (working copy)
@@ -758,11 +758,12 @@
static void accumulateDocumentTouchEventTargetRects(LayerHitTestRects& rects, const Document* document)
{
ASSERT(document);
- const EventTargetSet* targets = document->frameHost()->eventHandlerRegistry().eventHandlerTargets(EventHandlerRegistry::TouchEvent);
- if (!targets)
+ if (!document->touchEventTargets())
return;
- // If there's a handler on the window, document, html or body element (fairly common in practice),
+ const TouchEventTargetSet* targets = document->touchEventTargets();
+
+ // If there's a handler on the document, html or body element (fairly common in practice),
// then we can quickly mark the entire document and skip looking at any other handlers.
// Note that technically a handler on the body doesn't cover the whole document, but it's
// reasonable to be conservative and report the whole document anyway.
@@ -771,10 +772,9 @@
// root cc::layer with the video layer so doing this optimization causes the compositor to think
// that there are no handlers, therefore skip it.
if (!document->renderView()->compositor()->inOverlayFullscreenVideo()) {
- for (EventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter) {
- EventTarget* target = iter->key;
- Node* node = target->toNode();
- if (target->toDOMWindow() || node == document || node == document->documentElement() || node == document->body()) {
+ for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter) {
+ Node* target = iter->key;
+ if (target == document || target == document->documentElement() || target == document->body()) {
if (RenderView* rendererView = document->renderView()) {
rendererView->computeLayerHitTestRects(rects);
}
@@ -783,19 +783,18 @@
}
}
- for (EventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter) {
- EventTarget* target = iter->key;
- Node* node = target->toNode();
- if (!node || !node->inDocument())
+ for (TouchEventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter) {
+ const Node* target = iter->key;
+ if (!target->inDocument())
continue;
- if (node->isDocumentNode() && node != document) {
- accumulateDocumentTouchEventTargetRects(rects, toDocument(node));
- } else if (RenderObject* renderer = node->renderer()) {
+ if (target->isDocumentNode() && target != document) {
+ accumulateDocumentTouchEventTargetRects(rects, toDocument(target));
+ } else if (RenderObject* renderer = target->renderer()) {
// If the set also contains one of our ancestor nodes then processing
// this node would be redundant.
bool hasTouchEventTargetAncestor = false;
- for (Node* ancestor = node->parentNode(); ancestor && !hasTouchEventTargetAncestor; ancestor = ancestor->parentNode()) {
+ for (Node* ancestor = target->parentNode(); ancestor && !hasTouchEventTargetAncestor; ancestor = ancestor->parentNode()) {
if (targets->contains(ancestor))
hasTouchEventTargetAncestor = true;
}
« no previous file with comments | « trunk/Source/core/page/EventHandler.cpp ('k') | trunk/Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698