Bug 1320474 - Allow <string> in addition to <custom-ident> (excluding css-wide keywords and 'none') for css-animation keyframe names. r=birtles

This commit is contained in:
Jonathan Kew 2016-11-29 12:58:44 +00:00
Родитель 1f7abbe2a9
Коммит 9139bdb856
3 изменённых файлов: 19 добавлений и 2 удалений

Просмотреть файл

@ -4400,11 +4400,27 @@ CSSParserImpl::ParseKeyframesRule(RuleAppendFunc aAppendFunc, void* aData)
return false;
}
if (mToken.mType != eCSSToken_Ident) {
if (mToken.mType != eCSSToken_Ident && mToken.mType != eCSSToken_String) {
REPORT_UNEXPECTED_TOKEN(PEKeyframeBadName);
UngetToken();
return false;
}
if (mToken.mType == eCSSToken_Ident) {
// Check for keywords that are not allowed as custom-ident for the
// keyframes-name: standard CSS-wide keywords, plus 'none'.
static const nsCSSKeyword excludedKeywords[] = {
eCSSKeyword_none,
eCSSKeyword_UNKNOWN
};
nsCSSValue value;
if (!ParseCustomIdent(value, mToken.mIdent, excludedKeywords)) {
REPORT_UNEXPECTED_TOKEN(PEKeyframeBadName);
UngetToken();
return false;
}
}
nsString name(mToken.mIdent);
if (!ExpectSymbol('{', true)) {

Просмотреть файл

@ -434,7 +434,7 @@ CSS_PROP_DISPLAY(
"",
// FIXME: The spec should say something about 'inherit' and 'initial'
// not being allowed.
VARIANT_NONE | VARIANT_IDENTIFIER_NO_INHERIT, // used by list parsing
VARIANT_NONE | VARIANT_IDENTIFIER_NO_INHERIT | VARIANT_STRING, // used by list parsing
nullptr,
CSS_PROP_NO_OFFSET,
eStyleAnimType_None)

Просмотреть файл

@ -5709,6 +5709,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
animation->SetName(EmptyString());
} else if (animName.list) {
switch (animName.list->mValue.GetUnit()) {
case eCSSUnit_String:
case eCSSUnit_Ident: {
nsDependentString
nameStr(animName.list->mValue.GetStringBufferValue());