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

Unified Diff: third_party/WebKit/Source/core/animation/StringKeyframe.cpp

Issue 2309873003: Extend PropertyHandle to include custom property identifiers (Closed)
Patch Set: Add unit tests 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/animation/StringKeyframe.cpp
diff --git a/third_party/WebKit/Source/core/animation/StringKeyframe.cpp b/third_party/WebKit/Source/core/animation/StringKeyframe.cpp
index a2071728273079afc2663399925617ce58dab249..f17a099b0dd596c36f1c3a4956f9415750ccd95c 100644
--- a/third_party/WebKit/Source/core/animation/StringKeyframe.cpp
+++ b/third_party/WebKit/Source/core/animation/StringKeyframe.cpp
@@ -6,6 +6,7 @@
#include "core/StylePropertyShorthand.h"
#include "core/animation/css/CSSAnimations.h"
+#include "core/css/CSSCustomPropertyDeclaration.h"
#include "core/css/CSSPropertyMetadata.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/style/ComputedStyle.h"
@@ -22,6 +23,11 @@ StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom)
{
}
+void StringKeyframe::setCSSPropertyValue(const AtomicString& propertyName, const String& value, StyleSheetContents* styleSheetContents)
+{
+ m_cssPropertyMap->setProperty(propertyName, value, false, styleSheetContents);
+}
+
void StringKeyframe::setCSSPropertyValue(CSSPropertyID property, const String& value, StyleSheetContents* styleSheetContents)
{
DCHECK_NE(property, CSSPropertyInvalid);
@@ -57,7 +63,10 @@ PropertyHandleSet StringKeyframe::properties() const
StylePropertySet::PropertyReference propertyReference = m_cssPropertyMap->propertyAt(i);
DCHECK(!isShorthandProperty(propertyReference.id()))
<< "Web Animations: Encountered unexpanded shorthand CSS property (" << propertyReference.id() << ").";
- properties.add(PropertyHandle(propertyReference.id(), false));
+ if (propertyReference.id() == CSSPropertyVariable)
+ properties.add(PropertyHandle(toCSSCustomPropertyDeclaration(propertyReference.value()).name()));
+ else
+ properties.add(PropertyHandle(propertyReference.id(), false));
}
for (unsigned i = 0; i < m_presentationAttributeMap->propertyCount(); ++i)
@@ -77,7 +86,7 @@ PassRefPtr<Keyframe> StringKeyframe::clone() const
PassRefPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::createPropertySpecificKeyframe(PropertyHandle property) const
{
if (property.isCSSProperty())
- return CSSPropertySpecificKeyframe::create(offset(), &easing(), &cssPropertyValue(property.cssProperty()), composite());
+ return CSSPropertySpecificKeyframe::create(offset(), &easing(), &cssPropertyValue(property), composite());
if (property.isPresentationAttribute())
return CSSPropertySpecificKeyframe::create(offset(), &easing(), &presentationAttributeValue(property.presentationAttribute()), composite());

Powered by Google App Engine
This is Rietveld 408576698