Commit 9f8575b7 authored by Mostyn Bramley-Moore's avatar Mostyn Bramley-Moore Committed by Commit Bot

[jumbo] make IsValidCoordinate functions into static members

This should avoid the following jumbo build error:

./../../third_party/WebKit/Source/core/css/cssom/CSSScale.cpp:14:6: error: redefinition of 'IsValidCoordinate'
bool IsValidCoordinate(CSSNumericValue* value) {
     ^
./../../third_party/WebKit/Source/core/css/cssom/CSSPositionValue.cpp:15:6: note: previous definition is here
bool IsValidCoordinate(CSSNumericValue* v) {
     ^

BUG=789370

Change-Id: I13f1540c9969d4ff34420fcfda831687c4580555
Reviewed-on: https://chromium-review.googlesource.com/822199Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@vewd.com>
Cr-Commit-Position: refs/heads/master@{#523732}
parent 1e7d9ec8
......@@ -10,15 +10,6 @@
namespace blink {
namespace {
bool IsValidCoordinate(CSSNumericValue* v) {
return v->Type().MatchesBaseTypePercentage(
CSSNumericValueType::BaseType::kLength);
}
} // namespace
CSSPositionValue* CSSPositionValue::Create(CSSNumericValue* x,
CSSNumericValue* y,
ExceptionState& exception_state) {
......@@ -62,4 +53,10 @@ const CSSValue* CSSPositionValue::ToCSSValue(
CSSValuePair::kKeepIdenticalValues);
}
// static
bool CSSPositionValue::IsValidCoordinate(CSSNumericValue* coord) {
return coord->Type().MatchesBaseTypePercentage(
CSSNumericValueType::BaseType::kLength);
}
} // namespace blink
......@@ -41,6 +41,9 @@ class CORE_EXPORT CSSPositionValue final : public CSSStyleValue {
CSSStyleValue::Trace(visitor);
}
private:
static bool IsValidCoordinate(CSSNumericValue* coord);
protected:
CSSPositionValue(CSSNumericValue* x, CSSNumericValue* y) : x_(x), y_(y) {}
......
......@@ -11,10 +11,6 @@ namespace blink {
namespace {
bool IsValidCoordinate(CSSNumericValue* value) {
return value && value->Type().MatchesNumber();
}
CSSScale* FromScale(const CSSFunctionValue& value) {
DCHECK(value.length() == 1U || value.length() == 2U);
CSSNumericValue* x =
......@@ -179,4 +175,9 @@ CSSScale::CSSScale(CSSNumericValue* x,
DCHECK(IsValidCoordinate(z));
}
// static
bool CSSScale::IsValidCoordinate(CSSNumericValue* coord) {
return coord && coord->Type().MatchesNumber();
}
} // namespace blink
......@@ -71,6 +71,9 @@ class CORE_EXPORT CSSScale final : public CSSTransformComponent {
Member<CSSNumericValue> x_;
Member<CSSNumericValue> y_;
Member<CSSNumericValue> z_;
static bool IsValidCoordinate(CSSNumericValue* coord);
DISALLOW_COPY_AND_ASSIGN(CSSScale);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment