| Index: third_party/WebKit/Source/core/css/CSSPathValue.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/CSSPathValue.cpp b/third_party/WebKit/Source/core/css/CSSPathValue.cpp
|
| index 22b868974d1636ef56cc8fbe8fe8c39a1f3f8ab0..d724629e9c80194f47f9a445d1928f5c3dc35163 100644
|
| --- a/third_party/WebKit/Source/core/css/CSSPathValue.cpp
|
| +++ b/third_party/WebKit/Source/core/css/CSSPathValue.cpp
|
| @@ -5,22 +5,38 @@
|
| #include "config.h"
|
| #include "core/css/CSSPathValue.h"
|
|
|
| +#include "core/svg/SVGPathUtilities.h"
|
| +
|
| namespace blink {
|
|
|
| -CSSPathValue::CSSPathValue(const String& pathString)
|
| +PassRefPtrWillBeRawPtr<CSSPathValue> CSSPathValue::create(const String& pathString)
|
| +{
|
| + OwnPtr<SVGPathByteStream> byteStream = SVGPathByteStream::create();
|
| + buildByteStreamFromString(pathString, *byteStream);
|
| + return CSSPathValue::create(byteStream.release());
|
| +}
|
| +
|
| +CSSPathValue::CSSPathValue(PassOwnPtr<SVGPathByteStream> pathByteStream)
|
| : CSSValue(PathClass)
|
| - , m_pathString(pathString)
|
| + , m_pathByteStream(pathByteStream)
|
| +{
|
| + ASSERT(m_pathByteStream);
|
| +}
|
| +
|
| +CSSPathValue* CSSPathValue::emptyPathValue()
|
| {
|
| + DEFINE_STATIC_LOCAL(RefPtrWillBePersistent<CSSPathValue>, empty, (CSSPathValue::create(SVGPathByteStream::create())));
|
| + return empty.get();
|
| }
|
|
|
| String CSSPathValue::customCSSText() const
|
| {
|
| - return "path('" + m_pathString + "')";
|
| + return "path('" + pathString() + "')";
|
| }
|
|
|
| bool CSSPathValue::equals(const CSSPathValue& other) const
|
| {
|
| - return m_pathString == other.m_pathString;
|
| + return *m_pathByteStream == *other.m_pathByteStream;
|
| }
|
|
|
| DEFINE_TRACE_AFTER_DISPATCH(CSSPathValue)
|
| @@ -28,4 +44,9 @@ DEFINE_TRACE_AFTER_DISPATCH(CSSPathValue)
|
| CSSValue::traceAfterDispatch(visitor);
|
| }
|
|
|
| +String CSSPathValue::pathString() const
|
| +{
|
| + return buildStringFromByteStream(*m_pathByteStream);
|
| +}
|
| +
|
| } // namespace blink
|
|
|