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

Side by Side Diff: Source/core/html/HTMLDataListElement.cpp

Issue 342283005: Make collection caching code more consistent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 6 years, 4 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/NodeListsNodeData.h ('k') | Source/core/html/HTMLFieldSetElement.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 16 matching lines...) Expand all
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #include "config.h" 32 #include "config.h"
33 #include "core/html/HTMLDataListElement.h" 33 #include "core/html/HTMLDataListElement.h"
34 34
35 #include "core/HTMLNames.h" 35 #include "core/HTMLNames.h"
36 #include "core/dom/IdTargetObserverRegistry.h" 36 #include "core/dom/IdTargetObserverRegistry.h"
37 #include "core/dom/NodeListsNodeData.h"
37 #include "core/frame/UseCounter.h" 38 #include "core/frame/UseCounter.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 inline HTMLDataListElement::HTMLDataListElement(Document& document) 42 inline HTMLDataListElement::HTMLDataListElement(Document& document)
42 : HTMLElement(HTMLNames::datalistTag, document) 43 : HTMLElement(HTMLNames::datalistTag, document)
43 { 44 {
44 ScriptWrappable::init(this); 45 ScriptWrappable::init(this);
45 } 46 }
46 47
47 PassRefPtrWillBeRawPtr<HTMLDataListElement> HTMLDataListElement::create(Document & document) 48 PassRefPtrWillBeRawPtr<HTMLDataListElement> HTMLDataListElement::create(Document & document)
48 { 49 {
49 UseCounter::count(document, UseCounter::DataListElement); 50 UseCounter::count(document, UseCounter::DataListElement);
50 return adoptRefWillBeNoop(new HTMLDataListElement(document)); 51 return adoptRefWillBeNoop(new HTMLDataListElement(document));
51 } 52 }
52 53
53 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLDataListElement::options() 54 PassRefPtrWillBeRawPtr<HTMLCollection> HTMLDataListElement::options()
54 { 55 {
55 return ensureCachedHTMLCollection(DataListOptions); 56 return ensureCachedCollection<HTMLCollection>(DataListOptions);
56 } 57 }
57 58
58 void HTMLDataListElement::childrenChanged(const ChildrenChange& change) 59 void HTMLDataListElement::childrenChanged(const ChildrenChange& change)
59 { 60 {
60 HTMLElement::childrenChanged(change); 61 HTMLElement::childrenChanged(change);
61 if (!change.byParser) 62 if (!change.byParser)
62 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute()) ; 63 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute()) ;
63 } 64 }
64 65
65 void HTMLDataListElement::finishParsingChildren() 66 void HTMLDataListElement::finishParsingChildren()
66 { 67 {
67 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute()); 68 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute());
68 } 69 }
69 70
70 void HTMLDataListElement::optionElementChildrenChanged() 71 void HTMLDataListElement::optionElementChildrenChanged()
71 { 72 {
72 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute()); 73 treeScope().idTargetObserverRegistry().notifyObservers(getIdAttribute());
73 } 74 }
74 75
75 } // namespace blink 76 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/NodeListsNodeData.h ('k') | Source/core/html/HTMLFieldSetElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698