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

Side by Side Diff: Source/core/css/StylePropertySet.h

Issue 15923002: Move CSSOM classes to using MutableStylePropertySet over StylePropertySet. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 PassRefPtr<StylePropertySet> immutableCopyIfNeeded() const; 140 PassRefPtr<StylePropertySet> immutableCopyIfNeeded() const;
141 141
142 void removeEquivalentProperties(const StylePropertySet*); 142 void removeEquivalentProperties(const StylePropertySet*);
143 void removeEquivalentProperties(const CSSStyleDeclaration*); 143 void removeEquivalentProperties(const CSSStyleDeclaration*);
144 144
145 PassRefPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSProp ertyID>&) const; 145 PassRefPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSProp ertyID>&) const;
146 146
147 String asText() const; 147 String asText() const;
148 148
149 PropertySetCSSStyleDeclaration* cssStyleDeclaration(); 149 PropertySetCSSStyleDeclaration* cssStyleDeclaration();
150 CSSStyleDeclaration* ensureCSSStyleDeclaration();
151 CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(const StyledElement* pa rentElement);
152 150
153 bool isMutable() const { return m_isMutable; } 151 bool isMutable() const { return m_isMutable; }
154 bool hasCSSOMWrapper() const { return m_ownsCSSOMWrapper; } 152 bool hasCSSOMWrapper() const { return m_ownsCSSOMWrapper; }
155 153
156 bool hasFailedOrCanceledSubresources() const; 154 bool hasFailedOrCanceledSubresources() const;
157 155
158 static unsigned averageSizeInBytes(); 156 static unsigned averageSizeInBytes();
159 void reportMemoryUsage(MemoryObjectInfo*) const; 157 void reportMemoryUsage(MemoryObjectInfo*) const;
160 158
161 #ifndef NDEBUG 159 #ifndef NDEBUG
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 return reinterpret_cast<const StylePropertyMetadata*>(&reinterpret_cast<cons t char*>((&static_cast<const ImmutableStylePropertySet*>(this)->m_storage))[m_ar raySize * sizeof(CSSValue*)]); 219 return reinterpret_cast<const StylePropertyMetadata*>(&reinterpret_cast<cons t char*>((&static_cast<const ImmutableStylePropertySet*>(this)->m_storage))[m_ar raySize * sizeof(CSSValue*)]);
222 } 220 }
223 221
224 class MutableStylePropertySet : public StylePropertySet { 222 class MutableStylePropertySet : public StylePropertySet {
225 public: 223 public:
226 static PassRefPtr<MutableStylePropertySet> create(CSSParserMode = CSSQuirksM ode); 224 static PassRefPtr<MutableStylePropertySet> create(CSSParserMode = CSSQuirksM ode);
227 static PassRefPtr<MutableStylePropertySet> create(const CSSProperty* propert ies, unsigned count); 225 static PassRefPtr<MutableStylePropertySet> create(const CSSProperty* propert ies, unsigned count);
228 226
229 MutableStylePropertySet(const StylePropertySet&); 227 MutableStylePropertySet(const StylePropertySet&);
230 228
229 CSSStyleDeclaration* ensureCSSStyleDeclaration();
230 CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(const StyledElement* pa rentElement);
231
231 Vector<CSSProperty, 4> m_propertyVector; 232 Vector<CSSProperty, 4> m_propertyVector;
232 233
233 private: 234 private:
234 MutableStylePropertySet(CSSParserMode cssParserMode) 235 MutableStylePropertySet(CSSParserMode cssParserMode)
235 : StylePropertySet(cssParserMode) 236 : StylePropertySet(cssParserMode)
236 { } 237 { }
237 MutableStylePropertySet(const CSSProperty* properties, unsigned count); 238 MutableStylePropertySet(const CSSProperty* properties, unsigned count);
238 }; 239 };
239 240
240 inline Vector<CSSProperty, 4>& StylePropertySet::mutablePropertyVector() 241 inline Vector<CSSProperty, 4>& StylePropertySet::mutablePropertyVector()
(...skipping 27 matching lines...) Expand all
268 269
269 if (m_isMutable) 270 if (m_isMutable)
270 delete static_cast<MutableStylePropertySet*>(this); 271 delete static_cast<MutableStylePropertySet*>(this);
271 else 272 else
272 delete static_cast<ImmutableStylePropertySet*>(this); 273 delete static_cast<ImmutableStylePropertySet*>(this);
273 } 274 }
274 275
275 } // namespace WebCore 276 } // namespace WebCore
276 277
277 #endif // StylePropertySet_h 278 #endif // StylePropertySet_h
OLDNEW
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.cpp ('k') | Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698