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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2479663002: Move compositor InputHandler from RenderViewImpl to RenderWidget. (Closed)
Patch Set: Account for the fact that OOPIF subframes don't have an InnerViewportScrollLayer. 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
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index edf102efdb5e1ec07e1072c7d14b79e42cf6c9d1..708accf035eeb14c653a4ef4102a92454daee84d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -616,8 +616,21 @@ LayerTreeHostImpl::EventListenerTypeForTouchStartAt(
LayerImpl* layer_impl =
active_tree_->FindLayerThatIsHitByPointInTouchHandlerRegion(
device_viewport_point);
- if (layer_impl == NULL)
+ if (layer_impl == NULL) {
enne (OOO) 2017/01/18 01:41:53 I worry a bit about the side effects of always con
wjmaclean 2017/01/18 02:14:10 That's not quite what this CL is doing. The call t
enne (OOO) 2017/01/18 19:11:44 You say that the side effects aren't a worry becau
+ // At present, TouchHandlerRegions are only set for LayerTrees serving the
+ // document's mainframe, i.e. LayerTrees that have a ViewPort defined. But
+ // subframes can still have touch handlers, so here we err on the side of
+ // caution and report a handler even if we don't know which layer it's on.
+ EventListenerProperties properties =
+ active_tree_->event_listener_properties(
+ EventListenerClass::kTouchStartOrMove);
+ if ((properties == EventListenerProperties::kBlocking ||
+ properties == EventListenerProperties::kBlockingAndPassive) &&
+ !active_tree_->OuterViewportScrollLayer()) {
+ return InputHandler::TouchStartEventListenerType::HANDLER;
+ }
return InputHandler::TouchStartEventListenerType::NO_HANDLER;
+ }
if (!CurrentlyScrollingLayer())
return InputHandler::TouchStartEventListenerType::HANDLER;
@@ -2995,6 +3008,7 @@ void LayerTreeHostImpl::ApplyScroll(ScrollNode* scroll_node,
// we want to scroll the inner viewport -- to allow panning while zoomed --
// but also move browser controls if needed.
bool is_inner_viewport_scroll_layer =
+ InnerViewportScrollLayer() &&
scroll_node->owning_layer_id == InnerViewportScrollLayer()->id();
if (is_viewport_scroll_layer || is_inner_viewport_scroll_layer) {

Powered by Google App Engine
This is Rietveld 408576698