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

Unified Diff: third_party/WebKit/Source/core/css/CSSTimingFunctionValue.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/CSSTimingFunctionValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp b/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp
index 3fa1eea16dc60c99bf4055e2e7cc9a9584ea7280..1c02f5d771698fabf2538859d7184d6a2c7c740b 100644
--- a/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp
@@ -25,10 +25,21 @@
#include "core/css/CSSTimingFunctionValue.h"
+#include "core/css/serializer/CSSDeserializeStream.h"
+#include "core/css/serializer/CSSSerializeStream.h"
#include "wtf/text/WTFString.h"
namespace blink {
+PassRefPtrWillBeRawPtr<CSSCubicBezierTimingFunctionValue> CSSCubicBezierTimingFunctionValue::deserializeAfterDispatch(CSSDeserializeStream* stream)
+{
+ double x1 = stream->readDouble();
+ double y1 = stream->readDouble();
+ double x2 = stream->readDouble();
+ double y2 = stream->readDouble();
+ return create(x1, y1, x2, y2);
+}
+
String CSSCubicBezierTimingFunctionValue::customCSSText() const
{
return "cubic-bezier("
@@ -43,6 +54,22 @@ bool CSSCubicBezierTimingFunctionValue::equals(const CSSCubicBezierTimingFunctio
return m_x1 == other.m_x1 && m_x2 == other.m_x2 && m_y1 == other.m_y1 && m_y2 == other.m_y2;
}
+void CSSCubicBezierTimingFunctionValue::serializeAfterDispatch(CSSSerializeStream* stream) const
+{
+ stream->writeDouble(m_x1);
+ stream->writeDouble(m_y1);
+ stream->writeDouble(m_x2);
+ stream->writeDouble(m_y2);
+}
+
+PassRefPtrWillBeRawPtr<CSSStepsTimingFunctionValue> CSSStepsTimingFunctionValue::deserializeAfterDispatch(CSSDeserializeStream* stream)
+{
+ int steps = stream->readInt();
+ StepsTimingFunction::StepAtPosition stepAtPosition = stream->readIntAsEnum<StepsTimingFunction::StepAtPosition>();
+
+ return create(steps, stepAtPosition);
+}
+
String CSSStepsTimingFunctionValue::customCSSText() const
{
String stepAtPositionString;
@@ -69,4 +96,10 @@ bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue& othe
return m_steps == other.m_steps && m_stepAtPosition == other.m_stepAtPosition;
}
+void CSSStepsTimingFunctionValue::serializeAfterDispatch(CSSSerializeStream* stream) const
+{
+ stream->writeInt(m_steps);
+ stream->writeEnumAsInt<StepsTimingFunction::StepAtPosition>(m_stepAtPosition);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h ('k') | third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698