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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1913843004: Implementing document.setRootScroller API for main thread scrolling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@overscrollController
Patch Set: Rebase and remove whitespace in Document.idl Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after
2498 } 2498 }
2499 2499
2500 bool EventHandler::isRootScroller(const Node& node) const 2500 bool EventHandler::isRootScroller(const Node& node) const
2501 { 2501 {
2502 // The root scroller is the one Element on the page designated to perform 2502 // The root scroller is the one Element on the page designated to perform
2503 // "viewport actions" like top controls movement and overscroll glow. 2503 // "viewport actions" like top controls movement and overscroll glow.
2504 2504
2505 if (!node.isElementNode() || node.document().ownerElement()) 2505 if (!node.isElementNode() || node.document().ownerElement())
2506 return false; 2506 return false;
2507 2507
2508 Element* scrollingElement = node.document().scrollingElement(); 2508 return node.document().rootScroller() == toElement(&node);
2509 return scrollingElement
2510 ? toElement(&node) == node.document().scrollingElement()
2511 : toElement(&node) == node.document().documentElement();
2512 } 2509 }
2513 2510
2514 WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestur eEvent& gestureEvent) 2511 WebInputEventResult EventHandler::handleGestureScrollUpdate(const PlatformGestur eEvent& gestureEvent)
2515 { 2512 {
2516 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate); 2513 ASSERT(gestureEvent.type() == PlatformEvent::GestureScrollUpdate);
2517 2514
2518 // Negate the deltas since the gesture event stores finger movement and 2515 // Negate the deltas since the gesture event stores finger movement and
2519 // scrolling occurs in the direction opposite the finger's movement 2516 // scrolling occurs in the direction opposite the finger's movement
2520 // direction. e.g. Finger moving up has negative event delta but causes the 2517 // direction. e.g. Finger moving up has negative event delta but causes the
2521 // page to scroll down causing positive scroll delta. 2518 // page to scroll down causing positive scroll delta.
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after
4148 4145
4149 FrameHost* EventHandler::frameHost() 4146 FrameHost* EventHandler::frameHost()
4150 { 4147 {
4151 if (!m_frame->page()) 4148 if (!m_frame->page())
4152 return nullptr; 4149 return nullptr;
4153 4150
4154 return &m_frame->page()->frameHost(); 4151 return &m_frame->page()->frameHost();
4155 } 4152 }
4156 4153
4157 } // namespace blink 4154 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698