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

Unified Diff: third_party/WebKit/Source/core/css/CSSCustomIdentValue.cpp

Issue 1481383002: [Experimental] CSSSerializer Proof-of-concept Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: snapshot: top_25 sites ser/dser now works Created 4 years, 11 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/CSSCustomIdentValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSCustomIdentValue.cpp b/third_party/WebKit/Source/core/css/CSSCustomIdentValue.cpp
index f8f4e3a1e4f9a1413000857eafe99085b40e687c..d4e158bdaf0ca3eaa94195f9ffbe007567d91ec0 100644
--- a/third_party/WebKit/Source/core/css/CSSCustomIdentValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSCustomIdentValue.cpp
@@ -5,10 +5,22 @@
#include "core/css/CSSCustomIdentValue.h"
#include "core/css/CSSMarkup.h"
+#include "core/css/serializer/CSSDeserializeStream.h"
+#include "core/css/serializer/CSSSerializeStream.h"
#include "wtf/text/WTFString.h"
namespace blink {
+PassRefPtrWillBeRawPtr<CSSCustomIdentValue> CSSCustomIdentValue::deserializeAfterDispatch(CSSDeserializeStream* stream)
+{
+ String str = stream->readString();
+ CSSPropertyID propertyId = static_cast<CSSPropertyID>(stream->readUnsigned());
+ if (propertyId != CSSPropertyInvalid) {
+ return create(propertyId);
+ }
+ return create(str);
+}
+
CSSCustomIdentValue::CSSCustomIdentValue(const String& str)
: CSSValue(CustomIdentClass)
, m_string(str)
@@ -22,7 +34,6 @@ CSSCustomIdentValue::CSSCustomIdentValue(CSSPropertyID id)
ASSERT(isKnownPropertyID());
}
-
String CSSCustomIdentValue::customCSSText() const
{
if (isKnownPropertyID())
@@ -30,6 +41,12 @@ String CSSCustomIdentValue::customCSSText() const
return quoteCSSStringIfNeeded(m_string);
}
+void CSSCustomIdentValue::serializeAfterDispatch(CSSSerializeStream* stream) const
+{
+ stream->writeString(m_string);
+ stream->writeUnsigned(m_propertyId);
+}
+
DEFINE_TRACE_AFTER_DISPATCH(CSSCustomIdentValue)
{
CSSValue::traceAfterDispatch(visitor);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSCustomIdentValue.h ('k') | third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698