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

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

Issue 26852004: Have NodeRareData's ensureNodeLists() / ensureMutationObserverData() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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.cpp ('k') | Source/core/dom/Node.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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2991 matching lines...) Expand 10 before | Expand all | Expand 10 after
3002 } 3002 }
3003 3003
3004 PassRefPtr<HTMLCollection> Element::ensureCachedHTMLCollection(CollectionType ty pe) 3004 PassRefPtr<HTMLCollection> Element::ensureCachedHTMLCollection(CollectionType ty pe)
3005 { 3005 {
3006 if (HTMLCollection* collection = cachedHTMLCollection(type)) 3006 if (HTMLCollection* collection = cachedHTMLCollection(type))
3007 return collection; 3007 return collection;
3008 3008
3009 RefPtr<HTMLCollection> collection; 3009 RefPtr<HTMLCollection> collection;
3010 if (type == TableRows) { 3010 if (type == TableRows) {
3011 ASSERT(hasTagName(tableTag)); 3011 ASSERT(hasTagName(tableTag));
3012 return ensureRareData().ensureNodeLists()->addCacheWithAtomicName<HTMLTa bleRowsCollection>(this, type); 3012 return ensureRareData().ensureNodeLists().addCacheWithAtomicName<HTMLTab leRowsCollection>(this, type);
3013 } else if (type == SelectOptions) { 3013 } else if (type == SelectOptions) {
3014 ASSERT(hasTagName(selectTag)); 3014 ASSERT(hasTagName(selectTag));
3015 return ensureRareData().ensureNodeLists()->addCacheWithAtomicName<HTMLOp tionsCollection>(this, type); 3015 return ensureRareData().ensureNodeLists().addCacheWithAtomicName<HTMLOpt ionsCollection>(this, type);
3016 } else if (type == FormControls) { 3016 } else if (type == FormControls) {
3017 ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag)); 3017 ASSERT(hasTagName(formTag) || hasTagName(fieldsetTag));
3018 return ensureRareData().ensureNodeLists()->addCacheWithAtomicName<HTMLFo rmControlsCollection>(this, type); 3018 return ensureRareData().ensureNodeLists().addCacheWithAtomicName<HTMLFor mControlsCollection>(this, type);
3019 } 3019 }
3020 return ensureRareData().ensureNodeLists()->addCacheWithAtomicName<HTMLCollec tion>(this, type); 3020 return ensureRareData().ensureNodeLists().addCacheWithAtomicName<HTMLCollect ion>(this, type);
3021 } 3021 }
3022 3022
3023 static void scheduleLayerUpdateCallback(Node* node) 3023 static void scheduleLayerUpdateCallback(Node* node)
3024 { 3024 {
3025 // Notify the renderer even is the styles are identical since it may need to 3025 // Notify the renderer even is the styles are identical since it may need to
3026 // create or destroy a RenderLayer. 3026 // create or destroy a RenderLayer.
3027 node->setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer); 3027 node->setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer);
3028 } 3028 }
3029 3029
3030 void Element::scheduleLayerUpdate() 3030 void Element::scheduleLayerUpdate()
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
3739 return 0; 3739 return 0;
3740 } 3740 }
3741 3741
3742 Attribute* UniqueElementData::attributeItem(unsigned index) 3742 Attribute* UniqueElementData::attributeItem(unsigned index)
3743 { 3743 {
3744 ASSERT_WITH_SECURITY_IMPLICATION(index < length()); 3744 ASSERT_WITH_SECURITY_IMPLICATION(index < length());
3745 return &m_attributeVector.at(index); 3745 return &m_attributeVector.at(index);
3746 } 3746 }
3747 3747
3748 } // namespace WebCore 3748 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698