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

Unified Diff: third_party/WebKit/Source/core/css/CSSValueList.h

Issue 2032243003: Make CSSValueList store const CSSValues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_make_computedstyledeclaration_return_const
Patch Set: Small fix n CSSOM Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSValueList.h
diff --git a/third_party/WebKit/Source/core/css/CSSValueList.h b/third_party/WebKit/Source/core/css/CSSValueList.h
index 64e528d86f5d9123ff1dbc13d02501417d43b39b..6810df2e498b680a27690431d246b9ac3ee8b2b1 100644
--- a/third_party/WebKit/Source/core/css/CSSValueList.h
+++ b/third_party/WebKit/Source/core/css/CSSValueList.h
@@ -31,8 +31,8 @@ namespace blink {
class CORE_EXPORT CSSValueList : public CSSValue {
WTF_MAKE_NONCOPYABLE(CSSValueList);
public:
- using iterator = HeapVector<Member<CSSValue>, 4>::iterator;
- using const_iterator = HeapVector<Member<CSSValue>, 4>::const_iterator;
+ using iterator = HeapVector<Member<const CSSValue>, 4>::iterator;
+ using const_iterator = HeapVector<Member<const CSSValue>, 4>::const_iterator;
static CSSValueList* createCommaSeparated()
{
@@ -53,14 +53,11 @@ public:
const_iterator end() const { return m_values.end(); }
size_t length() const { return m_values.size(); }
- // TODO(sashab): Remove the non-const item() method.
- CSSValue* item(size_t index) { return m_values[index].get(); }
const CSSValue* item(size_t index) const { return m_values[index].get(); }
- // TODO(sashab): Remove these methods.
- CSSValue* itemWithBoundsCheck(size_t index) { return index < m_values.size() ? m_values[index].get() : nullptr; }
+ // TODO(sashab): Remove this method.
const CSSValue* itemWithBoundsCheck(size_t index) const { return index < m_values.size() ? m_values[index].get() : nullptr; }
- void append(CSSValue* value) { m_values.append(value); }
+ void append(const CSSValue* value) { m_values.append(value); }
bool removeAll(const CSSValue&);
bool hasValue(const CSSValue&) const;
CSSValueList* copy() const;
@@ -78,7 +75,7 @@ protected:
private:
explicit CSSValueList(ValueListSeparator);
- HeapVector<Member<CSSValue>, 4> m_values;
+ HeapVector<Member<const CSSValue>, 4> m_values;
};
DEFINE_CSS_VALUE_TYPE_CASTS(CSSValueList, isValueList());
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageValue.h ('k') | third_party/WebKit/Source/core/css/CSSValueList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698