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

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

Issue 176933013: Pass rootNode by reference when constructing node lists / collections (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 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/ContainerNode.cpp ('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 4347 matching lines...) Expand 10 before | Expand all | Expand 10 after
4358 return *m_svgExtensions; 4358 return *m_svgExtensions;
4359 } 4359 }
4360 4360
4361 bool Document::hasSVGRootNode() const 4361 bool Document::hasSVGRootNode() const
4362 { 4362 {
4363 return documentElement() && documentElement()->hasTagName(SVGNames::svgTag); 4363 return documentElement() && documentElement()->hasTagName(SVGNames::svgTag);
4364 } 4364 }
4365 4365
4366 PassRefPtr<HTMLCollection> Document::ensureCachedCollection(CollectionType type) 4366 PassRefPtr<HTMLCollection> Document::ensureCachedCollection(CollectionType type)
4367 { 4367 {
4368 return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(this, typ e); 4368 return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(*this, ty pe);
4369 } 4369 }
4370 4370
4371 PassRefPtr<HTMLCollection> Document::images() 4371 PassRefPtr<HTMLCollection> Document::images()
4372 { 4372 {
4373 return ensureCachedCollection(DocImages); 4373 return ensureCachedCollection(DocImages);
4374 } 4374 }
4375 4375
4376 PassRefPtr<HTMLCollection> Document::applets() 4376 PassRefPtr<HTMLCollection> Document::applets()
4377 { 4377 {
4378 return ensureCachedCollection(DocApplets); 4378 return ensureCachedCollection(DocApplets);
(...skipping 25 matching lines...) Expand all
4404 } 4404 }
4405 4405
4406 PassRefPtr<HTMLCollection> Document::allForBinding() 4406 PassRefPtr<HTMLCollection> Document::allForBinding()
4407 { 4407 {
4408 UseCounter::count(*this, UseCounter::DocumentAll); 4408 UseCounter::count(*this, UseCounter::DocumentAll);
4409 return all(); 4409 return all();
4410 } 4410 }
4411 4411
4412 PassRefPtr<HTMLCollection> Document::all() 4412 PassRefPtr<HTMLCollection> Document::all()
4413 { 4413 {
4414 return ensureRareData().ensureNodeLists().addCache<HTMLAllCollection>(this, DocAll); 4414 return ensureRareData().ensureNodeLists().addCache<HTMLAllCollection>(*this, DocAll);
4415 } 4415 }
4416 4416
4417 PassRefPtr<HTMLCollection> Document::windowNamedItems(const AtomicString& name) 4417 PassRefPtr<HTMLCollection> Document::windowNamedItems(const AtomicString& name)
4418 { 4418 {
4419 return ensureRareData().ensureNodeLists().addCache<HTMLNameCollection>(this, WindowNamedItems, name); 4419 return ensureRareData().ensureNodeLists().addCache<HTMLNameCollection>(*this , WindowNamedItems, name);
4420 } 4420 }
4421 4421
4422 PassRefPtr<HTMLCollection> Document::documentNamedItems(const AtomicString& name ) 4422 PassRefPtr<HTMLCollection> Document::documentNamedItems(const AtomicString& name )
4423 { 4423 {
4424 return ensureRareData().ensureNodeLists().addCache<HTMLNameCollection>(this, DocumentNamedItems, name); 4424 return ensureRareData().ensureNodeLists().addCache<HTMLNameCollection>(*this , DocumentNamedItems, name);
4425 } 4425 }
4426 4426
4427 void Document::finishedParsing() 4427 void Document::finishedParsing()
4428 { 4428 {
4429 ASSERT(!scriptableDocumentParser() || !m_parser->isParsing()); 4429 ASSERT(!scriptableDocumentParser() || !m_parser->isParsing());
4430 ASSERT(!scriptableDocumentParser() || m_readyState != Loading); 4430 ASSERT(!scriptableDocumentParser() || m_readyState != Loading);
4431 setParsing(false); 4431 setParsing(false);
4432 if (!m_documentTiming.domContentLoadedEventStart) 4432 if (!m_documentTiming.domContentLoadedEventStart)
4433 m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTim e(); 4433 m_documentTiming.domContentLoadedEventStart = monotonicallyIncreasingTim e();
4434 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded)); 4434 dispatchEvent(Event::createBubble(EventTypeNames::DOMContentLoaded));
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
5449 void Document::defaultEventHandler(Event* event) 5449 void Document::defaultEventHandler(Event* event)
5450 { 5450 {
5451 if (frame() && frame()->remotePlatformLayer()) { 5451 if (frame() && frame()->remotePlatformLayer()) {
5452 frame()->chromeClient().forwardInputEvent(this, event); 5452 frame()->chromeClient().forwardInputEvent(this, event);
5453 return; 5453 return;
5454 } 5454 }
5455 Node::defaultEventHandler(event); 5455 Node::defaultEventHandler(event);
5456 } 5456 }
5457 5457
5458 } // namespace WebCore 5458 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698