зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1240956 part 3 - [css-grid] Add a ParseGridTrackList convenience method. r=dholbert
This commit is contained in:
Родитель
a4647712fa
Коммит
94dd6e702f
|
@ -962,6 +962,8 @@ protected:
|
|||
// and alternating between that and <track-size>.
|
||||
bool ParseGridTrackListWithFirstLineNames(nsCSSValue& aValue,
|
||||
const nsCSSValue& aFirstLineNames);
|
||||
|
||||
bool ParseGridTrackList(nsCSSProperty aPropID);
|
||||
bool ParseGridTemplateColumnsRows(nsCSSProperty aPropID);
|
||||
|
||||
// |aAreaIndices| is a lookup table to help us parse faster,
|
||||
|
@ -8935,6 +8937,19 @@ CSSParserImpl::ParseGridTrackListRepeat(nsCSSValueList** aTailPtr)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
CSSParserImpl::ParseGridTrackList(nsCSSProperty aPropID)
|
||||
{
|
||||
nsCSSValue value;
|
||||
nsCSSValue firstLineNames;
|
||||
if (ParseGridLineNames(firstLineNames) == CSSParseResult::Error ||
|
||||
!ParseGridTrackListWithFirstLineNames(value, firstLineNames)) {
|
||||
return false;
|
||||
}
|
||||
AppendValue(aPropID, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
CSSParserImpl::ParseGridTemplateColumnsRows(nsCSSProperty aPropID)
|
||||
{
|
||||
|
@ -8960,13 +8975,7 @@ CSSParserImpl::ParseGridTemplateColumnsRows(nsCSSProperty aPropID)
|
|||
UngetToken();
|
||||
}
|
||||
|
||||
nsCSSValue firstLineNames;
|
||||
if (ParseGridLineNames(firstLineNames) == CSSParseResult::Error ||
|
||||
!ParseGridTrackListWithFirstLineNames(value, firstLineNames)) {
|
||||
return false;
|
||||
}
|
||||
AppendValue(aPropID, value);
|
||||
return true;
|
||||
return ParseGridTrackList(aPropID);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -9160,14 +9169,9 @@ CSSParserImpl::ParseGridTemplate()
|
|||
}
|
||||
// Parse an optional [ / <track-list> ] as the columns value.
|
||||
if (ExpectSymbol('/', true)) {
|
||||
nsCSSValue lineNames;
|
||||
if (ParseGridLineNames(lineNames) == CSSParseResult::Error ||
|
||||
!ParseGridTrackListWithFirstLineNames(value, lineNames)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
value.SetNoneValue(); // absent means 'none'
|
||||
return ParseGridTrackList(eCSSProperty_grid_template_columns);
|
||||
}
|
||||
value.SetNoneValue(); // absent means 'none'
|
||||
AppendValue(eCSSProperty_grid_template_columns, value);
|
||||
return true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче