| Index: third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadonly.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadonly.cpp
|
| similarity index 55%
|
| copy from third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
|
| copy to third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadonly.cpp
|
| index 4e56ef6b250774a22471ecd668928a39b76a75f5..10be8c3120485252880f978c7dc5cb8ef377e24d 100644
|
| --- a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
|
| +++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadonly.cpp
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "core/css/cssom/StylePropertyMap.h"
|
| +#include "core/css/cssom/StylePropertyMapReadonly.h"
|
|
|
| #include "bindings/core/v8/ExceptionState.h"
|
| #include "core/css/CSSValueList.h"
|
| @@ -19,7 +19,7 @@ class StylePropertyMapIterationSource final
|
| IterationSource {
|
| public:
|
| explicit StylePropertyMapIterationSource(
|
| - HeapVector<StylePropertyMap::StylePropertyMapEntry> values)
|
| + HeapVector<StylePropertyMapReadonly::StylePropertyMapEntry> values)
|
| : m_index(0), m_values(values) {}
|
|
|
| bool next(ScriptState*,
|
| @@ -29,7 +29,7 @@ class StylePropertyMapIterationSource final
|
| if (m_index >= m_values.size())
|
| return false;
|
|
|
| - const StylePropertyMap::StylePropertyMapEntry& pair =
|
| + const StylePropertyMapReadonly::StylePropertyMapEntry& pair =
|
| m_values.at(m_index++);
|
| key = pair.first;
|
| value = pair.second;
|
| @@ -44,13 +44,13 @@ class StylePropertyMapIterationSource final
|
|
|
| private:
|
| size_t m_index;
|
| - const HeapVector<StylePropertyMap::StylePropertyMapEntry> m_values;
|
| + const HeapVector<StylePropertyMapReadonly::StylePropertyMapEntry> m_values;
|
| };
|
|
|
| } // namespace
|
|
|
| -CSSStyleValue* StylePropertyMap::get(const String& propertyName,
|
| - ExceptionState& exceptionState) {
|
| +CSSStyleValue* StylePropertyMapReadonly::get(const String& propertyName,
|
| + ExceptionState& exceptionState) {
|
| CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| if (propertyID == CSSPropertyInvalid || propertyID == CSSPropertyVariable) {
|
| // TODO(meade): Handle custom properties here.
|
| @@ -65,8 +65,9 @@ CSSStyleValue* StylePropertyMap::get(const String& propertyName,
|
| return styleVector[0];
|
| }
|
|
|
| -CSSStyleValueVector StylePropertyMap::getAll(const String& propertyName,
|
| - ExceptionState& exceptionState) {
|
| +CSSStyleValueVector StylePropertyMapReadonly::getAll(
|
| + const String& propertyName,
|
| + ExceptionState& exceptionState) {
|
| CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| if (propertyID != CSSPropertyInvalid && propertyID != CSSPropertyVariable)
|
| return getAllInternal(propertyID);
|
| @@ -76,8 +77,8 @@ CSSStyleValueVector StylePropertyMap::getAll(const String& propertyName,
|
| return CSSStyleValueVector();
|
| }
|
|
|
| -bool StylePropertyMap::has(const String& propertyName,
|
| - ExceptionState& exceptionState) {
|
| +bool StylePropertyMapReadonly::has(const String& propertyName,
|
| + ExceptionState& exceptionState) {
|
| CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| if (propertyID != CSSPropertyInvalid && propertyID != CSSPropertyVariable)
|
| return !getAllInternal(propertyID).isEmpty();
|
| @@ -87,45 +88,8 @@ bool StylePropertyMap::has(const String& propertyName,
|
| return false;
|
| }
|
|
|
| -void StylePropertyMap::set(const String& propertyName,
|
| - CSSStyleValueOrCSSStyleValueSequenceOrString& item,
|
| - ExceptionState& exceptionState) {
|
| - CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| - if (propertyID != CSSPropertyInvalid && propertyID != CSSPropertyVariable) {
|
| - set(propertyID, item, exceptionState);
|
| - return;
|
| - }
|
| - // TODO(meade): Handle custom properties here.
|
| - exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| -}
|
| -
|
| -void StylePropertyMap::append(
|
| - const String& propertyName,
|
| - CSSStyleValueOrCSSStyleValueSequenceOrString& item,
|
| - ExceptionState& exceptionState) {
|
| - CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| - if (propertyID != CSSPropertyInvalid && propertyID != CSSPropertyVariable) {
|
| - append(propertyID, item, exceptionState);
|
| - return;
|
| - }
|
| - // TODO(meade): Handle custom properties here.
|
| - exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| -}
|
| -
|
| -void StylePropertyMap::remove(const String& propertyName,
|
| - ExceptionState& exceptionState) {
|
| - CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| - if (propertyID != CSSPropertyInvalid && propertyID != CSSPropertyVariable) {
|
| - remove(propertyID, exceptionState);
|
| - return;
|
| - }
|
| - // TODO(meade): Handle custom properties here.
|
| - exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| -}
|
| -
|
| -StylePropertyMap::IterationSource* StylePropertyMap::startIteration(
|
| - ScriptState*,
|
| - ExceptionState&) {
|
| +StylePropertyMapReadonly::IterationSource*
|
| +StylePropertyMapReadonly::startIteration(ScriptState*, ExceptionState&) {
|
| return new StylePropertyMapIterationSource(getIterationEntries());
|
| }
|
|
|
|
|