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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
7 * rights reserved. | 7 * rights reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 #include "core/dom/DocumentFragment.h" | 73 #include "core/dom/DocumentFragment.h" |
74 #include "core/dom/DocumentParserTiming.h" | 74 #include "core/dom/DocumentParserTiming.h" |
75 #include "core/dom/DocumentType.h" | 75 #include "core/dom/DocumentType.h" |
76 #include "core/dom/Element.h" | 76 #include "core/dom/Element.h" |
77 #include "core/dom/ElementCreationOptions.h" | 77 #include "core/dom/ElementCreationOptions.h" |
78 #include "core/dom/ElementDataCache.h" | 78 #include "core/dom/ElementDataCache.h" |
79 #include "core/dom/ElementRegistrationOptions.h" | 79 #include "core/dom/ElementRegistrationOptions.h" |
80 #include "core/dom/ElementTraversal.h" | 80 #include "core/dom/ElementTraversal.h" |
81 #include "core/dom/ExceptionCode.h" | 81 #include "core/dom/ExceptionCode.h" |
82 #include "core/dom/ExecutionContextTask.h" | 82 #include "core/dom/ExecutionContextTask.h" |
| 83 #include "core/dom/FormElementObserver.h" |
83 #include "core/dom/FrameRequestCallback.h" | 84 #include "core/dom/FrameRequestCallback.h" |
84 #include "core/dom/IntersectionObserverController.h" | 85 #include "core/dom/IntersectionObserverController.h" |
85 #include "core/dom/LayoutTreeBuilderTraversal.h" | 86 #include "core/dom/LayoutTreeBuilderTraversal.h" |
86 #include "core/dom/LiveNodeList.h" | 87 #include "core/dom/LiveNodeList.h" |
87 #include "core/dom/MutationObserver.h" | 88 #include "core/dom/MutationObserver.h" |
88 #include "core/dom/NodeChildRemovalTracker.h" | 89 #include "core/dom/NodeChildRemovalTracker.h" |
89 #include "core/dom/NodeComputedStyle.h" | 90 #include "core/dom/NodeComputedStyle.h" |
90 #include "core/dom/NodeFilter.h" | 91 #include "core/dom/NodeFilter.h" |
91 #include "core/dom/NodeIterator.h" | 92 #include "core/dom/NodeIterator.h" |
92 #include "core/dom/NodeRareData.h" | 93 #include "core/dom/NodeRareData.h" |
(...skipping 6640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6733 visitor->Trace(svg_extensions_); | 6734 visitor->Trace(svg_extensions_); |
6734 visitor->Trace(timeline_); | 6735 visitor->Trace(timeline_); |
6735 visitor->Trace(compositor_pending_animations_); | 6736 visitor->Trace(compositor_pending_animations_); |
6736 visitor->Trace(context_document_); | 6737 visitor->Trace(context_document_); |
6737 visitor->Trace(canvas_font_cache_); | 6738 visitor->Trace(canvas_font_cache_); |
6738 visitor->Trace(intersection_observer_controller_); | 6739 visitor->Trace(intersection_observer_controller_); |
6739 visitor->Trace(snap_coordinator_); | 6740 visitor->Trace(snap_coordinator_); |
6740 visitor->Trace(resize_observer_controller_); | 6741 visitor->Trace(resize_observer_controller_); |
6741 visitor->Trace(property_registry_); | 6742 visitor->Trace(property_registry_); |
6742 visitor->Trace(network_state_observer_); | 6743 visitor->Trace(network_state_observer_); |
| 6744 visitor->Trace(form_element_observer_); |
6743 Supplementable<Document>::Trace(visitor); | 6745 Supplementable<Document>::Trace(visitor); |
6744 TreeScope::Trace(visitor); | 6746 TreeScope::Trace(visitor); |
6745 ContainerNode::Trace(visitor); | 6747 ContainerNode::Trace(visitor); |
6746 ExecutionContext::Trace(visitor); | 6748 ExecutionContext::Trace(visitor); |
6747 SecurityContext::Trace(visitor); | 6749 SecurityContext::Trace(visitor); |
6748 SynchronousMutationNotifier::Trace(visitor); | 6750 SynchronousMutationNotifier::Trace(visitor); |
6749 } | 6751 } |
6750 | 6752 |
6751 void Document::RecordDeferredLoadReason(WouldLoadReason reason) { | 6753 void Document::RecordDeferredLoadReason(WouldLoadReason reason) { |
6752 DCHECK(would_load_reason_ == WouldLoadReason::kInvalid || | 6754 DCHECK(would_load_reason_ == WouldLoadReason::kInvalid || |
6753 reason != WouldLoadReason::kCreated); | 6755 reason != WouldLoadReason::kCreated); |
6754 DCHECK(reason != WouldLoadReason::kInvalid); | 6756 DCHECK(reason != WouldLoadReason::kInvalid); |
6755 DCHECK(GetFrame()); | 6757 DCHECK(GetFrame()); |
6756 DCHECK(GetFrame()->IsCrossOriginSubframe()); | 6758 DCHECK(GetFrame()->IsCrossOriginSubframe()); |
6757 if (reason <= would_load_reason_ || | 6759 if (reason <= would_load_reason_ || |
6758 !GetFrame()->Loader().StateMachine()->CommittedFirstRealDocumentLoad()) | 6760 !GetFrame()->Loader().StateMachine()->CommittedFirstRealDocumentLoad()) |
6759 return; | 6761 return; |
6760 for (int i = static_cast<int>(would_load_reason_) + 1; | 6762 for (int i = static_cast<int>(would_load_reason_) + 1; |
6761 i <= static_cast<int>(reason); ++i) | 6763 i <= static_cast<int>(reason); ++i) |
6762 RecordLoadReasonToHistogram(static_cast<WouldLoadReason>(i)); | 6764 RecordLoadReasonToHistogram(static_cast<WouldLoadReason>(i)); |
6763 would_load_reason_ = reason; | 6765 would_load_reason_ = reason; |
6764 } | 6766 } |
6765 | 6767 |
| 6768 FormElementObserver* Document::GetFormElementObserver() { |
| 6769 if (!form_element_observer_) |
| 6770 form_element_observer_ = new FormElementObserver(*this); |
| 6771 return form_element_observer_; |
| 6772 } |
| 6773 |
6766 DEFINE_TRACE_WRAPPERS(Document) { | 6774 DEFINE_TRACE_WRAPPERS(Document) { |
6767 // node_lists_ are traced in their corresponding NodeListsNodeData, keeping | 6775 // node_lists_ are traced in their corresponding NodeListsNodeData, keeping |
6768 // them only alive for live nodes. Otherwise we would keep lists of dead | 6776 // them only alive for live nodes. Otherwise we would keep lists of dead |
6769 // nodes alive that have not yet been invalidated. | 6777 // nodes alive that have not yet been invalidated. |
6770 visitor->TraceWrappers(imports_controller_); | 6778 visitor->TraceWrappers(imports_controller_); |
6771 visitor->TraceWrappers(implementation_); | 6779 visitor->TraceWrappers(implementation_); |
6772 visitor->TraceWrappers(style_sheet_list_); | 6780 visitor->TraceWrappers(style_sheet_list_); |
6773 visitor->TraceWrappers(style_engine_); | 6781 visitor->TraceWrappers(style_engine_); |
6774 // Cannot trace in Supplementable<Document> as it is part of platform/ and | 6782 // Cannot trace in Supplementable<Document> as it is part of platform/ and |
6775 // thus cannot refer to ScriptWrappableVisitor. | 6783 // thus cannot refer to ScriptWrappableVisitor. |
(...skipping 14 matching lines...) Expand all Loading... |
6790 } | 6798 } |
6791 | 6799 |
6792 void showLiveDocumentInstances() { | 6800 void showLiveDocumentInstances() { |
6793 WeakDocumentSet& set = liveDocumentSet(); | 6801 WeakDocumentSet& set = liveDocumentSet(); |
6794 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6802 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
6795 for (blink::Document* document : set) | 6803 for (blink::Document* document : set) |
6796 fprintf(stderr, "- Document %p URL: %s\n", document, | 6804 fprintf(stderr, "- Document %p URL: %s\n", document, |
6797 document->Url().GetString().Utf8().data()); | 6805 document->Url().GetString().Utf8().data()); |
6798 } | 6806 } |
6799 #endif | 6807 #endif |
OLD | NEW |