OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ImmutableStylePropertyMap_h | 5 #ifndef ImmutableStylePropertyMap_h |
6 #define ImmutableStylePropertyMap_h | 6 #define ImmutableStylePropertyMap_h |
7 | 7 |
8 #include "core/css/cssom/StylePropertyMap.h" | 8 #include "core/css/cssom/StylePropertyMap.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class CORE_EXPORT ImmutableStylePropertyMap : public StylePropertyMap { | 12 class CORE_EXPORT ImmutableStylePropertyMap : public StylePropertyMap { |
13 WTF_MAKE_NONCOPYABLE(ImmutableStylePropertyMap); | 13 WTF_MAKE_NONCOPYABLE(ImmutableStylePropertyMap); |
14 public: | 14 public: |
15 void set(CSSPropertyID, StyleValueOrStyleValueSequenceOrString&, ExceptionSt
ate& exceptionState) override | 15 void set(CSSPropertyID, StyleValueOrStyleValueSequenceOrString&, ExceptionSt
ate& exceptionState) override |
16 { | 16 { |
17 exceptionState.throwTypeError("This StylePropertyMap is immutable."); | 17 exceptionState.throwTypeError("This StylePropertyMap is immutable."); |
18 } | 18 } |
19 | 19 |
20 void append(CSSPropertyID, StyleValueOrStyleValueSequenceOrString&, Exceptio
nState& exceptionState) override | 20 void append(CSSPropertyID, StyleValueOrStyleValueSequenceOrString&, Exceptio
nState& exceptionState) override |
21 { | 21 { |
22 exceptionState.throwTypeError("This StylePropertyMap is immutable."); | 22 exceptionState.throwTypeError("This StylePropertyMap is immutable."); |
23 } | 23 } |
24 | 24 |
25 void remove(CSSPropertyID, ExceptionState& exceptionState) override | 25 void remove(CSSPropertyID, ExceptionState& exceptionState) override |
26 { | 26 { |
27 exceptionState.throwTypeError("This StylePropertyMap is immutable."); | 27 exceptionState.throwTypeError("This StylePropertyMap is immutable."); |
28 } | 28 } |
| 29 |
| 30 protected: |
| 31 ImmutableStylePropertyMap() |
| 32 : StylePropertyMap() { } |
29 }; | 33 }; |
30 | 34 |
31 } // namespace blink | 35 } // namespace blink |
32 | 36 |
33 #endif | 37 #endif |
OLD | NEW |