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

Side by Side Diff: Source/core/dom/AttributeCollection.h

Issue 436603003: Make Element::attributes() less error-prone and simplify call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take feedback into consideration 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/css/SelectorChecker.cpp ('k') | Source/core/dom/DatasetDOMStringMap.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2014 Apple Inc. All rights reserved. 3 * Copyright (C) 2014 Apple Inc. All rights reserved.
4 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 private: 89 private:
90 const Attribute* m_array; 90 const Attribute* m_array;
91 unsigned m_size; 91 unsigned m_size;
92 }; 92 };
93 93
94 class AttributeCollection : public AttributeCollectionGeneric<const AttributeArr ay> { 94 class AttributeCollection : public AttributeCollectionGeneric<const AttributeArr ay> {
95 public: 95 public:
96 typedef iterator const_iterator; 96 typedef iterator const_iterator;
97 97
98 AttributeCollection()
99 : AttributeCollectionGeneric<const AttributeArray>(AttributeArray(nullpt r, 0))
100 { }
101
98 AttributeCollection(const Attribute* array, unsigned size) 102 AttributeCollection(const Attribute* array, unsigned size)
99 : AttributeCollectionGeneric<const AttributeArray>(AttributeArray(array, size)) 103 : AttributeCollectionGeneric<const AttributeArray>(AttributeArray(array, size))
100 { } 104 { }
101 }; 105 };
102 106
103 typedef Vector<Attribute, 4> AttributeVector; 107 typedef Vector<Attribute, 4> AttributeVector;
104 class MutableAttributeCollection : public AttributeCollectionGeneric<AttributeVe ctor, AttributeVector&> { 108 class MutableAttributeCollection : public AttributeCollectionGeneric<AttributeVe ctor, AttributeVector&> {
105 public: 109 public:
106 explicit MutableAttributeCollection(AttributeVector& attributes) 110 explicit MutableAttributeCollection(AttributeVector& attributes)
107 : AttributeCollectionGeneric<AttributeVector, AttributeVector&>(attribut es) 111 : AttributeCollectionGeneric<AttributeVector, AttributeVector&>(attribut es)
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (equalPossiblyIgnoringCase(name, it->name().toString(), shouldIgn oreAttributeCase)) 214 if (equalPossiblyIgnoringCase(name, it->name().toString(), shouldIgn oreAttributeCase))
211 return index; 215 return index;
212 } 216 }
213 } 217 }
214 return kNotFound; 218 return kNotFound;
215 } 219 }
216 220
217 } // namespace blink 221 } // namespace blink
218 222
219 #endif // AttributeCollection_h 223 #endif // AttributeCollection_h
OLDNEW
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/dom/DatasetDOMStringMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698