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

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

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.h
diff --git a/third_party/WebKit/Source/core/animation/StringKeyframe.h b/third_party/WebKit/Source/core/animation/StringKeyframe.h
index b4d6653761b7869e8edb7bdd9797af898a2b1a5b..2b3382e3c7868f8f9117a8d29649b5c1550e550b 100644
--- a/third_party/WebKit/Source/core/animation/StringKeyframe.h
+++ b/third_party/WebKit/Source/core/animation/StringKeyframe.h
@@ -22,22 +22,27 @@ public:
return adoptRef(new StringKeyframe);
}
+ void setCSSPropertyValue(const AtomicString& propertyName, const String& value, StyleSheetContents*);
void setCSSPropertyValue(CSSPropertyID, const String& value, StyleSheetContents*);
void setCSSPropertyValue(CSSPropertyID, const CSSValue&);
void setPresentationAttributeValue(CSSPropertyID, const String& value, StyleSheetContents*);
void setSVGAttributeValue(const QualifiedName&, const String& value);
- const CSSValue& cssPropertyValue(CSSPropertyID property) const
+ const CSSValue& cssPropertyValue(const PropertyHandle& property) const
{
- int index = m_cssPropertyMap->findPropertyIndex(property);
- RELEASE_ASSERT(index >= 0);
+ int index = -1;
+ if (property.isCSSCustomProperty())
+ index = m_cssPropertyMap->findPropertyIndex(property.customPropertyName());
+ else
+ index = m_cssPropertyMap->findPropertyIndex(property.cssProperty());
+ CHECK_GE(index, 0);
return m_cssPropertyMap->propertyAt(static_cast<unsigned>(index)).value();
}
const CSSValue& presentationAttributeValue(CSSPropertyID property) const
{
int index = m_presentationAttributeMap->findPropertyIndex(property);
- RELEASE_ASSERT(index >= 0);
+ CHECK_GE(index, 0);
return m_presentationAttributeMap->propertyAt(static_cast<unsigned>(index)).value();
}

Powered by Google App Engine
This is Rietveld 408576698