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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2069713002: Make all gesture scrolls use customization path internally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + Fix test Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 #include "core/loader/ImageLoader.h" 188 #include "core/loader/ImageLoader.h"
189 #include "core/loader/NavigationScheduler.h" 189 #include "core/loader/NavigationScheduler.h"
190 #include "core/loader/appcache/ApplicationCacheHost.h" 190 #include "core/loader/appcache/ApplicationCacheHost.h"
191 #include "core/page/ChromeClient.h" 191 #include "core/page/ChromeClient.h"
192 #include "core/page/EventWithHitTestResults.h" 192 #include "core/page/EventWithHitTestResults.h"
193 #include "core/page/FocusController.h" 193 #include "core/page/FocusController.h"
194 #include "core/page/FrameTree.h" 194 #include "core/page/FrameTree.h"
195 #include "core/page/Page.h" 195 #include "core/page/Page.h"
196 #include "core/page/PointerLockController.h" 196 #include "core/page/PointerLockController.h"
197 #include "core/page/scrolling/RootScrollerController.h" 197 #include "core/page/scrolling/RootScrollerController.h"
198 #include "core/page/scrolling/ScrollStateCallback.h"
198 #include "core/page/scrolling/ScrollingCoordinator.h" 199 #include "core/page/scrolling/ScrollingCoordinator.h"
199 #include "core/page/scrolling/SnapCoordinator.h" 200 #include "core/page/scrolling/SnapCoordinator.h"
200 #include "core/page/scrolling/ViewportScrollCallback.h" 201 #include "core/page/scrolling/ViewportScrollCallback.h"
201 #include "core/svg/SVGDocumentExtensions.h" 202 #include "core/svg/SVGDocumentExtensions.h"
202 #include "core/svg/SVGScriptElement.h" 203 #include "core/svg/SVGScriptElement.h"
203 #include "core/svg/SVGTitleElement.h" 204 #include "core/svg/SVGTitleElement.h"
204 #include "core/svg/SVGUseElement.h" 205 #include "core/svg/SVGUseElement.h"
205 #include "core/timing/DOMWindowPerformance.h" 206 #include "core/timing/DOMWindowPerformance.h"
206 #include "core/timing/Performance.h" 207 #include "core/timing/Performance.h"
207 #include "core/workers/SharedWorkerRepositoryClient.h" 208 #include "core/workers/SharedWorkerRepositoryClient.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); 455 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this);
455 } else if (m_importsController) { 456 } else if (m_importsController) {
456 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr, this); 457 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr, this);
457 } else { 458 } else {
458 m_fetcher = ResourceFetcher::create(nullptr); 459 m_fetcher = ResourceFetcher::create(nullptr);
459 } 460 }
460 461
461 ViewportScrollCallback* applyScroll = nullptr; 462 ViewportScrollCallback* applyScroll = nullptr;
462 if (isInMainFrame()) { 463 if (isInMainFrame()) {
463 applyScroll = RootScrollerController::createViewportApplyScroll( 464 applyScroll = RootScrollerController::createViewportApplyScroll(
464 frameHost()->topControls(), frameHost()->overscrollController()); 465 &frameHost()->topControls(), &frameHost()->overscrollController());
466 } else {
467 applyScroll =
468 RootScrollerController::createViewportApplyScroll(nullptr, nullptr);
465 } 469 }
470
466 m_rootScrollerController = 471 m_rootScrollerController =
467 RootScrollerController::create(*this, applyScroll); 472 RootScrollerController::create(*this, applyScroll);
468 473
469 // We depend on the url getting immediately set in subframes, but we 474 // We depend on the url getting immediately set in subframes, but we
470 // also depend on the url NOT getting immediately set in opened windows. 475 // also depend on the url NOT getting immediately set in opened windows.
471 // See fast/dom/early-frame-url.html 476 // See fast/dom/early-frame-url.html
472 // and fast/dom/location-new-window-no-crash.html, respectively. 477 // and fast/dom/location-new-window-no-crash.html, respectively.
473 // FIXME: Can/should we unify this behavior? 478 // FIXME: Can/should we unify this behavior?
474 if (initializer.shouldSetURL()) 479 if (initializer.shouldSetURL())
475 setURL(initializer.url()); 480 setURL(initializer.url());
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 void Document::setRootScroller(Element* newScroller, ExceptionState& exceptionSt ate) 597 void Document::setRootScroller(Element* newScroller, ExceptionState& exceptionSt ate)
593 { 598 {
594 m_rootScrollerController->set(newScroller); 599 m_rootScrollerController->set(newScroller);
595 } 600 }
596 601
597 Element* Document::rootScroller() const 602 Element* Document::rootScroller() const
598 { 603 {
599 return m_rootScrollerController->get(); 604 return m_rootScrollerController->get();
600 } 605 }
601 606
602 bool Document::isEffectiveRootScroller(const Element& element) const 607 const Element* Document::effectiveRootScroller() const
603 { 608 {
604 return m_rootScrollerController->effectiveRootScroller() == element; 609 return m_rootScrollerController->effectiveRootScroller();
610 }
611
612 bool Document::isViewportScrollCallback(const ScrollStateCallback* callback)
613 {
614 if (!callback)
615 return false;
616
617 return callback == m_rootScrollerController->viewportScrollCallback();
605 } 618 }
606 619
607 bool Document::isInMainFrame() const 620 bool Document::isInMainFrame() const
608 { 621 {
609 return frame() && frame()->isMainFrame(); 622 return frame() && frame()->isMainFrame();
610 } 623 }
611 624
612 AtomicString Document::convertLocalName(const AtomicString& name) 625 AtomicString Document::convertLocalName(const AtomicString& name)
613 { 626 {
614 return isHTMLDocument() ? name.lower() : name; 627 return isHTMLDocument() ? name.lower() : name;
(...skipping 5394 matching lines...) Expand 10 before | Expand all | Expand 10 after
6009 } 6022 }
6010 6023
6011 void showLiveDocumentInstances() 6024 void showLiveDocumentInstances()
6012 { 6025 {
6013 WeakDocumentSet& set = liveDocumentSet(); 6026 WeakDocumentSet& set = liveDocumentSet();
6014 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6027 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6015 for (Document* document : set) 6028 for (Document* document : set)
6016 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6029 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6017 } 6030 }
6018 #endif 6031 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698