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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 #include "core/html/FormController.h" | 116 #include "core/html/FormController.h" |
117 #include "core/html/HTMLAllCollection.h" | 117 #include "core/html/HTMLAllCollection.h" |
118 #include "core/html/HTMLAnchorElement.h" | 118 #include "core/html/HTMLAnchorElement.h" |
119 #include "core/html/HTMLBodyElement.h" | 119 #include "core/html/HTMLBodyElement.h" |
120 #include "core/html/HTMLCanvasElement.h" | 120 #include "core/html/HTMLCanvasElement.h" |
121 #include "core/html/HTMLCollection.h" | 121 #include "core/html/HTMLCollection.h" |
122 #include "core/html/HTMLDocument.h" | 122 #include "core/html/HTMLDocument.h" |
123 #include "core/html/HTMLFrameOwnerElement.h" | 123 #include "core/html/HTMLFrameOwnerElement.h" |
124 #include "core/html/HTMLHeadElement.h" | 124 #include "core/html/HTMLHeadElement.h" |
125 #include "core/html/HTMLIFrameElement.h" | 125 #include "core/html/HTMLIFrameElement.h" |
| 126 #include "core/html/HTMLImportsController.h" |
126 #include "core/html/HTMLLinkElement.h" | 127 #include "core/html/HTMLLinkElement.h" |
127 #include "core/html/HTMLMapElement.h" | 128 #include "core/html/HTMLMapElement.h" |
128 #include "core/html/HTMLNameCollection.h" | 129 #include "core/html/HTMLNameCollection.h" |
129 #include "core/html/HTMLStyleElement.h" | 130 #include "core/html/HTMLStyleElement.h" |
130 #include "core/html/HTMLTitleElement.h" | 131 #include "core/html/HTMLTitleElement.h" |
131 #include "core/html/PluginDocument.h" | 132 #include "core/html/PluginDocument.h" |
132 #include "core/html/parser/HTMLDocumentParser.h" | 133 #include "core/html/parser/HTMLDocumentParser.h" |
133 #include "core/html/parser/HTMLParserIdioms.h" | 134 #include "core/html/parser/HTMLParserIdioms.h" |
134 #include "core/html/parser/NestingLevelIncrementer.h" | 135 #include "core/html/parser/NestingLevelIncrementer.h" |
135 #include "core/inspector/InspectorCounters.h" | 136 #include "core/inspector/InspectorCounters.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 m_titleElement = 0; | 632 m_titleElement = 0; |
632 m_documentElement = 0; | 633 m_documentElement = 0; |
633 m_contextFeatures = ContextFeatures::defaultSwitch(); | 634 m_contextFeatures = ContextFeatures::defaultSwitch(); |
634 m_userActionElements.documentDidRemoveLastRef(); | 635 m_userActionElements.documentDidRemoveLastRef(); |
635 m_fullScreenElement = 0; | 636 m_fullScreenElement = 0; |
636 m_fullScreenElementStack.clear(); | 637 m_fullScreenElementStack.clear(); |
637 | 638 |
638 detachParser(); | 639 detachParser(); |
639 | 640 |
640 m_registry.clear(); | 641 m_registry.clear(); |
| 642 m_imports.clear(); |
641 | 643 |
642 // removeDetachedChildren() doesn't always unregister IDs, | 644 // removeDetachedChildren() doesn't always unregister IDs, |
643 // so tear down scope information upfront to avoid having stale references i
n the map. | 645 // so tear down scope information upfront to avoid having stale references i
n the map. |
644 destroyTreeScopeData(); | 646 destroyTreeScopeData(); |
645 removeDetachedChildren(); | 647 removeDetachedChildren(); |
646 // removeDetachedChildren() can access FormController. | 648 // removeDetachedChildren() can access FormController. |
647 m_formController.clear(); | 649 m_formController.clear(); |
648 | 650 |
649 m_markers->detach(); | 651 m_markers->detach(); |
650 | 652 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 | 858 |
857 CustomElementRegistry* Document::ensureCustomElementRegistry() | 859 CustomElementRegistry* Document::ensureCustomElementRegistry() |
858 { | 860 { |
859 if (!m_registry) { | 861 if (!m_registry) { |
860 ASSERT(isHTMLDocument() || isXHTMLDocument()); | 862 ASSERT(isHTMLDocument() || isXHTMLDocument()); |
861 m_registry = adoptRef(new CustomElementRegistry(this)); | 863 m_registry = adoptRef(new CustomElementRegistry(this)); |
862 } | 864 } |
863 return m_registry.get(); | 865 return m_registry.get(); |
864 } | 866 } |
865 | 867 |
| 868 HTMLImportsController* Document::ensureImports() |
| 869 { |
| 870 if (!m_imports) |
| 871 m_imports = HTMLImportsController::create(this); |
| 872 return m_imports.get(); |
| 873 } |
| 874 |
| 875 void Document::didLoadAllImports() |
| 876 { |
| 877 executeScriptsWaitingForResourcesIfNeeded(); |
| 878 } |
| 879 |
| 880 bool Document::haveImportsLoaded() const |
| 881 { |
| 882 return !m_imports || m_imports->haveLoaded(); |
| 883 } |
| 884 |
866 PassRefPtr<DocumentFragment> Document::createDocumentFragment() | 885 PassRefPtr<DocumentFragment> Document::createDocumentFragment() |
867 { | 886 { |
868 return DocumentFragment::create(document()); | 887 return DocumentFragment::create(document()); |
869 } | 888 } |
870 | 889 |
871 PassRefPtr<Text> Document::createTextNode(const String& data) | 890 PassRefPtr<Text> Document::createTextNode(const String& data) |
872 { | 891 { |
873 return Text::create(this, data); | 892 return Text::create(this, data); |
874 } | 893 } |
875 | 894 |
(...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2618 void Document::seamlessParentUpdatedStylesheets() | 2637 void Document::seamlessParentUpdatedStylesheets() |
2619 { | 2638 { |
2620 styleResolverChanged(RecalcStyleImmediately); | 2639 styleResolverChanged(RecalcStyleImmediately); |
2621 } | 2640 } |
2622 | 2641 |
2623 void Document::didRemoveAllPendingStylesheet() | 2642 void Document::didRemoveAllPendingStylesheet() |
2624 { | 2643 { |
2625 m_needsNotifyRemoveAllPendingStylesheet = false; | 2644 m_needsNotifyRemoveAllPendingStylesheet = false; |
2626 | 2645 |
2627 styleResolverChanged(RecalcStyleIfNeeded); | 2646 styleResolverChanged(RecalcStyleIfNeeded); |
2628 | 2647 executeScriptsWaitingForResourcesIfNeeded(); |
2629 if (ScriptableDocumentParser* parser = scriptableDocumentParser()) | |
2630 parser->executeScriptsWaitingForStylesheets(); | |
2631 | 2648 |
2632 if (m_gotoAnchorNeededAfterStylesheetsLoad && view()) | 2649 if (m_gotoAnchorNeededAfterStylesheetsLoad && view()) |
2633 view()->scrollToFragment(m_url); | 2650 view()->scrollToFragment(m_url); |
2634 } | 2651 } |
2635 | 2652 |
| 2653 void Document::executeScriptsWaitingForResourcesIfNeeded() |
| 2654 { |
| 2655 if (!haveStylesheetsAndImportsLoaded()) |
| 2656 return; |
| 2657 if (ScriptableDocumentParser* parser = scriptableDocumentParser()) |
| 2658 parser->executeScriptsWaitingForResources(); |
| 2659 } |
| 2660 |
| 2661 |
2636 CSSStyleSheet* Document::elementSheet() | 2662 CSSStyleSheet* Document::elementSheet() |
2637 { | 2663 { |
2638 if (!m_elemSheet) | 2664 if (!m_elemSheet) |
2639 m_elemSheet = CSSStyleSheet::createInline(this, m_baseURL); | 2665 m_elemSheet = CSSStyleSheet::createInline(this, m_baseURL); |
2640 return m_elemSheet.get(); | 2666 return m_elemSheet.get(); |
2641 } | 2667 } |
2642 | 2668 |
2643 int Document::nodeAbsIndex(Node *node) | 2669 int Document::nodeAbsIndex(Node *node) |
2644 { | 2670 { |
2645 ASSERT(node->document() == this); | 2671 ASSERT(node->document() == this); |
(...skipping 2975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5621 return; | 5647 return; |
5622 | 5648 |
5623 Vector<RefPtr<Element> > associatedFormControls; | 5649 Vector<RefPtr<Element> > associatedFormControls; |
5624 copyToVector(m_associatedFormControls, associatedFormControls); | 5650 copyToVector(m_associatedFormControls, associatedFormControls); |
5625 | 5651 |
5626 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC
ontrols); | 5652 frame()->page()->chrome().client()->didAssociateFormControls(associatedFormC
ontrols); |
5627 m_associatedFormControls.clear(); | 5653 m_associatedFormControls.clear(); |
5628 } | 5654 } |
5629 | 5655 |
5630 } // namespace WebCore | 5656 } // namespace WebCore |
OLD | NEW |