| Index: third_party/WebKit/Source/core/css/cssom/CSSOMTypes.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/cssom/CSSOMTypes.cpp b/third_party/WebKit/Source/core/css/cssom/CSSOMTypes.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..043ff617033e623326ca8877108fda0a8f9b32d2
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/css/cssom/CSSOMTypes.cpp
|
| @@ -0,0 +1,54 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "core/css/cssom/CSSOMTypes.h"
|
| +
|
| +#include "core/css/cssom/KeywordValue.h"
|
| +#include "core/css/cssom/LengthValue.h"
|
| +
|
| +namespace blink {
|
| +
|
| +bool CSSOMTypes::propertyCanTake(CSSPropertyID id, const StyleValue& styleValue)
|
| +{
|
| + StyleValue::StyleValueType type = styleValue.type();
|
| +
|
| + if (type == StyleValue::KeywordValueType)
|
| + return validKeywordForProperty(id, toKeywordValue(styleValue));
|
| +
|
| + switch (id) {
|
| + case CSSPropertyHeight:
|
| + case CSSPropertyWidth:
|
| + case CSSPropertyMinHeight:
|
| + case CSSPropertyMinWidth:
|
| + case CSSPropertyMaxHeight:
|
| + case CSSPropertyMaxWidth:
|
| + case CSSPropertyBackgroundPosition:
|
| + case CSSPropertyBackgroundPositionY:
|
| + if (type != StyleValue::SimpleLengthType && type != StyleValue::CalcLengthType)
|
| + return false;
|
| + return (!toLengthValue(styleValue).containsPercent() || propertySupportsPercentage(id));
|
| + default:
|
| + return false;
|
| + }
|
| +}
|
| +
|
| +bool CSSOMTypes::propertySupportsPercentage(CSSPropertyID id)
|
| +{
|
| + // TODO(meade): Implement.
|
| + return false;
|
| +}
|
| +
|
| +bool CSSOMTypes::validKeywordForProperty(CSSPropertyID id, const KeywordValue& keyword)
|
| +{
|
| + // TODO(meade): Implement.
|
| + return false;
|
| +}
|
| +
|
| +bool CSSOMTypes::propertySupportsMultiple(CSSPropertyID id)
|
| +{
|
| + // TODO(meade): Implement.
|
| + return false;
|
| +}
|
| +
|
| +} // namespace blink
|
|
|