Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSSimpleLength.h

Issue 2373233002: Add fromCSSValue methods to LengthValue subclasses, remove extra method in CSSSimpleLength. (Closed)
Patch Set: Update test expectations, remove extra includes and unused args Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/cssom/CSSSimpleLength.h
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSSimpleLength.h b/third_party/WebKit/Source/core/css/cssom/CSSSimpleLength.h
index 7983f4e70a601bbbf8fe39bcbbeca24a0ba7368a..18ec13bf70114c288f8109c138e54d35f52d6340 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSSimpleLength.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSSimpleLength.h
@@ -5,31 +5,23 @@
#ifndef CSSSimpleLength_h
#define CSSSimpleLength_h
-#include "bindings/core/v8/ExceptionState.h"
#include "core/css/cssom/CSSLengthValue.h"
namespace blink {
class CSSPrimitiveValue;
+class ExceptionState;
class CORE_EXPORT CSSSimpleLength final : public CSSLengthValue {
WTF_MAKE_NONCOPYABLE(CSSSimpleLength);
DEFINE_WRAPPERTYPEINFO();
public:
- static CSSSimpleLength* create(double value, const String& type, ExceptionState& exceptionState)
- {
- CSSPrimitiveValue::UnitType unit = unitFromName(type);
- if (!isSupportedLengthUnit(unit)) {
- exceptionState.throwTypeError("Invalid unit for CSSSimpleLength: " + type);
- return nullptr;
- }
- return new CSSSimpleLength(value, unit);
- }
-
+ static CSSSimpleLength* create(double, const String& type, ExceptionState&);
static CSSSimpleLength* create(double value, CSSPrimitiveValue::UnitType type)
{
return new CSSSimpleLength(value, type);
}
+ static CSSSimpleLength* fromCSSValue(const CSSPrimitiveValue&);
bool containsPercent() const override;
@@ -37,8 +29,6 @@ public:
String unit() const { return String(CSSPrimitiveValue::unitTypeToString(m_unit)); }
CSSPrimitiveValue::UnitType lengthUnit() const { return m_unit; }
- void setValue(double value) { m_value = value; }
-
StyleValueType type() const override { return StyleValueType::SimpleLengthType; }
CSSValue* toCSSValue() const override;

Powered by Google App Engine
This is Rietveld 408576698