Bug 1208635 part 2: Extend existing parser code for CSSUnprefixingService "-webkit-box" handling to also activate if native unprefixing is enabled. r=heycam

This commit is contained in:
Daniel Holbert 2015-11-04 17:59:52 -08:00
Родитель 1375826a46
Коммит 6c7605c5d8
1 изменённых файлов: 6 добавлений и 5 удалений

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

@ -6787,11 +6787,11 @@ CSSParserImpl::LookupKeywordPrefixAware(nsAString& aKeywordStr,
if (aKeywordTable == nsCSSProps::kDisplayKTable) {
if (keyword == eCSSKeyword_UNKNOWN &&
ShouldUseUnprefixingService() &&
(sWebkitPrefixedAliasesEnabled || ShouldUseUnprefixingService()) &&
aKeywordStr.EqualsLiteral("-webkit-box")) {
// Treat "display: -webkit-box" as "display: flex". In simple scenarios,
// they largely behave the same, as long as we use the CSS Unprefixing
// Service to also translate the associated properties.
// they largely behave the same, as long as we alias the associated
// properties to modern flexbox equivalents as well.
if (mWebkitBoxUnprefixState == eHaveNotUnprefixed) {
mWebkitBoxUnprefixState = eHaveUnprefixed;
}
@ -6807,9 +6807,10 @@ CSSParserImpl::LookupKeywordPrefixAware(nsAString& aKeywordStr,
// "display: flex" (but only if we unprefixed an earlier "-webkit-box").
if (mWebkitBoxUnprefixState == eHaveUnprefixed &&
keyword == eCSSKeyword__moz_box) {
MOZ_ASSERT(ShouldUseUnprefixingService(),
MOZ_ASSERT(sWebkitPrefixedAliasesEnabled || ShouldUseUnprefixingService(),
"mDidUnprefixWebkitBoxInEarlierDecl should only be set if "
"we're using the unprefixing service on this site");
"we're supporting webkit-prefixed aliases, or if we're using "
"the css unprefixing service on this site");
return eCSSKeyword_flex;
}
}