Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: Source/core/dom/Document.cpp

Issue 181713003: Have Document::accessSVGExtensions() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 m_markers->clear(); 615 m_markers->clear();
616 616
617 m_cssCanvasElements.clear(); 617 m_cssCanvasElements.clear();
618 618
619 // FIXME: consider using ActiveDOMObject. 619 // FIXME: consider using ActiveDOMObject.
620 if (m_scriptedAnimationController) 620 if (m_scriptedAnimationController)
621 m_scriptedAnimationController->clearDocumentPointer(); 621 m_scriptedAnimationController->clearDocumentPointer();
622 m_scriptedAnimationController.clear(); 622 m_scriptedAnimationController.clear();
623 623
624 if (svgExtensions()) 624 if (svgExtensions())
625 accessSVGExtensions()->pauseAnimations(); 625 accessSVGExtensions().pauseAnimations();
626 626
627 m_lifecycle.advanceTo(DocumentLifecycle::Disposed); 627 m_lifecycle.advanceTo(DocumentLifecycle::Disposed);
628 lifecycleNotifier().notifyDocumentWasDisposed(); 628 lifecycleNotifier().notifyDocumentWasDisposed();
629 } 629 }
630 630
631 SelectorQueryCache& Document::selectorQueryCache() 631 SelectorQueryCache& Document::selectorQueryCache()
632 { 632 {
633 if (!m_selectorQueryCache) 633 if (!m_selectorQueryCache)
634 m_selectorQueryCache = adoptPtr(new SelectorQueryCache()); 634 m_selectorQueryCache = adoptPtr(new SelectorQueryCache());
635 return *m_selectorQueryCache; 635 return *m_selectorQueryCache;
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 clearAXObjectCache(); 2096 clearAXObjectCache();
2097 2097
2098 stopActiveDOMObjects(); 2098 stopActiveDOMObjects();
2099 2099
2100 // FIXME: consider using ActiveDOMObject. 2100 // FIXME: consider using ActiveDOMObject.
2101 if (m_scriptedAnimationController) 2101 if (m_scriptedAnimationController)
2102 m_scriptedAnimationController->clearDocumentPointer(); 2102 m_scriptedAnimationController->clearDocumentPointer();
2103 m_scriptedAnimationController.clear(); 2103 m_scriptedAnimationController.clear();
2104 2104
2105 if (svgExtensions()) 2105 if (svgExtensions())
2106 accessSVGExtensions()->pauseAnimations(); 2106 accessSVGExtensions().pauseAnimations();
2107 2107
2108 // FIXME: This shouldn't be needed once DOMWindow becomes ExecutionContext. 2108 // FIXME: This shouldn't be needed once DOMWindow becomes ExecutionContext.
2109 if (m_domWindow) 2109 if (m_domWindow)
2110 m_domWindow->clearEventQueue(); 2110 m_domWindow->clearEventQueue();
2111 2111
2112 RenderView* renderView = m_renderView; 2112 RenderView* renderView = m_renderView;
2113 2113
2114 if (renderView) 2114 if (renderView)
2115 renderView->setIsInWindow(false); 2115 renderView->setIsInWindow(false);
2116 2116
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
2453 HTMLLinkElement::dispatchPendingLoadEvents(); 2453 HTMLLinkElement::dispatchPendingLoadEvents();
2454 HTMLStyleElement::dispatchPendingLoadEvents(); 2454 HTMLStyleElement::dispatchPendingLoadEvents();
2455 } 2455 }
2456 2456
2457 // JS running below could remove the frame or destroy the RenderView so we c all 2457 // JS running below could remove the frame or destroy the RenderView so we c all
2458 // those two functions repeatedly and don't save them on the stack. 2458 // those two functions repeatedly and don't save them on the stack.
2459 2459
2460 // To align the HTML load event and the SVGLoad event for the outermost <svg > element, fire it from 2460 // To align the HTML load event and the SVGLoad event for the outermost <svg > element, fire it from
2461 // here, instead of doing it from SVGElement::finishedParsingChildren. 2461 // here, instead of doing it from SVGElement::finishedParsingChildren.
2462 if (svgExtensions()) 2462 if (svgExtensions())
2463 accessSVGExtensions()->dispatchSVGLoadEventToOutermostSVGElements(); 2463 accessSVGExtensions().dispatchSVGLoadEventToOutermostSVGElements();
2464 2464
2465 if (protectedWindow) 2465 if (protectedWindow)
2466 protectedWindow->documentWasClosed(); 2466 protectedWindow->documentWasClosed();
2467 2467
2468 if (frame()) { 2468 if (frame()) {
2469 frame()->loader().client()->dispatchDidHandleOnloadEvents(); 2469 frame()->loader().client()->dispatchDidHandleOnloadEvents();
2470 loader()->applicationCacheHost()->stopDeferringEvents(); 2470 loader()->applicationCacheHost()->stopDeferringEvents();
2471 } 2471 }
2472 2472
2473 if (!frame()) { 2473 if (!frame()) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 cache->postNotification(renderView(), AXObjectCache::AXLoadCompl ete, true); 2510 cache->postNotification(renderView(), AXObjectCache::AXLoadCompl ete, true);
2511 } else { 2511 } else {
2512 // AXLoadComplete can only be posted on the top document, so if it's a document 2512 // AXLoadComplete can only be posted on the top document, so if it's a document
2513 // in an iframe that just finished loading, post AXLayoutComplet e instead. 2513 // in an iframe that just finished loading, post AXLayoutComplet e instead.
2514 cache->postNotification(renderView(), AXObjectCache::AXLayoutCom plete, true); 2514 cache->postNotification(renderView(), AXObjectCache::AXLayoutCom plete, true);
2515 } 2515 }
2516 } 2516 }
2517 } 2517 }
2518 2518
2519 if (svgExtensions()) 2519 if (svgExtensions())
2520 accessSVGExtensions()->startAnimations(); 2520 accessSVGExtensions().startAnimations();
2521 } 2521 }
2522 2522
2523 bool Document::dispatchBeforeUnloadEvent(Chrome& chrome, bool& didAllowNavigatio n) 2523 bool Document::dispatchBeforeUnloadEvent(Chrome& chrome, bool& didAllowNavigatio n)
2524 { 2524 {
2525 if (!m_domWindow) 2525 if (!m_domWindow)
2526 return true; 2526 return true;
2527 2527
2528 if (!body()) 2528 if (!body())
2529 return true; 2529 return true;
2530 2530
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
4338 QualifiedName qName(prefix, localName, nullAtom); 4338 QualifiedName qName(prefix, localName, nullAtom);
4339 4339
4340 return Attr::create(*this, qName, emptyAtom); 4340 return Attr::create(*this, qName, emptyAtom);
4341 } 4341 }
4342 4342
4343 const SVGDocumentExtensions* Document::svgExtensions() 4343 const SVGDocumentExtensions* Document::svgExtensions()
4344 { 4344 {
4345 return m_svgExtensions.get(); 4345 return m_svgExtensions.get();
4346 } 4346 }
4347 4347
4348 SVGDocumentExtensions* Document::accessSVGExtensions() 4348 SVGDocumentExtensions& Document::accessSVGExtensions()
4349 { 4349 {
4350 if (!m_svgExtensions) 4350 if (!m_svgExtensions)
4351 m_svgExtensions = adoptPtr(new SVGDocumentExtensions(this)); 4351 m_svgExtensions = adoptPtr(new SVGDocumentExtensions(this));
4352 return m_svgExtensions.get(); 4352 return *m_svgExtensions;
4353 } 4353 }
4354 4354
4355 bool Document::hasSVGRootNode() const 4355 bool Document::hasSVGRootNode() const
4356 { 4356 {
4357 return documentElement() && documentElement()->hasTagName(SVGNames::svgTag); 4357 return documentElement() && documentElement()->hasTagName(SVGNames::svgTag);
4358 } 4358 }
4359 4359
4360 PassRefPtr<HTMLCollection> Document::ensureCachedCollection(CollectionType type) 4360 PassRefPtr<HTMLCollection> Document::ensureCachedCollection(CollectionType type)
4361 { 4361 {
4362 return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(this, typ e); 4362 return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(this, typ e);
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
5438 void Document::defaultEventHandler(Event* event) 5438 void Document::defaultEventHandler(Event* event)
5439 { 5439 {
5440 if (frame() && frame()->remotePlatformLayer()) { 5440 if (frame() && frame()->remotePlatformLayer()) {
5441 frame()->chromeClient().forwardInputEvent(this, event); 5441 frame()->chromeClient().forwardInputEvent(this, event);
5442 return; 5442 return;
5443 } 5443 }
5444 Node::defaultEventHandler(event); 5444 Node::defaultEventHandler(event);
5445 } 5445 }
5446 5446
5447 } // namespace WebCore 5447 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698