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

Side by Side Diff: third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.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 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 DECLARE_VIRTUAL_TRACE(); 46 DECLARE_VIRTUAL_TRACE();
47 47
48 private: 48 private:
49 CSSRule* parentRule() const override { return 0; } 49 CSSRule* parentRule() const override { return 0; }
50 unsigned length() const final; 50 unsigned length() const final;
51 String item(unsigned index) const final; 51 String item(unsigned index) const final;
52 String getPropertyValue(const String& propertyName) final; 52 String getPropertyValue(const String& propertyName) final;
53 String getPropertyPriority(const String& propertyName) final; 53 String getPropertyPriority(const String& propertyName) final;
54 String getPropertyShorthand(const String& propertyName) final; 54 String getPropertyShorthand(const String& propertyName) final;
55 bool isPropertyImplicit(const String& propertyName) final; 55 bool isPropertyImplicit(const String& propertyName) final;
56 void setProperty(const String& propertyName, 56 void setProperty(const ExecutionContext*,
57 const String& propertyName,
57 const String& value, 58 const String& value,
58 const String& priority, 59 const String& priority,
59 ExceptionState&) final; 60 ExceptionState&) final;
60 String removeProperty(const String& propertyName, ExceptionState&) final; 61 String removeProperty(const String& propertyName, ExceptionState&) final;
61 String cssFloat() const; 62 String cssFloat() const;
62 void setCSSFloat(const String&, ExceptionState&); 63 void setCSSFloat(const String&, ExceptionState&);
63 String cssText() const final; 64 String cssText() const final;
64 void setCSSText(const String&, ExceptionState&) final; 65 void setCSSText(const String&, ExceptionState&) final;
65 const CSSValue* getPropertyCSSValueInternal(CSSPropertyID) final; 66 const CSSValue* getPropertyCSSValueInternal(CSSPropertyID) final;
66 const CSSValue* getPropertyCSSValueInternal( 67 const CSSValue* getPropertyCSSValueInternal(
67 AtomicString customPropertyName) final; 68 AtomicString customPropertyName) final;
68 String getPropertyValueInternal(CSSPropertyID) final; 69 String getPropertyValueInternal(CSSPropertyID) final;
69 void setPropertyInternal(CSSPropertyID, 70 void setPropertyInternal(CSSPropertyID,
70 const String& customPropertyName, 71 const String& customPropertyName,
71 const String& value, 72 const String& value,
72 bool important, 73 bool important,
74 const ExecutionContext*,
73 ExceptionState&) final; 75 ExceptionState&) final;
74 76
75 bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const final; 77 bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const final;
76 78
77 protected: 79 protected:
78 enum MutationType { NoChanges, PropertyChanged }; 80 enum MutationType { NoChanges, PropertyChanged };
79 virtual void willMutate() {} 81 virtual void willMutate() {}
80 virtual void didMutate(MutationType) {} 82 virtual void didMutate(MutationType) {}
81 virtual MutableStylePropertySet& propertySet() const = 0; 83 virtual MutableStylePropertySet& propertySet() const = 0;
82 virtual bool isKeyframeStyle() const { return false; } 84 virtual bool isKeyframeStyle() const { return false; }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 Element* parentElement() const override { return m_parentElement; } 141 Element* parentElement() const override { return m_parentElement; }
140 142
141 void didMutate(MutationType) override; 143 void didMutate(MutationType) override;
142 144
143 Member<Element> m_parentElement; 145 Member<Element> m_parentElement;
144 }; 146 };
145 147
146 } // namespace blink 148 } // namespace blink
147 149
148 #endif 150 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698