summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2017-08-17 20:34:01 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-03-12 08:40:14 +0100
commit505edf1ba4f6907c236b4876eefea606fa7b9cd0 (patch)
tree0404fa33ac7f64a995115f38a580df5cd4d15166 /layout
parent017797de494cffd76e31e62dbec3234ecabfb75b (diff)
downloadUXP-505edf1ba4f6907c236b4876eefea606fa7b9cd0.tar
UXP-505edf1ba4f6907c236b4876eefea606fa7b9cd0.tar.gz
UXP-505edf1ba4f6907c236b4876eefea606fa7b9cd0.tar.lz
UXP-505edf1ba4f6907c236b4876eefea606fa7b9cd0.tar.xz
UXP-505edf1ba4f6907c236b4876eefea606fa7b9cd0.zip
[draft] CSS - linear-gradient - zero (0) angle value without degree unit is not correctly interpreted
Diffstat (limited to 'layout')
-rw-r--r--layout/style/nsCSSParser.cpp3
-rw-r--r--layout/style/test/property_database.js9
2 files changed, 7 insertions, 5 deletions
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
index cd996230e..b361cf0c2 100644
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -10404,7 +10404,8 @@ CSSParserImpl::ParseLinearGradient(nsCSSValue& aValue,
UngetToken();
// <angle> ,
- if (ParseSingleTokenVariant(cssGradient->mAngle, VARIANT_ANGLE, nullptr) &&
+ if (ParseSingleTokenVariant(cssGradient->mAngle,
+ VARIANT_ANGLE_OR_ZERO, nullptr) &&
!ExpectSymbol(',', true)) {
SkipUntil(')');
return false;
diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js
index 4389d0cd0..62d413d98 100644
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -132,6 +132,9 @@ var validGradientAndElementValues = [
"linear-gradient(to right bottom, red, 50%, green 50%, 50%, blue)",
"linear-gradient(to right bottom, red, 0%, green 50%, 100%, blue)",
+ /* Unitless 0 is valid as an <angle> */
+ "linear-gradient(0, red, blue)",
+
"-moz-linear-gradient(red, blue)",
"-moz-linear-gradient(red, yellow, blue)",
"-moz-linear-gradient(red 1px, yellow 20%, blue 24em, green)",
@@ -388,10 +391,8 @@ var invalidGradientAndElementValues = [
"-moz-linear-gradient(10 10px -45deg, red, blue) repeat",
"-moz-linear-gradient(10px 10 -45deg, red, blue) repeat",
"linear-gradient(red -99, yellow, green, blue 120%)",
- /* Unitless 0 is invalid as an <angle> */
- "-moz-linear-gradient(top left 0, red, blue)",
- "-moz-linear-gradient(5px 5px 0, red, blue)",
- "linear-gradient(0, red, blue)",
+ /* Unitless nonzero numbers are valid as an <angle> */
+ "linear-gradient(30, red, blue)",
/* Invalid color, calc() or -moz-image-rect() function */
"linear-gradient(red, rgb(0, rubbish, 0) 50%, red)",
"linear-gradient(red, red calc(50% + rubbish), red)",