summaryrefslogtreecommitdiff
path: root/layout
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2017-08-17 20:30:45 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-03-12 08:39:41 +0100
commit017797de494cffd76e31e62dbec3234ecabfb75b (patch)
tree6814a1154a77828760caad13780f66fb47d50ac5 /layout
parentb736f53a13af48de08026b7c7e64275122af66e2 (diff)
downloaduxp-017797de494cffd76e31e62dbec3234ecabfb75b.tar.gz
CSS - Grid - fit-content unexpectedly reserves space for full clamp size in repeat()
Diffstat (limited to 'layout')
-rw-r--r--layout/style/nsCSSParser.cpp4
-rw-r--r--layout/style/test/property_database.js5
2 files changed, 9 insertions, 0 deletions
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
index 1108ce5b58..cd996230ef 100644
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -8918,6 +8918,10 @@ CSSParserImpl::ParseGridTrackSize(nsCSSValue& aValue,
return CSSParseResult::NotFound;
}
if (mToken.mIdent.LowerCaseEqualsLiteral("fit-content")) {
+ if (requireFixedSize) {
+ UngetToken();
+ return CSSParseResult::Error;
+ }
nsCSSValue::Array* func = aValue.InitFunction(eCSSKeyword_fit_content, 1);
if (ParseGridTrackBreadth(func->Item(1)) == CSSParseResult::Ok &&
func->Item(1).IsLengthPercentCalcUnit() &&
diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js
index 9c69e7d101..4389d0cd07 100644
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6270,6 +6270,7 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
"repeat(auto-fill,minmax(1%,auto))",
"repeat(auto-fill,minmax(1em,min-content)) minmax(min-content,0)",
"repeat(auto-fill,minmax(max-content,1mm))",
+ "repeat(2, fit-content(1px))",
"fit-content(1px) 1fr",
"[a] fit-content(calc(1px - 99%)) [b]",
"[a] fit-content(10%) [b c] fit-content(1em)",
@@ -6314,6 +6315,8 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
"repeat(1, repeat(1, 20px))",
"repeat(auto-fill, auto)",
"repeat(auto-fit,auto)",
+ "repeat(auto-fill, fit-content(1px))",
+ "repeat(auto-fit, fit-content(1px))",
"repeat(auto-fit,[])",
"repeat(auto-fill, 0) repeat(auto-fit, 0) ",
"repeat(auto-fit, 0) repeat(auto-fill, 0) ",
@@ -6335,6 +6338,8 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
"fit-content(-1px)",
"fit-content(auto)",
"fit-content(min-content)",
+ "fit-content(1px) repeat(auto-fit, 1px)",
+ "fit-content(1px) repeat(auto-fill, 1px)",
],
unbalanced_values: [
"(foo] 40px",