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

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

Issue 2607403002: Disallow setting invalid values for registered properties via CSSOM (Closed)
Patch Set: fix comments Created 3 years, 11 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
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 20 matching lines...) Expand all
31 #include "wtf/Noncopyable.h" 31 #include "wtf/Noncopyable.h"
32 #include "wtf/Vector.h" 32 #include "wtf/Vector.h"
33 #include "wtf/text/WTFString.h" 33 #include "wtf/text/WTFString.h"
34 #include <algorithm> 34 #include <algorithm>
35 35
36 namespace blink { 36 namespace blink {
37 37
38 class CSSStyleDeclaration; 38 class CSSStyleDeclaration;
39 class ImmutableStylePropertySet; 39 class ImmutableStylePropertySet;
40 class MutableStylePropertySet; 40 class MutableStylePropertySet;
41 class PropertyRegistry;
41 class StyleSheetContents; 42 class StyleSheetContents;
42 43
43 class CORE_EXPORT StylePropertySet 44 class CORE_EXPORT StylePropertySet
44 : public GarbageCollectedFinalized<StylePropertySet> { 45 : public GarbageCollectedFinalized<StylePropertySet> {
45 WTF_MAKE_NONCOPYABLE(StylePropertySet); 46 WTF_MAKE_NONCOPYABLE(StylePropertySet);
46 friend class PropertyReference; 47 friend class PropertyReference;
47 48
48 public: 49 public:
49 void finalizeGarbageCollectedObject(); 50 void finalizeGarbageCollectedObject();
50 51
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 struct SetResult { 228 struct SetResult {
228 bool didParse; 229 bool didParse;
229 bool didChange; 230 bool didChange;
230 }; 231 };
231 // These expand shorthand properties into multiple properties. 232 // These expand shorthand properties into multiple properties.
232 SetResult setProperty(CSSPropertyID unresolvedProperty, 233 SetResult setProperty(CSSPropertyID unresolvedProperty,
233 const String& value, 234 const String& value,
234 bool important = false, 235 bool important = false,
235 StyleSheetContents* contextStyleSheet = 0); 236 StyleSheetContents* contextStyleSheet = 0);
236 SetResult setProperty(const AtomicString& customPropertyName, 237 SetResult setProperty(const AtomicString& customPropertyName,
238 const PropertyRegistry*,
237 const String& value, 239 const String& value,
238 bool important, 240 bool important,
239 StyleSheetContents* contextStyleSheet, 241 StyleSheetContents* contextStyleSheet,
240 bool isAnimationTainted); 242 bool isAnimationTainted);
241 void setProperty(CSSPropertyID, const CSSValue&, bool important = false); 243 void setProperty(CSSPropertyID, const CSSValue&, bool important = false);
242 244
243 // These do not. FIXME: This is too messy, we can do better. 245 // These do not. FIXME: This is too messy, we can do better.
244 bool setProperty(CSSPropertyID, 246 bool setProperty(CSSPropertyID,
245 CSSValueID identifier, 247 CSSValueID identifier,
246 bool important = false); 248 bool important = false);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 template <typename T> 335 template <typename T>
334 inline int StylePropertySet::findPropertyIndex(T property) const { 336 inline int StylePropertySet::findPropertyIndex(T property) const {
335 if (m_isMutable) 337 if (m_isMutable)
336 return toMutableStylePropertySet(this)->findPropertyIndex(property); 338 return toMutableStylePropertySet(this)->findPropertyIndex(property);
337 return toImmutableStylePropertySet(this)->findPropertyIndex(property); 339 return toImmutableStylePropertySet(this)->findPropertyIndex(property);
338 } 340 }
339 341
340 } // namespace blink 342 } // namespace blink
341 343
342 #endif // StylePropertySet_h 344 #endif // StylePropertySet_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698