| OLD | NEW |
| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 provideContextFeaturesToDocumentFrom(*this, *m_frame->page()); | 454 provideContextFeaturesToDocumentFrom(*this, *m_frame->page()); |
| 455 | 455 |
| 456 m_fetcher = m_frame->loader().documentLoader()->fetcher(); | 456 m_fetcher = m_frame->loader().documentLoader()->fetcher(); |
| 457 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); | 457 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); |
| 458 } else if (m_importsController) { | 458 } else if (m_importsController) { |
| 459 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr, this); | 459 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr, this); |
| 460 } else { | 460 } else { |
| 461 m_fetcher = ResourceFetcher::create(nullptr); | 461 m_fetcher = ResourceFetcher::create(nullptr); |
| 462 } | 462 } |
| 463 | 463 |
| 464 ViewportScrollCallback* applyScroll = nullptr; | 464 m_rootScrollerController = RootScrollerController::create(*this); |
| 465 if (isInMainFrame()) { | |
| 466 applyScroll = RootViewportScrollCallback::create( | |
| 467 &frameHost()->topControls(), &frameHost()->overscrollController()); | |
| 468 } else { | |
| 469 applyScroll = | |
| 470 ChildViewportScrollCallback::create(); | |
| 471 } | |
| 472 | |
| 473 m_rootScrollerController = | |
| 474 RootScrollerController::create(*this, applyScroll); | |
| 475 | 465 |
| 476 // We depend on the url getting immediately set in subframes, but we | 466 // We depend on the url getting immediately set in subframes, but we |
| 477 // also depend on the url NOT getting immediately set in opened windows. | 467 // also depend on the url NOT getting immediately set in opened windows. |
| 478 // See fast/dom/early-frame-url.html | 468 // See fast/dom/early-frame-url.html |
| 479 // and fast/dom/location-new-window-no-crash.html, respectively. | 469 // and fast/dom/location-new-window-no-crash.html, respectively. |
| 480 // FIXME: Can/should we unify this behavior? | 470 // FIXME: Can/should we unify this behavior? |
| 481 if (initializer.shouldSetURL()) | 471 if (initializer.shouldSetURL()) |
| 482 setURL(initializer.url()); | 472 setURL(initializer.url()); |
| 483 | 473 |
| 484 initSecurityContext(initializer); | 474 initSecurityContext(initializer); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 // frames when there's only a <head>, but such documents are pretty rare. | 584 // frames when there's only a <head>, but such documents are pretty rare. |
| 595 if (m_documentElement && !isHTMLDocument()) | 585 if (m_documentElement && !isHTMLDocument()) |
| 596 beginLifecycleUpdatesIfRenderingReady(); | 586 beginLifecycleUpdatesIfRenderingReady(); |
| 597 } | 587 } |
| 598 | 588 |
| 599 void Document::setRootScroller(Element* newScroller, ExceptionState& exceptionSt
ate) | 589 void Document::setRootScroller(Element* newScroller, ExceptionState& exceptionSt
ate) |
| 600 { | 590 { |
| 601 m_rootScrollerController->set(newScroller); | 591 m_rootScrollerController->set(newScroller); |
| 602 } | 592 } |
| 603 | 593 |
| 594 void Document::initializeRootScroller(ViewportScrollCallback* callback) |
| 595 { |
| 596 m_rootScrollerController->setViewportScrollCallback(callback); |
| 597 } |
| 598 |
| 604 Element* Document::rootScroller() const | 599 Element* Document::rootScroller() const |
| 605 { | 600 { |
| 606 return m_rootScrollerController->get(); | 601 return m_rootScrollerController->get(); |
| 607 } | 602 } |
| 608 | 603 |
| 609 const Element* Document::effectiveRootScroller() const | 604 const Element* Document::effectiveRootScroller() const |
| 610 { | 605 { |
| 611 return m_rootScrollerController->effectiveRootScroller(); | 606 return m_rootScrollerController->effectiveRootScroller(); |
| 612 } | 607 } |
| 613 | 608 |
| (...skipping 5420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6034 } | 6029 } |
| 6035 | 6030 |
| 6036 void showLiveDocumentInstances() | 6031 void showLiveDocumentInstances() |
| 6037 { | 6032 { |
| 6038 WeakDocumentSet& set = liveDocumentSet(); | 6033 WeakDocumentSet& set = liveDocumentSet(); |
| 6039 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6034 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6040 for (Document* document : set) | 6035 for (Document* document : set) |
| 6041 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); | 6036 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); |
| 6042 } | 6037 } |
| 6043 #endif | 6038 #endif |
| OLD | NEW |