| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 #include "core/loader/FrameLoaderClient.h" | 187 #include "core/loader/FrameLoaderClient.h" |
| 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/RootScroller.h" | 197 #include "core/page/scrolling/RootScrollerController.h" |
| 198 #include "core/page/scrolling/ScrollingCoordinator.h" | 198 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 199 #include "core/page/scrolling/SnapCoordinator.h" | 199 #include "core/page/scrolling/SnapCoordinator.h" |
| 200 #include "core/page/scrolling/ViewportScrollCallback.h" | 200 #include "core/page/scrolling/ViewportScrollCallback.h" |
| 201 #include "core/svg/SVGDocumentExtensions.h" | 201 #include "core/svg/SVGDocumentExtensions.h" |
| 202 #include "core/svg/SVGScriptElement.h" | 202 #include "core/svg/SVGScriptElement.h" |
| 203 #include "core/svg/SVGTitleElement.h" | 203 #include "core/svg/SVGTitleElement.h" |
| 204 #include "core/svg/SVGUseElement.h" | 204 #include "core/svg/SVGUseElement.h" |
| 205 #include "core/timing/DOMWindowPerformance.h" | 205 #include "core/timing/DOMWindowPerformance.h" |
| 206 #include "core/timing/Performance.h" | 206 #include "core/timing/Performance.h" |
| 207 #include "core/workers/SharedWorkerRepositoryClient.h" | 207 #include "core/workers/SharedWorkerRepositoryClient.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 m_fetcher = m_frame->loader().documentLoader()->fetcher(); | 475 m_fetcher = m_frame->loader().documentLoader()->fetcher(); |
| 476 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); | 476 FrameFetchContext::provideDocumentToContext(m_fetcher->context(), this); |
| 477 } else if (m_importsController) { | 477 } else if (m_importsController) { |
| 478 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr, this); | 478 m_fetcher = FrameFetchContext::createContextAndFetcher(nullptr, this); |
| 479 } else { | 479 } else { |
| 480 m_fetcher = ResourceFetcher::create(nullptr); | 480 m_fetcher = ResourceFetcher::create(nullptr); |
| 481 } | 481 } |
| 482 | 482 |
| 483 ViewportScrollCallback* applyScroll = nullptr; | 483 ViewportScrollCallback* applyScroll = nullptr; |
| 484 if (isInMainFrame()) { | 484 if (isInMainFrame()) { |
| 485 applyScroll = RootScroller::createViewportApplyScroll( | 485 applyScroll = RootScrollerController::createViewportApplyScroll( |
| 486 frameHost()->topControls(), frameHost()->overscrollController()); | 486 frameHost()->topControls(), frameHost()->overscrollController()); |
| 487 } | 487 } |
| 488 m_rootScroller = RootScroller::create(*this, applyScroll); | 488 m_rootScrollerController = |
| 489 RootScrollerController::create(*this, applyScroll); |
| 489 | 490 |
| 490 // We depend on the url getting immediately set in subframes, but we | 491 // We depend on the url getting immediately set in subframes, but we |
| 491 // also depend on the url NOT getting immediately set in opened windows. | 492 // also depend on the url NOT getting immediately set in opened windows. |
| 492 // See fast/dom/early-frame-url.html | 493 // See fast/dom/early-frame-url.html |
| 493 // and fast/dom/location-new-window-no-crash.html, respectively. | 494 // and fast/dom/location-new-window-no-crash.html, respectively. |
| 494 // FIXME: Can/should we unify this behavior? | 495 // FIXME: Can/should we unify this behavior? |
| 495 if (initializer.shouldSetURL()) | 496 if (initializer.shouldSetURL()) |
| 496 setURL(initializer.url()); | 497 setURL(initializer.url()); |
| 497 | 498 |
| 498 initSecurityContext(initializer); | 499 initSecurityContext(initializer); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 // so we resume as soon as we have a document element. Even for XHTML | 604 // so we resume as soon as we have a document element. Even for XHTML |
| 604 // documents there may never be a <body> (since the parser won't always | 605 // documents there may never be a <body> (since the parser won't always |
| 605 // insert one), so we resume here too. That does mean XHTML documents make | 606 // insert one), so we resume here too. That does mean XHTML documents make |
| 606 // frames when there's only a <head>, but such documents are pretty rare. | 607 // frames when there's only a <head>, but such documents are pretty rare. |
| 607 if (m_documentElement && !isHTMLDocument()) | 608 if (m_documentElement && !isHTMLDocument()) |
| 608 beginLifecycleUpdatesIfRenderingReady(); | 609 beginLifecycleUpdatesIfRenderingReady(); |
| 609 } | 610 } |
| 610 | 611 |
| 611 void Document::setRootScroller(Element* newScroller, ExceptionState& exceptionSt
ate) | 612 void Document::setRootScroller(Element* newScroller, ExceptionState& exceptionSt
ate) |
| 612 { | 613 { |
| 613 m_rootScroller->set(newScroller); | 614 m_rootScrollerController->set(newScroller); |
| 614 } | 615 } |
| 615 | 616 |
| 616 Element* Document::rootScroller() const | 617 Element* Document::rootScroller() const |
| 617 { | 618 { |
| 618 return m_rootScroller->get(); | 619 return m_rootScrollerController->get(); |
| 619 } | 620 } |
| 620 | 621 |
| 621 bool Document::isEffectiveRootScroller(const Element& element) const | 622 bool Document::isEffectiveRootScroller(const Element& element) const |
| 622 { | 623 { |
| 623 return m_rootScroller->effectiveRootScroller() == element; | 624 return m_rootScrollerController->effectiveRootScroller() == element; |
| 624 } | 625 } |
| 625 | 626 |
| 626 bool Document::isInMainFrame() const | 627 bool Document::isInMainFrame() const |
| 627 { | 628 { |
| 628 return frame() && frame()->isMainFrame(); | 629 return frame() && frame()->isMainFrame(); |
| 629 } | 630 } |
| 630 | 631 |
| 631 AtomicString Document::convertLocalName(const AtomicString& name) | 632 AtomicString Document::convertLocalName(const AtomicString& name) |
| 632 { | 633 { |
| 633 return isHTMLDocument() ? name.lower() : name; | 634 return isHTMLDocument() ? name.lower() : name; |
| (...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 // first real or 'paintable' layout. | 1907 // first real or 'paintable' layout. |
| 1907 // TODO(esprehn): This doesn't really make sense, why not track the first | 1908 // TODO(esprehn): This doesn't really make sense, why not track the first |
| 1908 // beginFrame? This will catch the first layout in a page that does lots | 1909 // beginFrame? This will catch the first layout in a page that does lots |
| 1909 // of layout thrashing even though that layout might not be followed by | 1910 // of layout thrashing even though that layout might not be followed by |
| 1910 // a paint for many seconds. | 1911 // a paint for many seconds. |
| 1911 if (isRenderingReady() && body() && !styleEngine().hasPendingScriptBlockingS
heets()) { | 1912 if (isRenderingReady() && body() && !styleEngine().hasPendingScriptBlockingS
heets()) { |
| 1912 if (!m_documentTiming.firstLayout()) | 1913 if (!m_documentTiming.firstLayout()) |
| 1913 m_documentTiming.markFirstLayout(); | 1914 m_documentTiming.markFirstLayout(); |
| 1914 } | 1915 } |
| 1915 | 1916 |
| 1916 m_rootScroller->didUpdateLayout(); | 1917 m_rootScrollerController->didUpdateLayout(); |
| 1917 } | 1918 } |
| 1918 | 1919 |
| 1919 void Document::setNeedsFocusedElementCheck() | 1920 void Document::setNeedsFocusedElementCheck() |
| 1920 { | 1921 { |
| 1921 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWit
hExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus)); | 1922 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWit
hExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus)); |
| 1922 } | 1923 } |
| 1923 | 1924 |
| 1924 void Document::clearFocusedElementSoon() | 1925 void Document::clearFocusedElementSoon() |
| 1925 { | 1926 { |
| 1926 if (!m_clearFocusedElementTimer.isActive()) | 1927 if (!m_clearFocusedElementTimer.isActive()) |
| (...skipping 3988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5915 { | 5916 { |
| 5916 visitor->trace(m_importsController); | 5917 visitor->trace(m_importsController); |
| 5917 visitor->trace(m_docType); | 5918 visitor->trace(m_docType); |
| 5918 visitor->trace(m_implementation); | 5919 visitor->trace(m_implementation); |
| 5919 visitor->trace(m_autofocusElement); | 5920 visitor->trace(m_autofocusElement); |
| 5920 visitor->trace(m_focusedElement); | 5921 visitor->trace(m_focusedElement); |
| 5921 visitor->trace(m_sequentialFocusNavigationStartingPoint); | 5922 visitor->trace(m_sequentialFocusNavigationStartingPoint); |
| 5922 visitor->trace(m_hoverNode); | 5923 visitor->trace(m_hoverNode); |
| 5923 visitor->trace(m_activeHoverElement); | 5924 visitor->trace(m_activeHoverElement); |
| 5924 visitor->trace(m_documentElement); | 5925 visitor->trace(m_documentElement); |
| 5925 visitor->trace(m_rootScroller); | 5926 visitor->trace(m_rootScrollerController); |
| 5926 visitor->trace(m_titleElement); | 5927 visitor->trace(m_titleElement); |
| 5927 visitor->trace(m_axObjectCache); | 5928 visitor->trace(m_axObjectCache); |
| 5928 visitor->trace(m_markers); | 5929 visitor->trace(m_markers); |
| 5929 visitor->trace(m_cssTarget); | 5930 visitor->trace(m_cssTarget); |
| 5930 visitor->trace(m_currentScriptStack); | 5931 visitor->trace(m_currentScriptStack); |
| 5931 visitor->trace(m_scriptRunner); | 5932 visitor->trace(m_scriptRunner); |
| 5932 visitor->trace(m_listsInvalidatedAtDocument); | 5933 visitor->trace(m_listsInvalidatedAtDocument); |
| 5933 for (int i = 0; i < numNodeListInvalidationTypes; ++i) | 5934 for (int i = 0; i < numNodeListInvalidationTypes; ++i) |
| 5934 visitor->trace(m_nodeLists[i]); | 5935 visitor->trace(m_nodeLists[i]); |
| 5935 visitor->trace(m_topLayerElements); | 5936 visitor->trace(m_topLayerElements); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5999 #ifndef NDEBUG | 6000 #ifndef NDEBUG |
| 6000 using namespace blink; | 6001 using namespace blink; |
| 6001 void showLiveDocumentInstances() | 6002 void showLiveDocumentInstances() |
| 6002 { | 6003 { |
| 6003 WeakDocumentSet& set = liveDocumentSet(); | 6004 WeakDocumentSet& set = liveDocumentSet(); |
| 6004 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6005 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6005 for (Document* document : set) | 6006 for (Document* document : set) |
| 6006 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); | 6007 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get
String().utf8().data()); |
| 6007 } | 6008 } |
| 6008 #endif | 6009 #endif |
| OLD | NEW |