| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 #include "core/platform/Logging.h" | 166 #include "core/platform/Logging.h" |
| 167 #include "core/platform/PlatformKeyboardEvent.h" | 167 #include "core/platform/PlatformKeyboardEvent.h" |
| 168 #include "core/platform/Timer.h" | 168 #include "core/platform/Timer.h" |
| 169 #include "core/platform/chromium/TraceEvent.h" | 169 #include "core/platform/chromium/TraceEvent.h" |
| 170 #include "core/platform/network/HTTPParsers.h" | 170 #include "core/platform/network/HTTPParsers.h" |
| 171 #include "core/platform/text/PlatformLocale.h" | 171 #include "core/platform/text/PlatformLocale.h" |
| 172 #include "core/platform/text/SegmentedString.h" | 172 #include "core/platform/text/SegmentedString.h" |
| 173 #include "core/rendering/FlowThreadController.h" | 173 #include "core/rendering/FlowThreadController.h" |
| 174 #include "core/rendering/HitTestRequest.h" | 174 #include "core/rendering/HitTestRequest.h" |
| 175 #include "core/rendering/HitTestResult.h" | 175 #include "core/rendering/HitTestResult.h" |
| 176 #include "core/rendering/RenderArena.h" | |
| 177 #include "core/rendering/RenderLayerCompositor.h" | 176 #include "core/rendering/RenderLayerCompositor.h" |
| 178 #include "core/rendering/RenderNamedFlowThread.h" | 177 #include "core/rendering/RenderNamedFlowThread.h" |
| 179 #include "core/rendering/RenderTextControl.h" | 178 #include "core/rendering/RenderTextControl.h" |
| 180 #include "core/rendering/RenderView.h" | 179 #include "core/rendering/RenderView.h" |
| 181 #include "core/rendering/RenderWidget.h" | 180 #include "core/rendering/RenderWidget.h" |
| 182 #include "core/rendering/TextAutosizer.h" | 181 #include "core/rendering/TextAutosizer.h" |
| 183 #include "core/svg/SVGDocumentExtensions.h" | 182 #include "core/svg/SVGDocumentExtensions.h" |
| 184 #include "core/svg/SVGSVGElement.h" | 183 #include "core/svg/SVGSVGElement.h" |
| 185 #include "core/svg/SVGStyleElement.h" | 184 #include "core/svg/SVGStyleElement.h" |
| 186 #include "core/workers/SharedWorkerRepository.h" | 185 #include "core/workers/SharedWorkerRepository.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 562 |
| 564 // Currently we believe that Document can never outlive the parser. | 563 // Currently we believe that Document can never outlive the parser. |
| 565 // Although the Document may be replaced synchronously, DocumentParsers | 564 // Although the Document may be replaced synchronously, DocumentParsers |
| 566 // generally keep at least one reference to an Element which would in turn | 565 // generally keep at least one reference to an Element which would in turn |
| 567 // has a reference to the Document. If you hit this ASSERT, then that | 566 // has a reference to the Document. If you hit this ASSERT, then that |
| 568 // assumption is wrong. DocumentParser::detach() should ensure that even | 567 // assumption is wrong. DocumentParser::detach() should ensure that even |
| 569 // if the DocumentParser outlives the Document it won't cause badness. | 568 // if the DocumentParser outlives the Document it won't cause badness. |
| 570 ASSERT(!m_parser || m_parser->refCount() == 1); | 569 ASSERT(!m_parser || m_parser->refCount() == 1); |
| 571 detachParser(); | 570 detachParser(); |
| 572 | 571 |
| 573 m_renderArena.clear(); | |
| 574 | |
| 575 if (this == topDocument()) | 572 if (this == topDocument()) |
| 576 clearAXObjectCache(); | 573 clearAXObjectCache(); |
| 577 | 574 |
| 578 m_decoder = 0; | 575 m_decoder = 0; |
| 579 | 576 |
| 580 if (m_styleSheetList) | 577 if (m_styleSheetList) |
| 581 m_styleSheetList->detachFromDocument(); | 578 m_styleSheetList->detachFromDocument(); |
| 582 | 579 |
| 583 m_styleSheetCollection.clear(); | 580 m_styleSheetCollection.clear(); |
| 584 | 581 |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1700 { | 1697 { |
| 1701 PostAttachCallbackDisabler disabler(this); | 1698 PostAttachCallbackDisabler disabler(this); |
| 1702 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; | 1699 WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates; |
| 1703 | 1700 |
| 1704 RefPtr<FrameView> frameView = view(); | 1701 RefPtr<FrameView> frameView = view(); |
| 1705 if (frameView) { | 1702 if (frameView) { |
| 1706 frameView->pauseScheduledEvents(); | 1703 frameView->pauseScheduledEvents(); |
| 1707 frameView->beginDeferredRepaints(); | 1704 frameView->beginDeferredRepaints(); |
| 1708 } | 1705 } |
| 1709 | 1706 |
| 1710 ASSERT(!renderer() || renderArena()); | 1707 if (!renderer()) |
| 1711 if (!renderer() || !renderArena()) | |
| 1712 goto bailOut; | 1708 goto bailOut; |
| 1713 | 1709 |
| 1714 if (m_pendingStyleRecalcShouldForce) | 1710 if (m_pendingStyleRecalcShouldForce) |
| 1715 change = Force; | 1711 change = Force; |
| 1716 | 1712 |
| 1717 // Recalculating the root style (on the document) is not needed in the c
ommon case. | 1713 // Recalculating the root style (on the document) is not needed in the c
ommon case. |
| 1718 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change
>= Inherit))) { | 1714 if ((change == Force) || (shouldDisplaySeamlesslyWithParent() && (change
>= Inherit))) { |
| 1719 // style selector may set this again during recalc | 1715 // style selector may set this again during recalc |
| 1720 m_hasNodesWithPlaceholderStyle = false; | 1716 m_hasNodesWithPlaceholderStyle = false; |
| 1721 | 1717 |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1921 void Document::clearStyleResolver() | 1917 void Document::clearStyleResolver() |
| 1922 { | 1918 { |
| 1923 m_styleResolver.clear(); | 1919 m_styleResolver.clear(); |
| 1924 } | 1920 } |
| 1925 | 1921 |
| 1926 void Document::attach(const AttachContext& context) | 1922 void Document::attach(const AttachContext& context) |
| 1927 { | 1923 { |
| 1928 ASSERT(!attached()); | 1924 ASSERT(!attached()); |
| 1929 ASSERT(!m_axObjectCache || this != topDocument()); | 1925 ASSERT(!m_axObjectCache || this != topDocument()); |
| 1930 | 1926 |
| 1931 if (!m_renderArena) | |
| 1932 m_renderArena = RenderArena::create(); | |
| 1933 | |
| 1934 // Create the rendering tree | 1927 // Create the rendering tree |
| 1935 setRenderer(new (m_renderArena.get()) RenderView(this)); | 1928 setRenderer(new RenderView(this)); |
| 1936 renderView()->setIsInWindow(true); | 1929 renderView()->setIsInWindow(true); |
| 1937 | 1930 |
| 1938 recalcStyle(Force); | 1931 recalcStyle(Force); |
| 1939 | 1932 |
| 1940 ContainerNode::attach(context); | 1933 ContainerNode::attach(context); |
| 1941 } | 1934 } |
| 1942 | 1935 |
| 1943 void Document::detach(const AttachContext& context) | 1936 void Document::detach(const AttachContext& context) |
| 1944 { | 1937 { |
| 1945 ASSERT(attached()); | 1938 ASSERT(attached()); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1990 | 1983 |
| 1991 if (m_touchEventTargets && m_touchEventTargets->size() && parentDocument()) | 1984 if (m_touchEventTargets && m_touchEventTargets->size() && parentDocument()) |
| 1992 parentDocument()->didRemoveEventTargetNode(this); | 1985 parentDocument()->didRemoveEventTargetNode(this); |
| 1993 | 1986 |
| 1994 // This is required, as our Frame might delete itself as soon as it detaches | 1987 // This is required, as our Frame might delete itself as soon as it detaches |
| 1995 // us. However, this violates Node::detach() semantics, as it's never | 1988 // us. However, this violates Node::detach() semantics, as it's never |
| 1996 // possible to re-attach. Eventually Document::detach() should be renamed, | 1989 // possible to re-attach. Eventually Document::detach() should be renamed, |
| 1997 // or this setting of the frame to 0 could be made explicit in each of the | 1990 // or this setting of the frame to 0 could be made explicit in each of the |
| 1998 // callers of Document::detach(). | 1991 // callers of Document::detach(). |
| 1999 m_frame = 0; | 1992 m_frame = 0; |
| 2000 m_renderArena.clear(); | |
| 2001 | 1993 |
| 2002 if (m_mediaQueryMatcher) | 1994 if (m_mediaQueryMatcher) |
| 2003 m_mediaQueryMatcher->documentDestroyed(); | 1995 m_mediaQueryMatcher->documentDestroyed(); |
| 2004 | 1996 |
| 2005 if (m_lifecycleNotifier) | 1997 if (m_lifecycleNotifier) |
| 2006 m_lifecycleNotifier->notifyDocumentWasDetached(); | 1998 m_lifecycleNotifier->notifyDocumentWasDetached(); |
| 2007 } | 1999 } |
| 2008 | 2000 |
| 2009 void Document::prepareForDestruction() | 2001 void Document::prepareForDestruction() |
| 2010 { | 2002 { |
| (...skipping 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5124 info.addMember(m_listsInvalidatedAtDocument, "listsInvalidatedAtDocument"); | 5116 info.addMember(m_listsInvalidatedAtDocument, "listsInvalidatedAtDocument"); |
| 5125 info.addMember(m_styleResolverThrowawayTimer, "styleResolverThrowawayTimer")
; | 5117 info.addMember(m_styleResolverThrowawayTimer, "styleResolverThrowawayTimer")
; |
| 5126 info.addMember(m_parser, "parser"); | 5118 info.addMember(m_parser, "parser"); |
| 5127 info.addMember(m_contextFeatures, "contextFeatures"); | 5119 info.addMember(m_contextFeatures, "contextFeatures"); |
| 5128 info.addMember(m_focusedNode, "focusedNode"); | 5120 info.addMember(m_focusedNode, "focusedNode"); |
| 5129 info.addMember(m_hoverNode, "hoverNode"); | 5121 info.addMember(m_hoverNode, "hoverNode"); |
| 5130 info.addMember(m_documentElement, "documentElement"); | 5122 info.addMember(m_documentElement, "documentElement"); |
| 5131 info.addMember(m_visitedLinkState, "visitedLinkState"); | 5123 info.addMember(m_visitedLinkState, "visitedLinkState"); |
| 5132 info.addMember(m_styleRecalcTimer, "styleRecalcTimer"); | 5124 info.addMember(m_styleRecalcTimer, "styleRecalcTimer"); |
| 5133 info.addMember(m_titleElement, "titleElement"); | 5125 info.addMember(m_titleElement, "titleElement"); |
| 5134 info.ignoreMember(m_renderArena); | |
| 5135 info.addMember(m_axObjectCache, "axObjectCache"); | 5126 info.addMember(m_axObjectCache, "axObjectCache"); |
| 5136 info.addMember(m_markers, "markers"); | 5127 info.addMember(m_markers, "markers"); |
| 5137 info.addMember(m_cssTarget, "cssTarget"); | 5128 info.addMember(m_cssTarget, "cssTarget"); |
| 5138 info.addMember(m_updateFocusAppearanceTimer, "updateFocusAppearanceTimer"); | 5129 info.addMember(m_updateFocusAppearanceTimer, "updateFocusAppearanceTimer"); |
| 5139 info.addMember(m_pendingStateObject, "pendingStateObject"); | 5130 info.addMember(m_pendingStateObject, "pendingStateObject"); |
| 5140 info.addMember(m_scriptRunner, "scriptRunner"); | 5131 info.addMember(m_scriptRunner, "scriptRunner"); |
| 5141 info.addMember(m_transformSource, "transformSource"); | 5132 info.addMember(m_transformSource, "transformSource"); |
| 5142 info.addMember(m_transformSourceDocument, "transformSourceDocument"); | 5133 info.addMember(m_transformSourceDocument, "transformSourceDocument"); |
| 5143 info.addMember(m_decoder, "decoder"); | 5134 info.addMember(m_decoder, "decoder"); |
| 5144 info.addMember(m_xpathEvaluator, "xpathEvaluator"); | 5135 info.addMember(m_xpathEvaluator, "xpathEvaluator"); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5227 } | 5218 } |
| 5228 | 5219 |
| 5229 void Document::addLifecycleObserver(DocumentLifecycleObserver* observer) | 5220 void Document::addLifecycleObserver(DocumentLifecycleObserver* observer) |
| 5230 { | 5221 { |
| 5231 if (!m_lifecycleNotifier) | 5222 if (!m_lifecycleNotifier) |
| 5232 m_lifecycleNotifier = DocumentLifecycleNotifier::create(); | 5223 m_lifecycleNotifier = DocumentLifecycleNotifier::create(); |
| 5233 m_lifecycleNotifier->addObserver(observer); | 5224 m_lifecycleNotifier->addObserver(observer); |
| 5234 } | 5225 } |
| 5235 | 5226 |
| 5236 } // namespace WebCore | 5227 } // namespace WebCore |
| OLD | NEW |