Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2022-04-19 22:11:35 +08:00
commit 96fb72ec56
106 changed files with 4038 additions and 1148 deletions

View file

@ -1015,7 +1015,7 @@ protected:
bool ParseGridColumnRow(nsCSSPropertyID aStartPropID,
nsCSSPropertyID aEndPropID);
bool ParseGridArea();
bool ParseGridGap();
bool ParseGap();
bool ParseInitialLetter();
@ -8638,7 +8638,7 @@ CSSParserImpl::ParseFlex()
// "a unitless zero that is not already preceded by two flex factors must be
// interpreted as a flex factor.
if (ParseNonNegativeVariant(tmpVal, flexBasisVariantMask | VARIANT_NUMBER,
nsCSSProps::kWidthKTable) != CSSParseResult::Ok) {
nsCSSProps::kFlexBasisKTable) != CSSParseResult::Ok) {
// First component was not a valid flex-basis or flex-grow value. Fail.
return false;
}
@ -8687,7 +8687,7 @@ CSSParserImpl::ParseFlex()
if (!wasFirstComponentFlexBasis) {
CSSParseResult result =
ParseNonNegativeVariant(tmpVal, flexBasisVariantMask,
nsCSSProps::kWidthKTable);
nsCSSProps::kFlexBasisKTable);
if (result == CSSParseResult::Error) {
return false;
} else if (result == CSSParseResult::Ok) {
@ -9774,13 +9774,6 @@ CSSParserImpl::ParseGrid()
return true;
}
// https://drafts.csswg.org/css-grid/#grid-shorthand
// "Also, the gutter properties are reset by this shorthand,
// even though they can't be set by it."
value.SetFloatValue(0.0f, eCSSUnit_Pixel);
AppendValue(eCSSProperty_grid_row_gap, value);
AppendValue(eCSSProperty_grid_column_gap, value);
// [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>
auto res = ParseGridShorthandAutoProps(NS_STYLE_GRID_AUTO_FLOW_ROW);
if (res == CSSParseResult::Error) {
@ -10087,12 +10080,12 @@ CSSParserImpl::ParseGridArea()
}
bool
CSSParserImpl::ParseGridGap()
CSSParserImpl::ParseGap()
{
nsCSSValue first;
if (ParseSingleTokenVariant(first, VARIANT_INHERIT, nullptr)) {
AppendValue(eCSSProperty_grid_row_gap, first);
AppendValue(eCSSProperty_grid_column_gap, first);
AppendValue(eCSSProperty_row_gap, first);
AppendValue(eCSSProperty_column_gap, first);
return true;
}
if (ParseNonNegativeVariant(first, VARIANT_LPCALC, nullptr) !=
@ -10104,8 +10097,8 @@ CSSParserImpl::ParseGridGap()
if (result == CSSParseResult::Error) {
return false;
}
AppendValue(eCSSProperty_grid_row_gap, first);
AppendValue(eCSSProperty_grid_column_gap,
AppendValue(eCSSProperty_row_gap, first);
AppendValue(eCSSProperty_column_gap,
result == CSSParseResult::NotFound ? first : second);
return true;
}
@ -12005,8 +11998,8 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSPropertyID aPropID)
eCSSProperty_grid_row_end);
case eCSSProperty_grid_area:
return ParseGridArea();
case eCSSProperty_grid_gap:
return ParseGridGap();
case eCSSProperty_gap:
return ParseGap();
case eCSSProperty_image_region:
return ParseRect(eCSSProperty_image_region);
case eCSSProperty_align_content: