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 (aKeywordTable == nsCSSProps::kDisplayKTable) {
if (keyword == eCSSKeyword_UNKNOWN && if (keyword == eCSSKeyword_UNKNOWN &&
ShouldUseUnprefixingService() && (sWebkitPrefixedAliasesEnabled || ShouldUseUnprefixingService()) &&
aKeywordStr.EqualsLiteral("-webkit-box")) { aKeywordStr.EqualsLiteral("-webkit-box")) {
// Treat "display: -webkit-box" as "display: flex". In simple scenarios, // Treat "display: -webkit-box" as "display: flex". In simple scenarios,
// they largely behave the same, as long as we use the CSS Unprefixing // they largely behave the same, as long as we alias the associated
// Service to also translate the associated properties. // properties to modern flexbox equivalents as well.
if (mWebkitBoxUnprefixState == eHaveNotUnprefixed) { if (mWebkitBoxUnprefixState == eHaveNotUnprefixed) {
mWebkitBoxUnprefixState = eHaveUnprefixed; mWebkitBoxUnprefixState = eHaveUnprefixed;
} }
@ -6807,9 +6807,10 @@ CSSParserImpl::LookupKeywordPrefixAware(nsAString& aKeywordStr,
// "display: flex" (but only if we unprefixed an earlier "-webkit-box"). // "display: flex" (but only if we unprefixed an earlier "-webkit-box").
if (mWebkitBoxUnprefixState == eHaveUnprefixed && if (mWebkitBoxUnprefixState == eHaveUnprefixed &&
keyword == eCSSKeyword__moz_box) { keyword == eCSSKeyword__moz_box) {
MOZ_ASSERT(ShouldUseUnprefixingService(), MOZ_ASSERT(sWebkitPrefixedAliasesEnabled || ShouldUseUnprefixingService(),
"mDidUnprefixWebkitBoxInEarlierDecl should only be set if " "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; return eCSSKeyword_flex;
} }
} }