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

Unified Diff: third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.cpp

Issue 2692043004: [Typed OM] Output correct types from CSSKeywordValue for css-wide keywords (Closed)
Patch Set: Remove debugging code; use getComputedStyle instead of offsetTop Created 3 years, 10 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/CSSKeywordValue.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.cpp
index cde43e139c91945d4ed1fec1018a1ee31a220355..b1a593ded34df6e6b0314caf5531f19a86b165eb 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.cpp
@@ -7,6 +7,9 @@
#include "bindings/core/v8/ExceptionState.h"
#include "core/css/CSSCustomIdentValue.h"
#include "core/css/CSSIdentifierValue.h"
+#include "core/css/CSSInheritedValue.h"
+#include "core/css/CSSInitialValue.h"
+#include "core/css/CSSUnsetValue.h"
#include "core/css/parser/CSSPropertyParser.h"
namespace blink {
@@ -60,10 +63,18 @@ CSSValueID CSSKeywordValue::keywordValueID() const {
CSSValue* CSSKeywordValue::toCSSValue() const {
CSSValueID keywordID = keywordValueID();
- if (keywordID == CSSValueID::CSSValueInvalid) {
- return CSSCustomIdentValue::create(m_keywordValue);
+ switch (keywordID) {
+ case (CSSValueInherit):
+ return CSSInheritedValue::create();
+ case (CSSValueInitial):
+ return CSSInitialValue::create();
+ case (CSSValueUnset):
+ return CSSUnsetValue::create();
+ case (CSSValueInvalid):
+ return CSSCustomIdentValue::create(m_keywordValue);
+ default:
+ return CSSIdentifierValue::create(keywordID);
}
- return CSSIdentifierValue::create(keywordID);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698