Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp |
| diff --git a/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0e2c929164b9c23fc73a39359870d00c388363a9 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2016 the chromium authors. All rights reserved. |
|
Timothy Loh
2016/04/15 04:16:07
some capitalization got lost here
meade_UTC10
2016/04/27 05:53:56
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "core/css/cssom/ComputedStylePropertyMap.h" |
| + |
| +#include "core/css/CSSComputedStyleDeclaration.h" |
| +#include "core/css/cssom/StyleValueFactory.h" |
| + |
| +namespace blink { |
| + |
| +StylePropertyMap::StyleValueVector ComputedStylePropertyMap::getAll(CSSPropertyID propertyID) |
| +{ |
| + ASSERT(propertyID != CSSPropertyInvalid); |
|
Timothy Loh
2016/04/15 04:16:07
let's remove these as discussed onthe other patch
meade_UTC10
2016/04/27 05:53:56
Done.
|
| + |
| + CSSValue* cssValue = m_computedStyleDeclaration->getPropertyCSSValueInternal(propertyID); |
| + return cssValueToStyleValueVector(propertyID, *cssValue); |
| +} |
| + |
| +bool ComputedStylePropertyMap::has(CSSPropertyID propertyID) |
| +{ |
| + ASSERT(propertyID != CSSPropertyInvalid); |
| + |
| + CSSValue* cssValue = m_computedStyleDeclaration->getPropertyCSSValueInternal(propertyID); |
| + if (!cssValue) |
| + return false; |
| + |
| + return (!cssValue->isValueList() || toCSSValueList(cssValue)->length() > 0); |
| +} |
| + |
| +Vector<String> ComputedStylePropertyMap::getProperties() |
| +{ |
| + Vector<String> result; |
| + for (unsigned i = 0; i < m_computedStyleDeclaration->length(); i++) { |
| + result.append(m_computedStyleDeclaration->item(i)); |
| + } |
| + return result; |
| +} |
| + |
| +} // namespace blink |