Add support for midpoint to CSS gradients
authorcabanier@adobe.com <cabanier@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Oct 2014 00:49:37 +0000 (00:49 +0000)
committercabanier@adobe.com <cabanier@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Oct 2014 00:49:37 +0000 (00:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137171

Reviewed by Darin Adler.

Source/WebCore:

This patch adds support for gradient midpoints. It also updates the
gradient tests so they use the feature.
Spec: http://dev.w3.org/csswg/css-images-4/#color-interpolation-hint

Tests: fast/gradients/unprefixed-color-stops2.html
       fast/gradients/unprefixed-gradient-parsing.html
       fast/gradients/unprefixed-linear-angle-gradients2.html
       fast/gradients/unprefixed-radial-gradients.html
       fast/gradients/unprefixed-radial-gradients2.html
       fast/gradients/unprefixed-repeating-linear-gradient.html
       fast/gradients/unprefixed-repeating-radial-gradients.html

* css/CSSGradientValue.cpp:
(WebCore::GradientStop::GradientStop): constructor initializes the midpoint variable
(WebCore::CSSGradientValue::gradientWithStylesResolved): this function checks for midpoint color stops
(WebCore::CSSGradientValue::addStops): this function processes midpoints and converts them to regular color stops
(WebCore::CSSLinearGradientValue::customCSSText): this routine was updated to do correct parsing for midpoints
(WebCore::CSSRadialGradientValue::customCSSText):
* css/CSSGradientValue.h:
(WebCore::CSSGradientColorStop::CSSGradientColorStop): this function stores if a stop is a midpoint
* css/CSSParser.cpp:
(WebCore::CSSParser::parseGradientColorStops): this function now allows color stops with no color

LayoutTests:

Updated the CSS gradient test files so they test the
gradient midpoint feature.

* fast/gradients/unprefixed-color-stops2.html:
* fast/gradients/unprefixed-gradient-parsing.html:
* fast/gradients/unprefixed-linear-angle-gradients2.html:
* fast/gradients/unprefixed-radial-gradients.html:
* fast/gradients/unprefixed-radial-gradients2.html:
* fast/gradients/unprefixed-repeating-linear-gradient.html:
* fast/gradients/unprefixed-repeating-radial-gradients.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174191 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/gradients/unprefixed-color-stops2-expected.txt [new file with mode: 0644]
LayoutTests/fast/gradients/unprefixed-color-stops2.html [new file with mode: 0644]
LayoutTests/fast/gradients/unprefixed-gradient-parsing-expected.txt
LayoutTests/fast/gradients/unprefixed-gradient-parsing.html
LayoutTests/fast/gradients/unprefixed-linear-angle-gradients2-expected.txt [new file with mode: 0644]
LayoutTests/fast/gradients/unprefixed-linear-angle-gradients2.html [new file with mode: 0644]
LayoutTests/fast/gradients/unprefixed-radial-gradients-expected.txt
LayoutTests/fast/gradients/unprefixed-radial-gradients.html
LayoutTests/fast/gradients/unprefixed-radial-gradients2-expected.txt
LayoutTests/fast/gradients/unprefixed-radial-gradients2.html
LayoutTests/fast/gradients/unprefixed-repeating-linear-gradient-expected.txt
LayoutTests/fast/gradients/unprefixed-repeating-linear-gradient.html
LayoutTests/fast/gradients/unprefixed-repeating-radial-gradients-expected.txt
LayoutTests/fast/gradients/unprefixed-repeating-radial-gradients.html
LayoutTests/platform/mac/fast/gradients/unprefixed-color-stops2-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/gradients/unprefixed-linear-angle-gradients2-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-expected.png [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSGradientValue.cpp
Source/WebCore/css/CSSGradientValue.h
Source/WebCore/css/CSSParser.cpp

index 3fe31f4..0e541e2 100644 (file)
@@ -1,3 +1,21 @@
+2014-10-01  Rik Cabanier  <cabanier@adobe.com>
+
+        Add support for midpoint to CSS gradients
+        https://bugs.webkit.org/show_bug.cgi?id=137171
+
+        Reviewed by Darin Adler.
+
+        Updated the CSS gradient test files so they test the
+        gradient midpoint feature.
+
+        * fast/gradients/unprefixed-color-stops2.html:
+        * fast/gradients/unprefixed-gradient-parsing.html:
+        * fast/gradients/unprefixed-linear-angle-gradients2.html:
+        * fast/gradients/unprefixed-radial-gradients.html:
+        * fast/gradients/unprefixed-radial-gradients2.html:
+        * fast/gradients/unprefixed-repeating-linear-gradient.html:
+        * fast/gradients/unprefixed-repeating-radial-gradients.html:
+
 2014-10-01  Chris Dumez  <cdumez@apple.com>
 
         Add basic caching for Document.cookie API
diff --git a/LayoutTests/fast/gradients/unprefixed-color-stops2-expected.txt b/LayoutTests/fast/gradients/unprefixed-color-stops2-expected.txt
new file mode 100644 (file)
index 0000000..25447f1
--- /dev/null
@@ -0,0 +1,2 @@
+   
+  
diff --git a/LayoutTests/fast/gradients/unprefixed-color-stops2.html b/LayoutTests/fast/gradients/unprefixed-color-stops2.html
new file mode 100644 (file)
index 0000000..7d7b31c
--- /dev/null
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    .box {
+      display: inline-block;
+      height: 120px;
+      width: 200px;
+      margin: 10px;
+      border: 1px solid black;
+      background-repeat: no-repeat;
+    }
+
+    .linear1 {
+      background-image: linear-gradient(to right, red -80%, -50%, green, blue, green, 150%, blue 170%);
+    }
+
+    .linear2 {
+      background-image: linear-gradient(to right, red, 10%, green 100px, 60%, blue);
+    }
+
+    .linear3 {
+      background-image: linear-gradient(to right, red, 10%, green, 60%, blue);
+    }
+
+    .linear4 {
+      background-image: linear-gradient(to right, red 4em, 6em, green 10em, 11em, blue);
+    }
+
+    .linear5 {
+      background-image: linear-gradient(to right, red 10px, 10%, green 50px, 60%, blue 100px);
+    }
+
+    .linear6 {
+      background-image: linear-gradient(to right, red 5%, 100px, green 50%, 160px, blue 90%);
+    }
+  </style>
+  <script type="text/javascript" charset="utf-8">
+    if (window.testRunner) {
+      var dumpPixels = true;
+      testRunner.dumpAsText(dumpPixels);
+    }
+  </script>
+</head>
+<body>
+
+  <div class="linear1 box"></div>
+  <div class="linear2 box"></div>
+  <div class="linear3 box"></div>
+  <br>
+  <div class="linear4 box"></div>
+  <div class="linear5 box"></div>
+  <div class="linear6 box"></div>
+
+</body>
+</html>
index 39bf7bd..e4af96b 100644 (file)
@@ -14,6 +14,12 @@ PASS testGradient("background-image: linear-gradient(to left left)") is "none"
 PASS testGradient("background-image: linear-gradient(to left center)") is "none"
 PASS testGradient("background-image: linear-gradient(to left 10deg, black 0%, white)") is "none"
 PASS testGradient("background-image: linear-gradient(black)") is "none"
+PASS testGradient("background-image: linear-gradient(10deg, black 0%, 25%, 50%, white)") is "none"
+PASS testGradient("background-image: linear-gradient(10deg, black 0%, 50%)") is "none"
+PASS testGradient("background-image: linear-gradient(10deg, 50%, white)") is "none"
+PASS testGradient("background-image: linear-gradient(10deg, 0%, black, white)") is "none"
+PASS testGradient("background-image: linear-gradient(10deg, white, black, 80%)") is "none"
+PASS testGradient("background-image: linear-gradient(10deg, black, , white)") is "none"
 PASS testGradient("background-image: linear-gradient(black, white)") is "linear-gradient(black, white)"
 PASS testGradient("background-image: linear-gradient(black 0, white)") is "linear-gradient(black 0px, white)"
 PASS testGradient("background-image: linear-gradient(black 0%, white)") is "linear-gradient(black 0%, white)"
@@ -22,16 +28,23 @@ PASS testGradient("background-image: linear-gradient(black 10px, white 20px)") i
 PASS testGradient("background-image: linear-gradient(to top left, black 0%, white)") is "linear-gradient(to left top, black 0%, white)"
 PASS testGradient("background-image: linear-gradient(to top, black 0%, white)") is "linear-gradient(to top, black 0%, white)"
 PASS testGradient("background-image: linear-gradient(10deg, black 0%, white)") is "linear-gradient(10deg, black 0%, white)"
+PASS testGradient("background-image: linear-gradient(10deg, black 0%, 25%, white)") is "linear-gradient(10deg, black 0%, 25%, white)"
+PASS testGradient("background-image: linear-gradient(10deg, black 0%, 0%, white)") is "linear-gradient(10deg, black 0%, 0%, white)"
+PASS testGradient("background-image: linear-gradient(10deg, black 0%, 100%, white)") is "linear-gradient(10deg, black 0%, 100%, white)"
+PASS testGradient("background-image: linear-gradient(10deg, black 0%, 50%, green 50%, 50%, white)") is "linear-gradient(10deg, black 0%, 50%, green 50%, 50%, white)"
+PASS testGradient("background-image: linear-gradient(white 0%, 0.001%, white 0.002%, 0.003%, white 0.004%, 0.005%, white 0.006%, 0.007%, white 0.008%, 0.009%, white 0.01%, 0.011%, white 0.012%, 0.013%, white 0.014%, 0.015%, white 0.016%, 0.017%, white 0.018%, 0.019%, white 0.02%, 0.021%, white 0.022%, 0.023%, white 0.024%, 0.025%, white 0.026%, 0.027%, white 0.028%, 0.029%, white 0.03%, 0.031%, white 0.032%, 0.033%, white 0.034%, 0.035%, white 0.036%, 0.037%, white 0.038%, 0.039%, white 0.04%, 0.041%, white 0.042%, 0.043%, white 0.044%, 0.045%, white 0.046%, 0.047%, white 0.048%, 0.049%, white 0.05%, 0.051%, white 0.052%, 0.053%, white 0.054%, 0.055%, white 0.056%, 0.057%, white 0.058%, 0.059%, white 0.06%, 0.061%, white 0.062%, 0.063%, white 0.064%, 0.065%, white 0.066%, 0.067%, white 0.068%, 0.069%, white 0.07%, 0.071%, white 0.072%, 0.073%, white 0.074%, 0.075%, white 0.076%, 0.077%, white 0.078%, 0.079%, white 0.08%, 0.081%, white 0.082%, 0.083%, white 0.084%, 0.085%, white 0.086%, 0.087%, white 0.088%, 0.089%, white 0.09%, 0.091%, white 0.092%, 0.093%, white 0.094%, 0.095%, white 0.096%, 0.097%, white 0.098%, 0.099%, white 0.1%, 0.101%, white 0.102%, 0.103%, white 0.104%, 0.105%, white 0.106%, 0.107%, white 0.108%, 0.109%, white 0.11%, 0.111%, white 0.112%, 0.113%, white 0.114%, 0.115%, white 0.116%, 0.117%, white 0.118%, 0.119%, white 0.12%, 0.121%, white 0.122%, 0.123%, white 0.124%, 0.125%, white 0.126%, 0.127%, white 0.128%, 0.129%, white 0.13%, 0.131%, white 0.132%, 0.133%, white 0.134%, 0.135%, white 0.136%, 0.137%, white 0.138%, 0.139%, white 0.14%, 0.141%, white 0.142%, 0.143%, white 0.144%, 0.145%, white 0.146%, 0.147%, white 0.148%, 0.149%, white 0.15%, 0.151%, white 0.152%, 0.153%, white 0.154%, 0.155%, white 0.156%, 0.157%, white 0.158%, 0.159%, white 0.16%, 0.161%, white 0.162%, 0.163%, white 0.164%, 0.165%, white 0.166%, 0.167%, white 0.168%, 0.169%, white 0.17%, 0.171%, white 0.172%, 0.173%, white 0.174%, 0.175%, white 0.176%, 0.177%, white 0.178%, 0.179%, white 0.18%, 0.181%, white 0.182%, 0.183%, white 0.184%, 0.185%, white 0.186%, 0.187%, white 0.188%, 0.189%, white 0.19%, 0.191%, white 0.192%, 0.193%, white 0.194%, 0.195%, white 0.196%, 0.197%, white 0.198%, 0.199%, white 0.2%, 0.201%, white 0.202%, 0.203%, white 0.204%, 0.205%, white 0.206%, 0.207%, white 0.208%, 0.209%, white 0.21%, 0.211%, white 0.212%, 0.213%, white 0.214%, 0.215%, white 0.216%, 0.217%, white 0.218%, 0.219%, white 0.22%, 0.221%, white 0.222%, 0.223%, white 0.224%, 0.225%, white 0.226%, 0.227%, white 0.228%, 0.229%, white 0.23%, 0.231%, white 0.232%, 0.233%, white 0.234%, 0.235%, white 0.236%, 0.237%, white 0.238%, 0.239%, white 0.24%, 0.241%, white 0.242%, 0.243%, white 0.244%, 0.245%, white 0.246%, 0.247%, white 0.248%, 0.249%, white 0.25%, 0.251%, white 0.252%, 0.253%, white 0.254%, 0.255%, white 0.256%, 0.257%, white 0.258%, 0.259%, white 0.26%, 0.261%, white 0.262%, 0.263%, white 0.264%, 0.265%, white 0.266%, 0.267%, white 0.268%, 0.269%, white 0.27%, 0.271%, white 0.272%, 0.273%, white 0.274%, 0.275%, white 0.276%, 0.277%, white 0.278%, 0.279%, white 0.28%, 0.281%, white 0.282%, 0.283%, white 0.284%, 0.285%, white 0.286%, 0.287%, white 0.288%, 0.289%, white 0.29%, 0.291%, white 0.292%, 0.293%, white 0.294%, 0.295%, white 0.296%, 0.297%, white 0.298%, 0.299%, white 0.3%, 0.301%, white 0.302%, 0.303%, white 0.304%, 0.305%, white 0.306%, 0.307%, white 0.308%, 0.309%, white 0.31%, 0.311%, white 0.312%, 0.313%, white 0.314%, 0.315%, white 0.316%, 0.317%, white 0.318%, 0.319%, white 0.32%, 0.321%, white 0.322%, 0.323%, white 0.324%, 0.325%, white 0.326%, 0.327%, white 0.328%, 0.329%, white 0.33%, 0.331%, white 0.332%, 0.333%, white 0.334%, 0.335%, white 0.336%, 0.337%, white 0.338%, 0.339%, white 0.34%, 0.341%, white 0.342%, 0.343%, white 0.344%, 0.345%, white 0.346%, 0.347%, white 0.348%, 0.349%, white 0.35%, 0.351%, white 0.352%, 0.353%, white 0.354%, 0.355%, white 0.356%, 0.357%, white 0.358%, 0.359%, white 0.36%, 0.361%, white 0.362%, 0.363%, white 0.364%, 0.365%, white 0.366%, 0.367%, white 0.368%, 0.369%, white 0.37%, 0.371%, white 0.372%, 0.373%, white 0.374%, 0.375%, white 0.376%, 0.377%, white 0.378%, 0.379%, white 0.38%, 0.381%, white 0.382%, 0.383%, white 0.384%, 0.385%, white 0.386%, 0.387%, white 0.388%, 0.389%, white 0.39%, 0.391%, white 0.392%, 0.393%, white 0.394%, 0.395%, white 0.396%, 0.397%, white 0.398%, 0.399%, white 0.4%, 0.401%, white 0.402%, 0.403%, white 0.404%, 0.405%, white 0.406%, 0.407%, white 0.408%, 0.409%, white 0.41%, 0.411%, white 0.412%, 0.413%, white 0.414%, 0.415%, white 0.416%, 0.417%, white 0.418%, 0.419%, white 0.42%, 0.421%, white 0.422%, 0.423%, white 0.424%, 0.425%, white 0.426%, 0.427%, white 0.428%, 0.429%, white 0.43%, 0.431%, white 0.432%, 0.433%, white 0.434%, 0.435%, white 0.436%, 0.437%, white 0.438%, 0.439%, white 0.44%, 0.441%, white 0.442%, 0.443%, white 0.444%, 0.445%, white 0.446%, 0.447%, white 0.448%, 0.449%, white 0.45%, 0.451%, white 0.452%, 0.453%, white 0.454%, 0.455%, white 0.456%, 0.457%, white 0.458%, 0.459%, white 0.46%, 0.461%, white 0.462%, 0.463%, white 0.464%, 0.465%, white 0.466%, 0.467%, white 0.468%, 0.469%, white 0.47%, 0.471%, white 0.472%, 0.473%, white 0.474%, 0.475%, white 0.476%, 0.477%, white 0.478%, 0.479%, white 0.48%, 0.481%, white 0.482%, 0.483%, white 0.484%, 0.485%, white 0.486%, 0.487%, white 0.488%, 0.489%, white 0.49%, 0.491%, white 0.492%, 0.493%, white 0.494%, 0.495%, white 0.496%, 0.497%, white 0.498%, 0.499%, white 0.5%, 0.501%, white 0.502%, 0.503%, white 0.504%, 0.505%, white 0.506%, 0.507%, white 0.508%, 0.509%, white 0.51%, 0.511%, white 0.512%, 0.513%, white 0.514%, 0.515%, white 0.516%, 0.517%, white 0.518%, 0.519%, white 0.52%, 0.521%, white 0.522%, 0.523%, white 0.524%, 0.525%, white 0.526%, 0.527%, white 0.528%, 0.529%, white 0.53%, 0.531%, white 0.532%, 0.533%, white 0.534%, 0.535%, white 0.536%, 0.537%, white 0.538%, 0.539%, white 0.54%, 0.541%, white 0.542%, 0.543%, white 0.544%, 0.545%, white 0.546%, 0.547%, white 0.548%, 0.549%, white 0.55%, 0.551%, white 0.552%, 0.553%, white 0.554%, 0.555%, white 0.556%, 0.557%, white 0.558%, 0.559%, white 0.56%, 0.561%, white 0.562%, 0.563%, white 0.564%, 0.565%, white 0.566%, 0.567%, white 0.568%, 0.569%, white 0.57%, 0.571%, white 0.572%, 0.573%, white 0.574%, 0.575%, white 0.576%, 0.577%, white 0.578%, 0.579%, white 0.58%, 0.581%, white 0.582%, 0.583%, white 0.584%, 0.585%, white 0.586%, 0.587%, white 0.588%, 0.589%, white 0.59%, 0.591%, white 0.592%, 0.593%, white 0.594%, 0.595%, white 0.596%, 0.597%, white 0.598%, 0.599%, white 0.6%, 0.601%, white 0.602%, 0.603%, white 0.604%, 0.605%, white 0.606%, 0.607%, white 0.608%, 0.609%, white 0.61%, 0.611%, white 0.612%, 0.613%, white 0.614%, 0.615%, white 0.616%, 0.617%, white 0.618%, 0.619%, white 0.62%, 0.621%, white 0.622%, 0.623%, white 0.624%, 0.625%, white 0.626%, 0.627%, white 0.628%, 0.629%, white 0.63%, 0.631%, white 0.632%, 0.633%, white 0.634%, 0.635%, white 0.636%, 0.637%, white 0.638%, 0.639%, white 0.64%, 0.641%, white 0.642%, 0.643%, white 0.644%, 0.645%, white 0.646%, 0.647%, white 0.648%, 0.649%, white 0.65%, 0.651%, white 0.652%, 0.653%, white 0.654%, 0.655%, white 0.656%, 0.657%, white 0.658%, 0.659%, white 0.66%, 0.661%, white 0.662%, 0.663%, white 0.664%, 0.665%, white 0.666%, 0.667%, white 0.668%, 0.669%, white 0.67%, 0.671%, white 0.672%, 0.673%, white 0.674%, 0.675%, white 0.676%, 0.677%, white 0.678%, 0.679%, white 0.68%, 0.681%, white 0.682%, 0.683%, white 0.684%, 0.685%, white 0.686%, 0.687%, white 0.688%, 0.689%, white 0.69%, 0.691%, white 0.692%, 0.693%, white 0.694%, 0.695%, white 0.696%, 0.697%, white 0.698%, 0.699%, white 0.7%, 0.701%, white 0.702%, 0.703%, white 0.704%, 0.705%, white 0.706%, 0.707%, white 0.708%, 0.709%, white 0.71%, 0.711%, white 0.712%, 0.713%, white 0.714%, 0.715%, white 0.716%, 0.717%, white 0.718%, 0.719%, white 0.72%, 0.721%, white 0.722%, 0.723%, white 0.724%, 0.725%, white 0.726%, 0.727%, white 0.728%, 0.729%, white 0.73%, 0.731%, white 0.732%, 0.733%, white 0.734%, 0.735%, white 0.736%, 0.737%, white 0.738%, 0.739%, white 0.74%, 0.741%, white 0.742%, 0.743%, white 0.744%, 0.745%, white 0.746%, 0.747%, white 0.748%, 0.749%, white 0.75%, 0.751%, white 0.752%, 0.753%, white 0.754%, 0.755%, white 0.756%, 0.757%, white 0.758%, 0.759%, white 0.76%, 0.761%, white 0.762%, 0.763%, white 0.764%, 0.765%, white 0.766%, 0.767%, white 0.768%, 0.769%, white 0.77%, 0.771%, white 0.772%, 0.773%, white 0.774%, 0.775%, white 0.776%, 0.777%, white 0.778%, 0.779%, white 0.78%, 0.781%, white 0.782%, 0.783%, white 0.784%, 0.785%, white 0.786%, 0.787%, white 0.788%, 0.789%, white 0.79%, 0.791%, white 0.792%, 0.793%, white 0.794%, 0.795%, white 0.796%, 0.797%, white 0.798%, 0.799%, white 0.8%, 0.801%, white 0.802%, 0.803%, white 0.804%, 0.805%, white 0.806%, 0.807%, white 0.808%, 0.809%, white 0.81%, 0.811%, white 0.812%, 0.813%, white 0.814%, 0.815%, white 0.816%, 0.817%, white 0.818%, 0.819%, white 0.82%, 0.821%, white 0.822%, 0.823%, white 0.824%, 0.825%, white 0.826%, 0.827%, white 0.828%, 0.829%, white 0.83%, 0.831%, white 0.832%, 0.833%, white 0.834%, 0.835%, white 0.836%, 0.837%, white 0.838%, 0.839%, white 0.84%, 0.841%, white 0.842%, 0.843%, white 0.844%, 0.845%, white 0.846%, 0.847%, white 0.848%, 0.849%, white 0.85%, 0.851%, white 0.852%, 0.853%, white 0.854%, 0.855%, white 0.856%, 0.857%, white 0.858%, 0.859%, white 0.86%, 0.861%, white 0.862%, 0.863%, white 0.864%, 0.865%, white 0.866%, 0.867%, white 0.868%, 0.869%, white 0.87%, 0.871%, white 0.872%, 0.873%, white 0.874%, 0.875%, white 0.876%, 0.877%, white 0.878%, 0.879%, white 0.88%, 0.881%, white 0.882%, 0.883%, white 0.884%, 0.885%, white 0.886%, 0.887%, white 0.888%, 0.889%, white 0.89%, 0.891%, white 0.892%, 0.893%, white 0.894%, 0.895%, white 0.896%, 0.897%, white 0.898%, 0.899%, white 0.9%, 0.901%, white 0.902%, 0.903%, white 0.904%, 0.905%, white 0.906%, 0.907%, white 0.908%, 0.909%, white 0.91%, 0.911%, white 0.912%, 0.913%, white 0.914%, 0.915%, white 0.916%, 0.917%, white 0.918%, 0.919%, white 0.92%, 0.921%, white 0.922%, 0.923%, white 0.924%, 0.925%, white 0.926%, 0.927%, white 0.928%, 0.929%, white 0.93%, 0.931%, white 0.932%, 0.933%, white 0.934%, 0.935%, white 0.936%, 0.937%, white 0.938%, 0.939%, white 0.94%, 0.941%, white 0.942%, 0.943%, white 0.944%, 0.945%, white 0.946%, 0.947%, white 0.948%, 0.949%, white 0.95%, 0.951%, white 0.952%, 0.953%, white 0.954%, 0.955%, white 0.956%, 0.957%, white 0.958%, 0.959%, white 0.96%, 0.961%, white 0.962%, 0.963%, white 0.964%, 0.965%, white 0.966%, 0.967%, white 0.968%, 0.969%, white 0.97%, 0.971%, white 0.972%, 0.973%, white 0.974%, 0.975%, white 0.976%, 0.977%, white 0.978%, 0.979%, white 0.98%, 0.981%, white 0.982%, 0.983%, white 0.984%, 0.985%, white 0.986%, 0.987%, white 0.988%, 0.989%, white 0.99%, 0.991%, white 0.992%, 0.993%, white 0.994%, 0.995%, white 0.996%, 0.997%, white 0.998%, 0.999%, black)") is "linear-gradient(white 0%, 0.001%, white 0.002%, 0.003%, white 0.004%, 0.005%, white 0.006%, 0.007%, white 0.008%, 0.009%, white 0.01%, 0.011%, white 0.012%, 0.013%, white 0.014%, 0.015%, white 0.016%, 0.017%, white 0.018%, 0.019%, white 0.02%, 0.021%, white 0.022%, 0.023%, white 0.024%, 0.025%, white 0.026%, 0.027%, white 0.028%, 0.029%, white 0.03%, 0.031%, white 0.032%, 0.033%, white 0.034%, 0.035%, white 0.036%, 0.037%, white 0.038%, 0.039%, white 0.04%, 0.041%, white 0.042%, 0.043%, white 0.044%, 0.045%, white 0.046%, 0.047%, white 0.048%, 0.049%, white 0.05%, 0.051%, white 0.052%, 0.053%, white 0.054%, 0.055%, white 0.056%, 0.057%, white 0.058%, 0.059%, white 0.06%, 0.061%, white 0.062%, 0.063%, white 0.064%, 0.065%, white 0.066%, 0.067%, white 0.068%, 0.069%, white 0.07%, 0.071%, white 0.072%, 0.073%, white 0.074%, 0.075%, white 0.076%, 0.077%, white 0.078%, 0.079%, white 0.08%, 0.081%, white 0.082%, 0.083%, white 0.084%, 0.085%, white 0.086%, 0.087%, white 0.088%, 0.089%, white 0.09%, 0.091%, white 0.092%, 0.093%, white 0.094%, 0.095%, white 0.096%, 0.097%, white 0.098%, 0.099%, white 0.1%, 0.101%, white 0.102%, 0.103%, white 0.104%, 0.105%, white 0.106%, 0.107%, white 0.108%, 0.109%, white 0.11%, 0.111%, white 0.112%, 0.113%, white 0.114%, 0.115%, white 0.116%, 0.117%, white 0.118%, 0.119%, white 0.12%, 0.121%, white 0.122%, 0.123%, white 0.124%, 0.125%, white 0.126%, 0.127%, white 0.128%, 0.129%, white 0.13%, 0.131%, white 0.132%, 0.133%, white 0.134%, 0.135%, white 0.136%, 0.137%, white 0.138%, 0.139%, white 0.14%, 0.141%, white 0.142%, 0.143%, white 0.144%, 0.145%, white 0.146%, 0.147%, white 0.148%, 0.149%, white 0.15%, 0.151%, white 0.152%, 0.153%, white 0.154%, 0.155%, white 0.156%, 0.157%, white 0.158%, 0.159%, white 0.16%, 0.161%, white 0.162%, 0.163%, white 0.164%, 0.165%, white 0.166%, 0.167%, white 0.168%, 0.169%, white 0.17%, 0.171%, white 0.172%, 0.173%, white 0.174%, 0.175%, white 0.176%, 0.177%, white 0.178%, 0.179%, white 0.18%, 0.181%, white 0.182%, 0.183%, white 0.184%, 0.185%, white 0.186%, 0.187%, white 0.188%, 0.189%, white 0.19%, 0.191%, white 0.192%, 0.193%, white 0.194%, 0.195%, white 0.196%, 0.197%, white 0.198%, 0.199%, white 0.2%, 0.201%, white 0.202%, 0.203%, white 0.204%, 0.205%, white 0.206%, 0.207%, white 0.208%, 0.209%, white 0.21%, 0.211%, white 0.212%, 0.213%, white 0.214%, 0.215%, white 0.216%, 0.217%, white 0.218%, 0.219%, white 0.22%, 0.221%, white 0.222%, 0.223%, white 0.224%, 0.225%, white 0.226%, 0.227%, white 0.228%, 0.229%, white 0.23%, 0.231%, white 0.232%, 0.233%, white 0.234%, 0.235%, white 0.236%, 0.237%, white 0.238%, 0.239%, white 0.24%, 0.241%, white 0.242%, 0.243%, white 0.244%, 0.245%, white 0.246%, 0.247%, white 0.248%, 0.249%, white 0.25%, 0.251%, white 0.252%, 0.253%, white 0.254%, 0.255%, white 0.256%, 0.257%, white 0.258%, 0.259%, white 0.26%, 0.261%, white 0.262%, 0.263%, white 0.264%, 0.265%, white 0.266%, 0.267%, white 0.268%, 0.269%, white 0.27%, 0.271%, white 0.272%, 0.273%, white 0.274%, 0.275%, white 0.276%, 0.277%, white 0.278%, 0.279%, white 0.28%, 0.281%, white 0.282%, 0.283%, white 0.284%, 0.285%, white 0.286%, 0.287%, white 0.288%, 0.289%, white 0.29%, 0.291%, white 0.292%, 0.293%, white 0.294%, 0.295%, white 0.296%, 0.297%, white 0.298%, 0.299%, white 0.3%, 0.301%, white 0.302%, 0.303%, white 0.304%, 0.305%, white 0.306%, 0.307%, white 0.308%, 0.309%, white 0.31%, 0.311%, white 0.312%, 0.313%, white 0.314%, 0.315%, white 0.316%, 0.317%, white 0.318%, 0.319%, white 0.32%, 0.321%, white 0.322%, 0.323%, white 0.324%, 0.325%, white 0.326%, 0.327%, white 0.328%, 0.329%, white 0.33%, 0.331%, white 0.332%, 0.333%, white 0.334%, 0.335%, white 0.336%, 0.337%, white 0.338%, 0.339%, white 0.34%, 0.341%, white 0.342%, 0.343%, white 0.344%, 0.345%, white 0.346%, 0.347%, white 0.348%, 0.349%, white 0.35%, 0.351%, white 0.352%, 0.353%, white 0.354%, 0.355%, white 0.356%, 0.357%, white 0.358%, 0.359%, white 0.36%, 0.361%, white 0.362%, 0.363%, white 0.364%, 0.365%, white 0.366%, 0.367%, white 0.368%, 0.369%, white 0.37%, 0.371%, white 0.372%, 0.373%, white 0.374%, 0.375%, white 0.376%, 0.377%, white 0.378%, 0.379%, white 0.38%, 0.381%, white 0.382%, 0.383%, white 0.384%, 0.385%, white 0.386%, 0.387%, white 0.388%, 0.389%, white 0.39%, 0.391%, white 0.392%, 0.393%, white 0.394%, 0.395%, white 0.396%, 0.397%, white 0.398%, 0.399%, white 0.4%, 0.401%, white 0.402%, 0.403%, white 0.404%, 0.405%, white 0.406%, 0.407%, white 0.408%, 0.409%, white 0.41%, 0.411%, white 0.412%, 0.413%, white 0.414%, 0.415%, white 0.416%, 0.417%, white 0.418%, 0.419%, white 0.42%, 0.421%, white 0.422%, 0.423%, white 0.424%, 0.425%, white 0.426%, 0.427%, white 0.428%, 0.429%, white 0.43%, 0.431%, white 0.432%, 0.433%, white 0.434%, 0.435%, white 0.436%, 0.437%, white 0.438%, 0.439%, white 0.44%, 0.441%, white 0.442%, 0.443%, white 0.444%, 0.445%, white 0.446%, 0.447%, white 0.448%, 0.449%, white 0.45%, 0.451%, white 0.452%, 0.453%, white 0.454%, 0.455%, white 0.456%, 0.457%, white 0.458%, 0.459%, white 0.46%, 0.461%, white 0.462%, 0.463%, white 0.464%, 0.465%, white 0.466%, 0.467%, white 0.468%, 0.469%, white 0.47%, 0.471%, white 0.472%, 0.473%, white 0.474%, 0.475%, white 0.476%, 0.477%, white 0.478%, 0.479%, white 0.48%, 0.481%, white 0.482%, 0.483%, white 0.484%, 0.485%, white 0.486%, 0.487%, white 0.488%, 0.489%, white 0.49%, 0.491%, white 0.492%, 0.493%, white 0.494%, 0.495%, white 0.496%, 0.497%, white 0.498%, 0.499%, white 0.5%, 0.501%, white 0.502%, 0.503%, white 0.504%, 0.505%, white 0.506%, 0.507%, white 0.508%, 0.509%, white 0.51%, 0.511%, white 0.512%, 0.513%, white 0.514%, 0.515%, white 0.516%, 0.517%, white 0.518%, 0.519%, white 0.52%, 0.521%, white 0.522%, 0.523%, white 0.524%, 0.525%, white 0.526%, 0.527%, white 0.528%, 0.529%, white 0.53%, 0.531%, white 0.532%, 0.533%, white 0.534%, 0.535%, white 0.536%, 0.537%, white 0.538%, 0.539%, white 0.54%, 0.541%, white 0.542%, 0.543%, white 0.544%, 0.545%, white 0.546%, 0.547%, white 0.548%, 0.549%, white 0.55%, 0.551%, white 0.552%, 0.553%, white 0.554%, 0.555%, white 0.556%, 0.557%, white 0.558%, 0.559%, white 0.56%, 0.561%, white 0.562%, 0.563%, white 0.564%, 0.565%, white 0.566%, 0.567%, white 0.568%, 0.569%, white 0.57%, 0.571%, white 0.572%, 0.573%, white 0.574%, 0.575%, white 0.576%, 0.577%, white 0.578%, 0.579%, white 0.58%, 0.581%, white 0.582%, 0.583%, white 0.584%, 0.585%, white 0.586%, 0.587%, white 0.588%, 0.589%, white 0.59%, 0.591%, white 0.592%, 0.593%, white 0.594%, 0.595%, white 0.596%, 0.597%, white 0.598%, 0.599%, white 0.6%, 0.601%, white 0.602%, 0.603%, white 0.604%, 0.605%, white 0.606%, 0.607%, white 0.608%, 0.609%, white 0.61%, 0.611%, white 0.612%, 0.613%, white 0.614%, 0.615%, white 0.616%, 0.617%, white 0.618%, 0.619%, white 0.62%, 0.621%, white 0.622%, 0.623%, white 0.624%, 0.625%, white 0.626%, 0.627%, white 0.628%, 0.629%, white 0.63%, 0.631%, white 0.632%, 0.633%, white 0.634%, 0.635%, white 0.636%, 0.637%, white 0.638%, 0.639%, white 0.64%, 0.641%, white 0.642%, 0.643%, white 0.644%, 0.645%, white 0.646%, 0.647%, white 0.648%, 0.649%, white 0.65%, 0.651%, white 0.652%, 0.653%, white 0.654%, 0.655%, white 0.656%, 0.657%, white 0.658%, 0.659%, white 0.66%, 0.661%, white 0.662%, 0.663%, white 0.664%, 0.665%, white 0.666%, 0.667%, white 0.668%, 0.669%, white 0.67%, 0.671%, white 0.672%, 0.673%, white 0.674%, 0.675%, white 0.676%, 0.677%, white 0.678%, 0.679%, white 0.68%, 0.681%, white 0.682%, 0.683%, white 0.684%, 0.685%, white 0.686%, 0.687%, white 0.688%, 0.689%, white 0.69%, 0.691%, white 0.692%, 0.693%, white 0.694%, 0.695%, white 0.696%, 0.697%, white 0.698%, 0.699%, white 0.7%, 0.701%, white 0.702%, 0.703%, white 0.704%, 0.705%, white 0.706%, 0.707%, white 0.708%, 0.709%, white 0.71%, 0.711%, white 0.712%, 0.713%, white 0.714%, 0.715%, white 0.716%, 0.717%, white 0.718%, 0.719%, white 0.72%, 0.721%, white 0.722%, 0.723%, white 0.724%, 0.725%, white 0.726%, 0.727%, white 0.728%, 0.729%, white 0.73%, 0.731%, white 0.732%, 0.733%, white 0.734%, 0.735%, white 0.736%, 0.737%, white 0.738%, 0.739%, white 0.74%, 0.741%, white 0.742%, 0.743%, white 0.744%, 0.745%, white 0.746%, 0.747%, white 0.748%, 0.749%, white 0.75%, 0.751%, white 0.752%, 0.753%, white 0.754%, 0.755%, white 0.756%, 0.757%, white 0.758%, 0.759%, white 0.76%, 0.761%, white 0.762%, 0.763%, white 0.764%, 0.765%, white 0.766%, 0.767%, white 0.768%, 0.769%, white 0.77%, 0.771%, white 0.772%, 0.773%, white 0.774%, 0.775%, white 0.776%, 0.777%, white 0.778%, 0.779%, white 0.78%, 0.781%, white 0.782%, 0.783%, white 0.784%, 0.785%, white 0.786%, 0.787%, white 0.788%, 0.789%, white 0.79%, 0.791%, white 0.792%, 0.793%, white 0.794%, 0.795%, white 0.796%, 0.797%, white 0.798%, 0.799%, white 0.8%, 0.801%, white 0.802%, 0.803%, white 0.804%, 0.805%, white 0.806%, 0.807%, white 0.808%, 0.809%, white 0.81%, 0.811%, white 0.812%, 0.813%, white 0.814%, 0.815%, white 0.816%, 0.817%, white 0.818%, 0.819%, white 0.82%, 0.821%, white 0.822%, 0.823%, white 0.824%, 0.825%, white 0.826%, 0.827%, white 0.828%, 0.829%, white 0.83%, 0.831%, white 0.832%, 0.833%, white 0.834%, 0.835%, white 0.836%, 0.837%, white 0.838%, 0.839%, white 0.84%, 0.841%, white 0.842%, 0.843%, white 0.844%, 0.845%, white 0.846%, 0.847%, white 0.848%, 0.849%, white 0.85%, 0.851%, white 0.852%, 0.853%, white 0.854%, 0.855%, white 0.856%, 0.857%, white 0.858%, 0.859%, white 0.86%, 0.861%, white 0.862%, 0.863%, white 0.864%, 0.865%, white 0.866%, 0.867%, white 0.868%, 0.869%, white 0.87%, 0.871%, white 0.872%, 0.873%, white 0.874%, 0.875%, white 0.876%, 0.877%, white 0.878%, 0.879%, white 0.88%, 0.881%, white 0.882%, 0.883%, white 0.884%, 0.885%, white 0.886%, 0.887%, white 0.888%, 0.889%, white 0.89%, 0.891%, white 0.892%, 0.893%, white 0.894%, 0.895%, white 0.896%, 0.897%, white 0.898%, 0.899%, white 0.9%, 0.901%, white 0.902%, 0.903%, white 0.904%, 0.905%, white 0.906%, 0.907%, white 0.908%, 0.909%, white 0.91%, 0.911%, white 0.912%, 0.913%, white 0.914%, 0.915%, white 0.916%, 0.917%, white 0.918%, 0.919%, white 0.92%, 0.921%, white 0.922%, 0.923%, white 0.924%, 0.925%, white 0.926%, 0.927%, white 0.928%, 0.929%, white 0.93%, 0.931%, white 0.932%, 0.933%, white 0.934%, 0.935%, white 0.936%, 0.937%, white 0.938%, 0.939%, white 0.94%, 0.941%, white 0.942%, 0.943%, white 0.944%, 0.945%, white 0.946%, 0.947%, white 0.948%, 0.949%, white 0.95%, 0.951%, white 0.952%, 0.953%, white 0.954%, 0.955%, white 0.956%, 0.957%, white 0.958%, 0.959%, white 0.96%, 0.961%, white 0.962%, 0.963%, white 0.964%, 0.965%, white 0.966%, 0.967%, white 0.968%, 0.969%, white 0.97%, 0.971%, white 0.972%, 0.973%, white 0.974%, 0.975%, white 0.976%, 0.977%, white 0.978%, 0.979%, white 0.98%, 0.981%, white 0.982%, 0.983%, white 0.984%, 0.985%, white 0.986%, 0.987%, white 0.988%, 0.989%, white 0.99%, 0.991%, white 0.992%, 0.993%, white 0.994%, 0.995%, white 0.996%, 0.997%, white 0.998%, 0.999%, black)"
 repeating-linear-gradient
 
 
 PASS testGradient("background-image: repeating-linear-gradient(black, white)") is "repeating-linear-gradient(black, white)"
+PASS testGradient("background-image: repeating-linear-gradient(black, 35%, white)") is "repeating-linear-gradient(black, 35%, white)"
 radial-gradient
 
 
 PASS testGradient("background-image: radial-gradient(white, black)") is "radial-gradient(white, black)"
 PASS testGradient("background-image: radial-gradient(at bottom right, white, black)") is "radial-gradient(at 100% 100%, white, black)"
 PASS testGradient("background-image: radial-gradient(farthest-corner, white, black)") is "radial-gradient(white, black)"
+PASS testGradient("background-image: radial-gradient(farthest-corner, white, 35%, black)") is "radial-gradient(white, 35%, black)"
 PASS testGradient("background-image: radial-gradient(closest-side, white, black)") is "radial-gradient(closest-side, white, black)"
 PASS testGradient("background-image: radial-gradient(ellipse, white, black)") is "radial-gradient(white, black)"
 PASS testGradient("background-image: radial-gradient(ellipse farthest-corner, white, black)") is "radial-gradient(white, black)"
@@ -49,13 +62,24 @@ PASS testGradient("background-image: radial-gradient(circle 10%, white, black)")
 PASS testGradient("background-image: radial-gradient(circle 10px 10px, white, black)") is "none"
 PASS testGradient("background-image: radial-gradient(ellipse 10%, white, black)") is "none"
 PASS testGradient("background-image: radial-gradient(ellipse 10px, white, black)") is "none"
+PASS testGradient("background-image: radial-gradient(25%, black)") is "none"
+PASS testGradient("background-image: radial-gradient(white, 25%)") is "none"
+PASS testGradient("background-image: radial-gradient(white, black, 25%)") is "none"
+PASS testGradient("background-image: radial-gradient(25%, white, black)") is "none"
+PASS testGradient("background-image: radial-gradient(white,, black)") is "none"
+PASS testGradient("background-image: radial-gradient(ellipse 10px, white, 25%, 75%, black)") is "none"
 PASS testGradient("background-image: radial-gradient(ellipse 10px 20px, white, black)") is "radial-gradient(10px 20px, white, black)"
 PASS testGradient("background-image: radial-gradient(circle 10px, white, black)") is "radial-gradient(10px, white, black)"
 PASS testGradient("background-image: radial-gradient(10px 10px at center, white, black)") is "radial-gradient(10px 10px at 50% 50%, white, black)"
+PASS testGradient("background-image: radial-gradient(10px 10px at center, white, 50%, black)") is "radial-gradient(10px 10px at 50% 50%, white, 50%, black)"
+PASS testGradient("background-image: radial-gradient(10px 10px at center, white, 0%, black)") is "radial-gradient(10px 10px at 50% 50%, white, 0%, black)"
+PASS testGradient("background-image: radial-gradient(10px 10px at center, white, 100%, black)") is "radial-gradient(10px 10px at 50% 50%, white, 100%, black)"
+PASS testGradient("background-image: radial-gradient(10px 10px at 50% 50%, white 0%, 0.001%, white 0.002%, 0.003%, white 0.004%, 0.005%, white 0.006%, 0.007%, white 0.008%, 0.009%, white 0.01%, 0.011%, white 0.012%, 0.013%, white 0.014%, 0.015%, white 0.016%, 0.017%, white 0.018%, 0.019%, white 0.02%, 0.021%, white 0.022%, 0.023%, white 0.024%, 0.025%, white 0.026%, 0.027%, white 0.028%, 0.029%, white 0.03%, 0.031%, white 0.032%, 0.033%, white 0.034%, 0.035%, white 0.036%, 0.037%, white 0.038%, 0.039%, white 0.04%, 0.041%, white 0.042%, 0.043%, white 0.044%, 0.045%, white 0.046%, 0.047%, white 0.048%, 0.049%, white 0.05%, 0.051%, white 0.052%, 0.053%, white 0.054%, 0.055%, white 0.056%, 0.057%, white 0.058%, 0.059%, white 0.06%, 0.061%, white 0.062%, 0.063%, white 0.064%, 0.065%, white 0.066%, 0.067%, white 0.068%, 0.069%, white 0.07%, 0.071%, white 0.072%, 0.073%, white 0.074%, 0.075%, white 0.076%, 0.077%, white 0.078%, 0.079%, white 0.08%, 0.081%, white 0.082%, 0.083%, white 0.084%, 0.085%, white 0.086%, 0.087%, white 0.088%, 0.089%, white 0.09%, 0.091%, white 0.092%, 0.093%, white 0.094%, 0.095%, white 0.096%, 0.097%, white 0.098%, 0.099%, white 0.1%, 0.101%, white 0.102%, 0.103%, white 0.104%, 0.105%, white 0.106%, 0.107%, white 0.108%, 0.109%, white 0.11%, 0.111%, white 0.112%, 0.113%, white 0.114%, 0.115%, white 0.116%, 0.117%, white 0.118%, 0.119%, white 0.12%, 0.121%, white 0.122%, 0.123%, white 0.124%, 0.125%, white 0.126%, 0.127%, white 0.128%, 0.129%, white 0.13%, 0.131%, white 0.132%, 0.133%, white 0.134%, 0.135%, white 0.136%, 0.137%, white 0.138%, 0.139%, white 0.14%, 0.141%, white 0.142%, 0.143%, white 0.144%, 0.145%, white 0.146%, 0.147%, white 0.148%, 0.149%, white 0.15%, 0.151%, white 0.152%, 0.153%, white 0.154%, 0.155%, white 0.156%, 0.157%, white 0.158%, 0.159%, white 0.16%, 0.161%, white 0.162%, 0.163%, white 0.164%, 0.165%, white 0.166%, 0.167%, white 0.168%, 0.169%, white 0.17%, 0.171%, white 0.172%, 0.173%, white 0.174%, 0.175%, white 0.176%, 0.177%, white 0.178%, 0.179%, white 0.18%, 0.181%, white 0.182%, 0.183%, white 0.184%, 0.185%, white 0.186%, 0.187%, white 0.188%, 0.189%, white 0.19%, 0.191%, white 0.192%, 0.193%, white 0.194%, 0.195%, white 0.196%, 0.197%, white 0.198%, 0.199%, white 0.2%, 0.201%, white 0.202%, 0.203%, white 0.204%, 0.205%, white 0.206%, 0.207%, white 0.208%, 0.209%, white 0.21%, 0.211%, white 0.212%, 0.213%, white 0.214%, 0.215%, white 0.216%, 0.217%, white 0.218%, 0.219%, white 0.22%, 0.221%, white 0.222%, 0.223%, white 0.224%, 0.225%, white 0.226%, 0.227%, white 0.228%, 0.229%, white 0.23%, 0.231%, white 0.232%, 0.233%, white 0.234%, 0.235%, white 0.236%, 0.237%, white 0.238%, 0.239%, white 0.24%, 0.241%, white 0.242%, 0.243%, white 0.244%, 0.245%, white 0.246%, 0.247%, white 0.248%, 0.249%, white 0.25%, 0.251%, white 0.252%, 0.253%, white 0.254%, 0.255%, white 0.256%, 0.257%, white 0.258%, 0.259%, white 0.26%, 0.261%, white 0.262%, 0.263%, white 0.264%, 0.265%, white 0.266%, 0.267%, white 0.268%, 0.269%, white 0.27%, 0.271%, white 0.272%, 0.273%, white 0.274%, 0.275%, white 0.276%, 0.277%, white 0.278%, 0.279%, white 0.28%, 0.281%, white 0.282%, 0.283%, white 0.284%, 0.285%, white 0.286%, 0.287%, white 0.288%, 0.289%, white 0.29%, 0.291%, white 0.292%, 0.293%, white 0.294%, 0.295%, white 0.296%, 0.297%, white 0.298%, 0.299%, white 0.3%, 0.301%, white 0.302%, 0.303%, white 0.304%, 0.305%, white 0.306%, 0.307%, white 0.308%, 0.309%, white 0.31%, 0.311%, white 0.312%, 0.313%, white 0.314%, 0.315%, white 0.316%, 0.317%, white 0.318%, 0.319%, white 0.32%, 0.321%, white 0.322%, 0.323%, white 0.324%, 0.325%, white 0.326%, 0.327%, white 0.328%, 0.329%, white 0.33%, 0.331%, white 0.332%, 0.333%, white 0.334%, 0.335%, white 0.336%, 0.337%, white 0.338%, 0.339%, white 0.34%, 0.341%, white 0.342%, 0.343%, white 0.344%, 0.345%, white 0.346%, 0.347%, white 0.348%, 0.349%, white 0.35%, 0.351%, white 0.352%, 0.353%, white 0.354%, 0.355%, white 0.356%, 0.357%, white 0.358%, 0.359%, white 0.36%, 0.361%, white 0.362%, 0.363%, white 0.364%, 0.365%, white 0.366%, 0.367%, white 0.368%, 0.369%, white 0.37%, 0.371%, white 0.372%, 0.373%, white 0.374%, 0.375%, white 0.376%, 0.377%, white 0.378%, 0.379%, white 0.38%, 0.381%, white 0.382%, 0.383%, white 0.384%, 0.385%, white 0.386%, 0.387%, white 0.388%, 0.389%, white 0.39%, 0.391%, white 0.392%, 0.393%, white 0.394%, 0.395%, white 0.396%, 0.397%, white 0.398%, 0.399%, white 0.4%, 0.401%, white 0.402%, 0.403%, white 0.404%, 0.405%, white 0.406%, 0.407%, white 0.408%, 0.409%, white 0.41%, 0.411%, white 0.412%, 0.413%, white 0.414%, 0.415%, white 0.416%, 0.417%, white 0.418%, 0.419%, white 0.42%, 0.421%, white 0.422%, 0.423%, white 0.424%, 0.425%, white 0.426%, 0.427%, white 0.428%, 0.429%, white 0.43%, 0.431%, white 0.432%, 0.433%, white 0.434%, 0.435%, white 0.436%, 0.437%, white 0.438%, 0.439%, white 0.44%, 0.441%, white 0.442%, 0.443%, white 0.444%, 0.445%, white 0.446%, 0.447%, white 0.448%, 0.449%, white 0.45%, 0.451%, white 0.452%, 0.453%, white 0.454%, 0.455%, white 0.456%, 0.457%, white 0.458%, 0.459%, white 0.46%, 0.461%, white 0.462%, 0.463%, white 0.464%, 0.465%, white 0.466%, 0.467%, white 0.468%, 0.469%, white 0.47%, 0.471%, white 0.472%, 0.473%, white 0.474%, 0.475%, white 0.476%, 0.477%, white 0.478%, 0.479%, white 0.48%, 0.481%, white 0.482%, 0.483%, white 0.484%, 0.485%, white 0.486%, 0.487%, white 0.488%, 0.489%, white 0.49%, 0.491%, white 0.492%, 0.493%, white 0.494%, 0.495%, white 0.496%, 0.497%, white 0.498%, 0.499%, white 0.5%, 0.501%, white 0.502%, 0.503%, white 0.504%, 0.505%, white 0.506%, 0.507%, white 0.508%, 0.509%, white 0.51%, 0.511%, white 0.512%, 0.513%, white 0.514%, 0.515%, white 0.516%, 0.517%, white 0.518%, 0.519%, white 0.52%, 0.521%, white 0.522%, 0.523%, white 0.524%, 0.525%, white 0.526%, 0.527%, white 0.528%, 0.529%, white 0.53%, 0.531%, white 0.532%, 0.533%, white 0.534%, 0.535%, white 0.536%, 0.537%, white 0.538%, 0.539%, white 0.54%, 0.541%, white 0.542%, 0.543%, white 0.544%, 0.545%, white 0.546%, 0.547%, white 0.548%, 0.549%, white 0.55%, 0.551%, white 0.552%, 0.553%, white 0.554%, 0.555%, white 0.556%, 0.557%, white 0.558%, 0.559%, white 0.56%, 0.561%, white 0.562%, 0.563%, white 0.564%, 0.565%, white 0.566%, 0.567%, white 0.568%, 0.569%, white 0.57%, 0.571%, white 0.572%, 0.573%, white 0.574%, 0.575%, white 0.576%, 0.577%, white 0.578%, 0.579%, white 0.58%, 0.581%, white 0.582%, 0.583%, white 0.584%, 0.585%, white 0.586%, 0.587%, white 0.588%, 0.589%, white 0.59%, 0.591%, white 0.592%, 0.593%, white 0.594%, 0.595%, white 0.596%, 0.597%, white 0.598%, 0.599%, white 0.6%, 0.601%, white 0.602%, 0.603%, white 0.604%, 0.605%, white 0.606%, 0.607%, white 0.608%, 0.609%, white 0.61%, 0.611%, white 0.612%, 0.613%, white 0.614%, 0.615%, white 0.616%, 0.617%, white 0.618%, 0.619%, white 0.62%, 0.621%, white 0.622%, 0.623%, white 0.624%, 0.625%, white 0.626%, 0.627%, white 0.628%, 0.629%, white 0.63%, 0.631%, white 0.632%, 0.633%, white 0.634%, 0.635%, white 0.636%, 0.637%, white 0.638%, 0.639%, white 0.64%, 0.641%, white 0.642%, 0.643%, white 0.644%, 0.645%, white 0.646%, 0.647%, white 0.648%, 0.649%, white 0.65%, 0.651%, white 0.652%, 0.653%, white 0.654%, 0.655%, white 0.656%, 0.657%, white 0.658%, 0.659%, white 0.66%, 0.661%, white 0.662%, 0.663%, white 0.664%, 0.665%, white 0.666%, 0.667%, white 0.668%, 0.669%, white 0.67%, 0.671%, white 0.672%, 0.673%, white 0.674%, 0.675%, white 0.676%, 0.677%, white 0.678%, 0.679%, white 0.68%, 0.681%, white 0.682%, 0.683%, white 0.684%, 0.685%, white 0.686%, 0.687%, white 0.688%, 0.689%, white 0.69%, 0.691%, white 0.692%, 0.693%, white 0.694%, 0.695%, white 0.696%, 0.697%, white 0.698%, 0.699%, white 0.7%, 0.701%, white 0.702%, 0.703%, white 0.704%, 0.705%, white 0.706%, 0.707%, white 0.708%, 0.709%, white 0.71%, 0.711%, white 0.712%, 0.713%, white 0.714%, 0.715%, white 0.716%, 0.717%, white 0.718%, 0.719%, white 0.72%, 0.721%, white 0.722%, 0.723%, white 0.724%, 0.725%, white 0.726%, 0.727%, white 0.728%, 0.729%, white 0.73%, 0.731%, white 0.732%, 0.733%, white 0.734%, 0.735%, white 0.736%, 0.737%, white 0.738%, 0.739%, white 0.74%, 0.741%, white 0.742%, 0.743%, white 0.744%, 0.745%, white 0.746%, 0.747%, white 0.748%, 0.749%, white 0.75%, 0.751%, white 0.752%, 0.753%, white 0.754%, 0.755%, white 0.756%, 0.757%, white 0.758%, 0.759%, white 0.76%, 0.761%, white 0.762%, 0.763%, white 0.764%, 0.765%, white 0.766%, 0.767%, white 0.768%, 0.769%, white 0.77%, 0.771%, white 0.772%, 0.773%, white 0.774%, 0.775%, white 0.776%, 0.777%, white 0.778%, 0.779%, white 0.78%, 0.781%, white 0.782%, 0.783%, white 0.784%, 0.785%, white 0.786%, 0.787%, white 0.788%, 0.789%, white 0.79%, 0.791%, white 0.792%, 0.793%, white 0.794%, 0.795%, white 0.796%, 0.797%, white 0.798%, 0.799%, white 0.8%, 0.801%, white 0.802%, 0.803%, white 0.804%, 0.805%, white 0.806%, 0.807%, white 0.808%, 0.809%, white 0.81%, 0.811%, white 0.812%, 0.813%, white 0.814%, 0.815%, white 0.816%, 0.817%, white 0.818%, 0.819%, white 0.82%, 0.821%, white 0.822%, 0.823%, white 0.824%, 0.825%, white 0.826%, 0.827%, white 0.828%, 0.829%, white 0.83%, 0.831%, white 0.832%, 0.833%, white 0.834%, 0.835%, white 0.836%, 0.837%, white 0.838%, 0.839%, white 0.84%, 0.841%, white 0.842%, 0.843%, white 0.844%, 0.845%, white 0.846%, 0.847%, white 0.848%, 0.849%, white 0.85%, 0.851%, white 0.852%, 0.853%, white 0.854%, 0.855%, white 0.856%, 0.857%, white 0.858%, 0.859%, white 0.86%, 0.861%, white 0.862%, 0.863%, white 0.864%, 0.865%, white 0.866%, 0.867%, white 0.868%, 0.869%, white 0.87%, 0.871%, white 0.872%, 0.873%, white 0.874%, 0.875%, white 0.876%, 0.877%, white 0.878%, 0.879%, white 0.88%, 0.881%, white 0.882%, 0.883%, white 0.884%, 0.885%, white 0.886%, 0.887%, white 0.888%, 0.889%, white 0.89%, 0.891%, white 0.892%, 0.893%, white 0.894%, 0.895%, white 0.896%, 0.897%, white 0.898%, 0.899%, white 0.9%, 0.901%, white 0.902%, 0.903%, white 0.904%, 0.905%, white 0.906%, 0.907%, white 0.908%, 0.909%, white 0.91%, 0.911%, white 0.912%, 0.913%, white 0.914%, 0.915%, white 0.916%, 0.917%, white 0.918%, 0.919%, white 0.92%, 0.921%, white 0.922%, 0.923%, white 0.924%, 0.925%, white 0.926%, 0.927%, white 0.928%, 0.929%, white 0.93%, 0.931%, white 0.932%, 0.933%, white 0.934%, 0.935%, white 0.936%, 0.937%, white 0.938%, 0.939%, white 0.94%, 0.941%, white 0.942%, 0.943%, white 0.944%, 0.945%, white 0.946%, 0.947%, white 0.948%, 0.949%, white 0.95%, 0.951%, white 0.952%, 0.953%, white 0.954%, 0.955%, white 0.956%, 0.957%, white 0.958%, 0.959%, white 0.96%, 0.961%, white 0.962%, 0.963%, white 0.964%, 0.965%, white 0.966%, 0.967%, white 0.968%, 0.969%, white 0.97%, 0.971%, white 0.972%, 0.973%, white 0.974%, 0.975%, white 0.976%, 0.977%, white 0.978%, 0.979%, white 0.98%, 0.981%, white 0.982%, 0.983%, white 0.984%, 0.985%, white 0.986%, 0.987%, white 0.988%, 0.989%, white 0.99%, 0.991%, white 0.992%, 0.993%, white 0.994%, 0.995%, white 0.996%, 0.997%, white 0.998%, 0.999%, black)") is "radial-gradient(10px 10px at 50% 50%, white 0%, 0.001%, white 0.002%, 0.003%, white 0.004%, 0.005%, white 0.006%, 0.007%, white 0.008%, 0.009%, white 0.01%, 0.011%, white 0.012%, 0.013%, white 0.014%, 0.015%, white 0.016%, 0.017%, white 0.018%, 0.019%, white 0.02%, 0.021%, white 0.022%, 0.023%, white 0.024%, 0.025%, white 0.026%, 0.027%, white 0.028%, 0.029%, white 0.03%, 0.031%, white 0.032%, 0.033%, white 0.034%, 0.035%, white 0.036%, 0.037%, white 0.038%, 0.039%, white 0.04%, 0.041%, white 0.042%, 0.043%, white 0.044%, 0.045%, white 0.046%, 0.047%, white 0.048%, 0.049%, white 0.05%, 0.051%, white 0.052%, 0.053%, white 0.054%, 0.055%, white 0.056%, 0.057%, white 0.058%, 0.059%, white 0.06%, 0.061%, white 0.062%, 0.063%, white 0.064%, 0.065%, white 0.066%, 0.067%, white 0.068%, 0.069%, white 0.07%, 0.071%, white 0.072%, 0.073%, white 0.074%, 0.075%, white 0.076%, 0.077%, white 0.078%, 0.079%, white 0.08%, 0.081%, white 0.082%, 0.083%, white 0.084%, 0.085%, white 0.086%, 0.087%, white 0.088%, 0.089%, white 0.09%, 0.091%, white 0.092%, 0.093%, white 0.094%, 0.095%, white 0.096%, 0.097%, white 0.098%, 0.099%, white 0.1%, 0.101%, white 0.102%, 0.103%, white 0.104%, 0.105%, white 0.106%, 0.107%, white 0.108%, 0.109%, white 0.11%, 0.111%, white 0.112%, 0.113%, white 0.114%, 0.115%, white 0.116%, 0.117%, white 0.118%, 0.119%, white 0.12%, 0.121%, white 0.122%, 0.123%, white 0.124%, 0.125%, white 0.126%, 0.127%, white 0.128%, 0.129%, white 0.13%, 0.131%, white 0.132%, 0.133%, white 0.134%, 0.135%, white 0.136%, 0.137%, white 0.138%, 0.139%, white 0.14%, 0.141%, white 0.142%, 0.143%, white 0.144%, 0.145%, white 0.146%, 0.147%, white 0.148%, 0.149%, white 0.15%, 0.151%, white 0.152%, 0.153%, white 0.154%, 0.155%, white 0.156%, 0.157%, white 0.158%, 0.159%, white 0.16%, 0.161%, white 0.162%, 0.163%, white 0.164%, 0.165%, white 0.166%, 0.167%, white 0.168%, 0.169%, white 0.17%, 0.171%, white 0.172%, 0.173%, white 0.174%, 0.175%, white 0.176%, 0.177%, white 0.178%, 0.179%, white 0.18%, 0.181%, white 0.182%, 0.183%, white 0.184%, 0.185%, white 0.186%, 0.187%, white 0.188%, 0.189%, white 0.19%, 0.191%, white 0.192%, 0.193%, white 0.194%, 0.195%, white 0.196%, 0.197%, white 0.198%, 0.199%, white 0.2%, 0.201%, white 0.202%, 0.203%, white 0.204%, 0.205%, white 0.206%, 0.207%, white 0.208%, 0.209%, white 0.21%, 0.211%, white 0.212%, 0.213%, white 0.214%, 0.215%, white 0.216%, 0.217%, white 0.218%, 0.219%, white 0.22%, 0.221%, white 0.222%, 0.223%, white 0.224%, 0.225%, white 0.226%, 0.227%, white 0.228%, 0.229%, white 0.23%, 0.231%, white 0.232%, 0.233%, white 0.234%, 0.235%, white 0.236%, 0.237%, white 0.238%, 0.239%, white 0.24%, 0.241%, white 0.242%, 0.243%, white 0.244%, 0.245%, white 0.246%, 0.247%, white 0.248%, 0.249%, white 0.25%, 0.251%, white 0.252%, 0.253%, white 0.254%, 0.255%, white 0.256%, 0.257%, white 0.258%, 0.259%, white 0.26%, 0.261%, white 0.262%, 0.263%, white 0.264%, 0.265%, white 0.266%, 0.267%, white 0.268%, 0.269%, white 0.27%, 0.271%, white 0.272%, 0.273%, white 0.274%, 0.275%, white 0.276%, 0.277%, white 0.278%, 0.279%, white 0.28%, 0.281%, white 0.282%, 0.283%, white 0.284%, 0.285%, white 0.286%, 0.287%, white 0.288%, 0.289%, white 0.29%, 0.291%, white 0.292%, 0.293%, white 0.294%, 0.295%, white 0.296%, 0.297%, white 0.298%, 0.299%, white 0.3%, 0.301%, white 0.302%, 0.303%, white 0.304%, 0.305%, white 0.306%, 0.307%, white 0.308%, 0.309%, white 0.31%, 0.311%, white 0.312%, 0.313%, white 0.314%, 0.315%, white 0.316%, 0.317%, white 0.318%, 0.319%, white 0.32%, 0.321%, white 0.322%, 0.323%, white 0.324%, 0.325%, white 0.326%, 0.327%, white 0.328%, 0.329%, white 0.33%, 0.331%, white 0.332%, 0.333%, white 0.334%, 0.335%, white 0.336%, 0.337%, white 0.338%, 0.339%, white 0.34%, 0.341%, white 0.342%, 0.343%, white 0.344%, 0.345%, white 0.346%, 0.347%, white 0.348%, 0.349%, white 0.35%, 0.351%, white 0.352%, 0.353%, white 0.354%, 0.355%, white 0.356%, 0.357%, white 0.358%, 0.359%, white 0.36%, 0.361%, white 0.362%, 0.363%, white 0.364%, 0.365%, white 0.366%, 0.367%, white 0.368%, 0.369%, white 0.37%, 0.371%, white 0.372%, 0.373%, white 0.374%, 0.375%, white 0.376%, 0.377%, white 0.378%, 0.379%, white 0.38%, 0.381%, white 0.382%, 0.383%, white 0.384%, 0.385%, white 0.386%, 0.387%, white 0.388%, 0.389%, white 0.39%, 0.391%, white 0.392%, 0.393%, white 0.394%, 0.395%, white 0.396%, 0.397%, white 0.398%, 0.399%, white 0.4%, 0.401%, white 0.402%, 0.403%, white 0.404%, 0.405%, white 0.406%, 0.407%, white 0.408%, 0.409%, white 0.41%, 0.411%, white 0.412%, 0.413%, white 0.414%, 0.415%, white 0.416%, 0.417%, white 0.418%, 0.419%, white 0.42%, 0.421%, white 0.422%, 0.423%, white 0.424%, 0.425%, white 0.426%, 0.427%, white 0.428%, 0.429%, white 0.43%, 0.431%, white 0.432%, 0.433%, white 0.434%, 0.435%, white 0.436%, 0.437%, white 0.438%, 0.439%, white 0.44%, 0.441%, white 0.442%, 0.443%, white 0.444%, 0.445%, white 0.446%, 0.447%, white 0.448%, 0.449%, white 0.45%, 0.451%, white 0.452%, 0.453%, white 0.454%, 0.455%, white 0.456%, 0.457%, white 0.458%, 0.459%, white 0.46%, 0.461%, white 0.462%, 0.463%, white 0.464%, 0.465%, white 0.466%, 0.467%, white 0.468%, 0.469%, white 0.47%, 0.471%, white 0.472%, 0.473%, white 0.474%, 0.475%, white 0.476%, 0.477%, white 0.478%, 0.479%, white 0.48%, 0.481%, white 0.482%, 0.483%, white 0.484%, 0.485%, white 0.486%, 0.487%, white 0.488%, 0.489%, white 0.49%, 0.491%, white 0.492%, 0.493%, white 0.494%, 0.495%, white 0.496%, 0.497%, white 0.498%, 0.499%, white 0.5%, 0.501%, white 0.502%, 0.503%, white 0.504%, 0.505%, white 0.506%, 0.507%, white 0.508%, 0.509%, white 0.51%, 0.511%, white 0.512%, 0.513%, white 0.514%, 0.515%, white 0.516%, 0.517%, white 0.518%, 0.519%, white 0.52%, 0.521%, white 0.522%, 0.523%, white 0.524%, 0.525%, white 0.526%, 0.527%, white 0.528%, 0.529%, white 0.53%, 0.531%, white 0.532%, 0.533%, white 0.534%, 0.535%, white 0.536%, 0.537%, white 0.538%, 0.539%, white 0.54%, 0.541%, white 0.542%, 0.543%, white 0.544%, 0.545%, white 0.546%, 0.547%, white 0.548%, 0.549%, white 0.55%, 0.551%, white 0.552%, 0.553%, white 0.554%, 0.555%, white 0.556%, 0.557%, white 0.558%, 0.559%, white 0.56%, 0.561%, white 0.562%, 0.563%, white 0.564%, 0.565%, white 0.566%, 0.567%, white 0.568%, 0.569%, white 0.57%, 0.571%, white 0.572%, 0.573%, white 0.574%, 0.575%, white 0.576%, 0.577%, white 0.578%, 0.579%, white 0.58%, 0.581%, white 0.582%, 0.583%, white 0.584%, 0.585%, white 0.586%, 0.587%, white 0.588%, 0.589%, white 0.59%, 0.591%, white 0.592%, 0.593%, white 0.594%, 0.595%, white 0.596%, 0.597%, white 0.598%, 0.599%, white 0.6%, 0.601%, white 0.602%, 0.603%, white 0.604%, 0.605%, white 0.606%, 0.607%, white 0.608%, 0.609%, white 0.61%, 0.611%, white 0.612%, 0.613%, white 0.614%, 0.615%, white 0.616%, 0.617%, white 0.618%, 0.619%, white 0.62%, 0.621%, white 0.622%, 0.623%, white 0.624%, 0.625%, white 0.626%, 0.627%, white 0.628%, 0.629%, white 0.63%, 0.631%, white 0.632%, 0.633%, white 0.634%, 0.635%, white 0.636%, 0.637%, white 0.638%, 0.639%, white 0.64%, 0.641%, white 0.642%, 0.643%, white 0.644%, 0.645%, white 0.646%, 0.647%, white 0.648%, 0.649%, white 0.65%, 0.651%, white 0.652%, 0.653%, white 0.654%, 0.655%, white 0.656%, 0.657%, white 0.658%, 0.659%, white 0.66%, 0.661%, white 0.662%, 0.663%, white 0.664%, 0.665%, white 0.666%, 0.667%, white 0.668%, 0.669%, white 0.67%, 0.671%, white 0.672%, 0.673%, white 0.674%, 0.675%, white 0.676%, 0.677%, white 0.678%, 0.679%, white 0.68%, 0.681%, white 0.682%, 0.683%, white 0.684%, 0.685%, white 0.686%, 0.687%, white 0.688%, 0.689%, white 0.69%, 0.691%, white 0.692%, 0.693%, white 0.694%, 0.695%, white 0.696%, 0.697%, white 0.698%, 0.699%, white 0.7%, 0.701%, white 0.702%, 0.703%, white 0.704%, 0.705%, white 0.706%, 0.707%, white 0.708%, 0.709%, white 0.71%, 0.711%, white 0.712%, 0.713%, white 0.714%, 0.715%, white 0.716%, 0.717%, white 0.718%, 0.719%, white 0.72%, 0.721%, white 0.722%, 0.723%, white 0.724%, 0.725%, white 0.726%, 0.727%, white 0.728%, 0.729%, white 0.73%, 0.731%, white 0.732%, 0.733%, white 0.734%, 0.735%, white 0.736%, 0.737%, white 0.738%, 0.739%, white 0.74%, 0.741%, white 0.742%, 0.743%, white 0.744%, 0.745%, white 0.746%, 0.747%, white 0.748%, 0.749%, white 0.75%, 0.751%, white 0.752%, 0.753%, white 0.754%, 0.755%, white 0.756%, 0.757%, white 0.758%, 0.759%, white 0.76%, 0.761%, white 0.762%, 0.763%, white 0.764%, 0.765%, white 0.766%, 0.767%, white 0.768%, 0.769%, white 0.77%, 0.771%, white 0.772%, 0.773%, white 0.774%, 0.775%, white 0.776%, 0.777%, white 0.778%, 0.779%, white 0.78%, 0.781%, white 0.782%, 0.783%, white 0.784%, 0.785%, white 0.786%, 0.787%, white 0.788%, 0.789%, white 0.79%, 0.791%, white 0.792%, 0.793%, white 0.794%, 0.795%, white 0.796%, 0.797%, white 0.798%, 0.799%, white 0.8%, 0.801%, white 0.802%, 0.803%, white 0.804%, 0.805%, white 0.806%, 0.807%, white 0.808%, 0.809%, white 0.81%, 0.811%, white 0.812%, 0.813%, white 0.814%, 0.815%, white 0.816%, 0.817%, white 0.818%, 0.819%, white 0.82%, 0.821%, white 0.822%, 0.823%, white 0.824%, 0.825%, white 0.826%, 0.827%, white 0.828%, 0.829%, white 0.83%, 0.831%, white 0.832%, 0.833%, white 0.834%, 0.835%, white 0.836%, 0.837%, white 0.838%, 0.839%, white 0.84%, 0.841%, white 0.842%, 0.843%, white 0.844%, 0.845%, white 0.846%, 0.847%, white 0.848%, 0.849%, white 0.85%, 0.851%, white 0.852%, 0.853%, white 0.854%, 0.855%, white 0.856%, 0.857%, white 0.858%, 0.859%, white 0.86%, 0.861%, white 0.862%, 0.863%, white 0.864%, 0.865%, white 0.866%, 0.867%, white 0.868%, 0.869%, white 0.87%, 0.871%, white 0.872%, 0.873%, white 0.874%, 0.875%, white 0.876%, 0.877%, white 0.878%, 0.879%, white 0.88%, 0.881%, white 0.882%, 0.883%, white 0.884%, 0.885%, white 0.886%, 0.887%, white 0.888%, 0.889%, white 0.89%, 0.891%, white 0.892%, 0.893%, white 0.894%, 0.895%, white 0.896%, 0.897%, white 0.898%, 0.899%, white 0.9%, 0.901%, white 0.902%, 0.903%, white 0.904%, 0.905%, white 0.906%, 0.907%, white 0.908%, 0.909%, white 0.91%, 0.911%, white 0.912%, 0.913%, white 0.914%, 0.915%, white 0.916%, 0.917%, white 0.918%, 0.919%, white 0.92%, 0.921%, white 0.922%, 0.923%, white 0.924%, 0.925%, white 0.926%, 0.927%, white 0.928%, 0.929%, white 0.93%, 0.931%, white 0.932%, 0.933%, white 0.934%, 0.935%, white 0.936%, 0.937%, white 0.938%, 0.939%, white 0.94%, 0.941%, white 0.942%, 0.943%, white 0.944%, 0.945%, white 0.946%, 0.947%, white 0.948%, 0.949%, white 0.95%, 0.951%, white 0.952%, 0.953%, white 0.954%, 0.955%, white 0.956%, 0.957%, white 0.958%, 0.959%, white 0.96%, 0.961%, white 0.962%, 0.963%, white 0.964%, 0.965%, white 0.966%, 0.967%, white 0.968%, 0.969%, white 0.97%, 0.971%, white 0.972%, 0.973%, white 0.974%, 0.975%, white 0.976%, 0.977%, white 0.978%, 0.979%, white 0.98%, 0.981%, white 0.982%, 0.983%, white 0.984%, 0.985%, white 0.986%, 0.987%, white 0.988%, 0.989%, white 0.99%, 0.991%, white 0.992%, 0.993%, white 0.994%, 0.995%, white 0.996%, 0.997%, white 0.998%, 0.999%, black)"
 repeating-radial-gradient
 
 
 PASS testGradient("background-image: repeating-radial-gradient(white, black)") is "repeating-radial-gradient(white, black)"
+PASS testGradient("background-image: repeating-radial-gradient(white, 81%, black)") is "repeating-radial-gradient(white, 81%, black)"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 84522ae..30046e4 100644 (file)
@@ -32,6 +32,12 @@ shouldBe('testGradient("background-image: linear-gradient(to left left)")', '"no
 shouldBe('testGradient("background-image: linear-gradient(to left center)")', '"none"');
 shouldBe('testGradient("background-image: linear-gradient(to left 10deg, black 0%, white)")', '"none"');
 shouldBe('testGradient("background-image: linear-gradient(black)")', '"none"');
+shouldBe('testGradient("background-image: linear-gradient(10deg, black 0%, 25%, 50%, white)")', '"none"');
+shouldBe('testGradient("background-image: linear-gradient(10deg, black 0%, 50%)")', '"none"');
+shouldBe('testGradient("background-image: linear-gradient(10deg, 50%, white)")', '"none"');
+shouldBe('testGradient("background-image: linear-gradient(10deg, 0%, black, white)")', '"none"');
+shouldBe('testGradient("background-image: linear-gradient(10deg, white, black, 80%)")', '"none"');
+shouldBe('testGradient("background-image: linear-gradient(10deg, black, , white)")', '"none"');
 
 shouldBe('testGradient("background-image: linear-gradient(black, white)")', '"linear-gradient(black, white)"');
 shouldBe('testGradient("background-image: linear-gradient(black 0, white)")', '"linear-gradient(black 0px, white)"');
@@ -42,14 +48,27 @@ shouldBe('testGradient("background-image: linear-gradient(to top left, black 0%,
 shouldBe('testGradient("background-image: linear-gradient(to top, black 0%, white)")', '"linear-gradient(to top, black 0%, white)"');
 shouldBe('testGradient("background-image: linear-gradient(10deg, black 0%, white)")', '"linear-gradient(10deg, black 0%, white)"');
 
+shouldBe('testGradient("background-image: linear-gradient(10deg, black 0%, 25%, white)")', '"linear-gradient(10deg, black 0%, 25%, white)"');
+shouldBe('testGradient("background-image: linear-gradient(10deg, black 0%, 0%, white)")', '"linear-gradient(10deg, black 0%, 0%, white)"');
+shouldBe('testGradient("background-image: linear-gradient(10deg, black 0%, 100%, white)")', '"linear-gradient(10deg, black 0%, 100%, white)"');
+shouldBe('testGradient("background-image: linear-gradient(10deg, black 0%, 50%, green 50%, 50%, white)")', '"linear-gradient(10deg, black 0%, 50%, green 50%, 50%, white)"');
+
+var s = "linear-gradient(";
+for(var x = 0; x < 500; x++)
+       s += "white " + (x/500) + "%, " + ((2 * x + 1) / 1000) + "%, ";
+s += "black)";
+shouldBe('testGradient("background-image: ' + s + '")', '"' + s + '"');
+
 debug('<p>repeating-linear-gradient</p>');
 shouldBe('testGradient("background-image: repeating-linear-gradient(black, white)")', '"repeating-linear-gradient(black, white)"');
+shouldBe('testGradient("background-image: repeating-linear-gradient(black, 35%, white)")', '"repeating-linear-gradient(black, 35%, white)"');
 
 debug('<p>radial-gradient</p>');
 
 shouldBe('testGradient("background-image: radial-gradient(white, black)")', '"radial-gradient(white, black)"');
 shouldBe('testGradient("background-image: radial-gradient(at bottom right, white, black)")', '"radial-gradient(at 100% 100%, white, black)"');
 shouldBe('testGradient("background-image: radial-gradient(farthest-corner, white, black)")', '"radial-gradient(white, black)"');
+shouldBe('testGradient("background-image: radial-gradient(farthest-corner, white, 35%, black)")', '"radial-gradient(white, 35%, black)"');
 shouldBe('testGradient("background-image: radial-gradient(closest-side, white, black)")', '"radial-gradient(closest-side, white, black)"');
 shouldBe('testGradient("background-image: radial-gradient(ellipse, white, black)")', '"radial-gradient(white, black)"');
 shouldBe('testGradient("background-image: radial-gradient(ellipse farthest-corner, white, black)")', '"radial-gradient(white, black)"');
@@ -67,13 +86,29 @@ shouldBe('testGradient("background-image: radial-gradient(circle 10%, white, bla
 shouldBe('testGradient("background-image: radial-gradient(circle 10px 10px, white, black)")', '"none"');
 shouldBe('testGradient("background-image: radial-gradient(ellipse 10%, white, black)")', '"none"');
 shouldBe('testGradient("background-image: radial-gradient(ellipse 10px, white, black)")', '"none"');
+shouldBe('testGradient("background-image: radial-gradient(25%, black)")', '"none"');
+shouldBe('testGradient("background-image: radial-gradient(white, 25%)")', '"none"');
+shouldBe('testGradient("background-image: radial-gradient(white, black, 25%)")', '"none"');
+shouldBe('testGradient("background-image: radial-gradient(25%, white, black)")', '"none"');
+shouldBe('testGradient("background-image: radial-gradient(white,, black)")', '"none"');
+shouldBe('testGradient("background-image: radial-gradient(ellipse 10px, white, 25%, 75%, black)")', '"none"');
 shouldBe('testGradient("background-image: radial-gradient(ellipse 10px 20px, white, black)")', '"radial-gradient(10px 20px, white, black)"');
 shouldBe('testGradient("background-image: radial-gradient(circle 10px, white, black)")', '"radial-gradient(10px, white, black)"');
 shouldBe('testGradient("background-image: radial-gradient(10px 10px at center, white, black)")', '"radial-gradient(10px 10px at 50% 50%, white, black)"');
+shouldBe('testGradient("background-image: radial-gradient(10px 10px at center, white, 50%, black)")', '"radial-gradient(10px 10px at 50% 50%, white, 50%, black)"');
+shouldBe('testGradient("background-image: radial-gradient(10px 10px at center, white, 0%, black)")', '"radial-gradient(10px 10px at 50% 50%, white, 0%, black)"');
+shouldBe('testGradient("background-image: radial-gradient(10px 10px at center, white, 100%, black)")', '"radial-gradient(10px 10px at 50% 50%, white, 100%, black)"');
+
+var s = "radial-gradient(10px 10px at 50% 50%, ";
+for(var x = 0; x < 500; x++)
+       s += "white " + (x/500) + "%, " + ((2 * x + 1) / 1000) + "%, ";
+s += "black)";
+shouldBe('testGradient("background-image: ' + s + '")', '"' + s + '"');
 
 debug('<p>repeating-radial-gradient</p>');
 shouldBe('testGradient("background-image: repeating-radial-gradient(white, black)")', '"repeating-radial-gradient(white, black)"');
-  
+shouldBe('testGradient("background-image: repeating-radial-gradient(white, 81%, black)")', '"repeating-radial-gradient(white, 81%, black)"');
+
 </script>
 
 <script src="../../resources/js-test-post.js"></script>
diff --git a/LayoutTests/fast/gradients/unprefixed-linear-angle-gradients2-expected.txt b/LayoutTests/fast/gradients/unprefixed-linear-angle-gradients2-expected.txt
new file mode 100644 (file)
index 0000000..25447f1
--- /dev/null
@@ -0,0 +1,2 @@
+   
+  
diff --git a/LayoutTests/fast/gradients/unprefixed-linear-angle-gradients2.html b/LayoutTests/fast/gradients/unprefixed-linear-angle-gradients2.html
new file mode 100644 (file)
index 0000000..49f53f7
--- /dev/null
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    .box {
+      display: inline-block;
+      height: 120px;
+      width: 200px;
+      margin: 10px;
+      border: 1px solid black;
+      background-repeat: no-repeat;
+    }
+
+    .linear1 {
+      background-image: linear-gradient(to top left, white -20px, 10px, black 120px);
+    }
+
+    .linear2 {
+      background-image: linear-gradient(to top left, white -20%, blue, 60%, black 120%);
+    }
+
+    .linear3 {
+      background-image: linear-gradient(0deg, white -20%, 30%, blue, black 120%);
+    }
+
+    .linear4 {
+      background-image: linear-gradient(to top left, white 20px, 20px, black 120px);
+    }
+
+    .linear5 {
+      background-image: linear-gradient(to top left, white 0%, 90%, black 90%);
+    }
+
+    .linear6 {
+      background-image: linear-gradient(0deg, white 50%, 50%, black 50%);
+    }
+  </style>
+  <script>
+    if (window.testRunner) {
+      var dumpPixels = true;
+      testRunner.dumpAsText(dumpPixels);
+    }
+  </script>
+</head>
+<body>
+
+  <div class="linear1 box"></div>
+  <div class="linear2 box"></div>
+  <div class="linear3 box"></div>
+  <br>
+  <div class="linear4 box"></div>
+  <div class="linear5 box"></div>
+  <div class="linear6 box"></div>
+
+</body>
+</html>
index 5214239..24fcf7a 100644 (file)
       background-image: radial-gradient(circle closest-corner at 20% 20%, red -50%, green, blue 150%);
     }
 
+    .gradient10 {
+      background-image: radial-gradient(ellipse farthest-corner, red, 10%, green 80px, 90%, blue);
+    }
+
+    .gradient11 {
+      background-image: radial-gradient(circle farthest-corner, red 20%, 25%, green 50%, 60%, blue 150%);
+    }
+
+    .gradient12 {
+      background-image: radial-gradient(circle closest-corner at 20% 20%, red -50%, 10%, green 50%, 60%, blue 150%);
+    }
+
+    .gradient13 {
+      background-image: radial-gradient(ellipse farthest-corner, red, 50%, green 80px, 50%, blue);
+    }
+
+    .gradient14 {
+      background-image: radial-gradient(circle farthest-corner, red 20%, 20%, green 50%, 150%, blue 150%);
+    }
+
+    .gradient15 {
+      background-image: radial-gradient(circle closest-corner at 20% 20%, red 50%, 10%, green 50%, 50%, blue 150%);
+    }
+
   </style>
   <script>
     if (window.testRunner) {
   <div class="gradient7 box"></div>
   <div class="gradient8 box"></div>
   <div class="gradient9 box"></div>
+  <br>
+  <div class="gradient10 box"></div>
+  <div class="gradient11 box"></div>
+  <div class="gradient12 box"></div>
+  <br>
+  <div class="gradient13 box"></div>
+  <div class="gradient14 box"></div>
+  <div class="gradient15 box"></div>
 
 </body>
 </html>
index 4485bcc..4dc81a6 100644 (file)
       background-image: radial-gradient(ellipse closest-side at 50% 20%, black, white);
     }
 
+    .gradient7 {
+      background-image: radial-gradient(ellipse closest-corner at -100px center, black, 15%, white);
+    }
+
+    .gradient8 {
+      background-image: radial-gradient(at bottom right, black, 30%, white);
+    }
+
+    .gradient9 {
+      background-image: radial-gradient(ellipse closest-side at 50% 20%, black, 90%, white);
+    }
+
   </style>
   <script>
     if (window.testRunner) {
   <div class="gradient4 box"></div>
   <div class="gradient5 box"></div>
   <div class="gradient6 box"></div>
+  <br>
+  <div class="gradient7 box"></div>
+  <div class="gradient8 box"></div>
+  <div class="gradient9 box"></div>
 
 </body>
 </html>
index 715d360..dca17bc 100644 (file)
       background-image: repeating-linear-gradient(to right, red, orange, yellow, green, blue, red 60px);
     }
 
+    .linear10 {
+      background-image: repeating-linear-gradient(to right, red 90%, 95%, blue 105%);
+    }
+
+    .linear11 {
+      background-image: repeating-linear-gradient(to right, red 2em, 2.1em, blue 3em);
+    }
+
+    .linear12 {
+      background-image: repeating-linear-gradient(to right, red, 55px, blue 60px);
+    }
+
   </style>
   <script type="text/javascript" charset="utf-8">
     if (window.testRunner) {
   <div class="linear7 box"></div>
   <div class="linear8 box"></div>
   <div class="linear9 box"></div>
+  <br>
+  <div class="linear10 box"></div>
+  <div class="linear11 box"></div>
+  <div class="linear12 box"></div>
 
 </body>
 </html>
index 94b202a..5b76167 100644 (file)
       background-image: repeating-radial-gradient(circle at left, red, orange, yellow, green, blue, red 60px);
     }
 
+    .radial10 {
+      background-image: repeating-radial-gradient(at left, red 10%, 25%, blue 50%);
+    }
+
+    .radial11 {
+      background-image: repeating-radial-gradient(at top, red 2em, 2.4em, blue 6em);
+    }
+
+    .radial12 {
+      background-image: repeating-radial-gradient(circle at left, red, 10px, blue 60px);
+    }
+
   </style>
   <script>
     if (window.testRunner) {
@@ -69,6 +81,9 @@
   <div class="radial7 box"></div>
   <div class="radial8 box"></div>
   <div class="radial9 box"></div>
-
+  <br>
+  <div class="radial10 box"></div>
+  <div class="radial11 box"></div>
+  <div class="radial12 box"></div>
 </body>
 </html>
diff --git a/LayoutTests/platform/mac/fast/gradients/unprefixed-color-stops2-expected.png b/LayoutTests/platform/mac/fast/gradients/unprefixed-color-stops2-expected.png
new file mode 100644 (file)
index 0000000..6f0c3c0
Binary files /dev/null and b/LayoutTests/platform/mac/fast/gradients/unprefixed-color-stops2-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/gradients/unprefixed-linear-angle-gradients2-expected.png b/LayoutTests/platform/mac/fast/gradients/unprefixed-linear-angle-gradients2-expected.png
new file mode 100644 (file)
index 0000000..1036be7
Binary files /dev/null and b/LayoutTests/platform/mac/fast/gradients/unprefixed-linear-angle-gradients2-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-expected.png b/LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-expected.png
new file mode 100644 (file)
index 0000000..014845c
Binary files /dev/null and b/LayoutTests/platform/mac/fast/gradients/unprefixed-radial-gradients-expected.png differ
index 58356ea..4677a41 100644 (file)
@@ -1,3 +1,33 @@
+2014-10-01  Rik Cabanier  <cabanier@adobe.com>
+
+        Add support for midpoint to CSS gradients
+        https://bugs.webkit.org/show_bug.cgi?id=137171
+
+        Reviewed by Darin Adler.
+
+        This patch adds support for gradient midpoints. It also updates the 
+        gradient tests so they use the feature.
+        Spec: http://dev.w3.org/csswg/css-images-4/#color-interpolation-hint
+
+        Tests: fast/gradients/unprefixed-color-stops2.html
+               fast/gradients/unprefixed-gradient-parsing.html
+               fast/gradients/unprefixed-linear-angle-gradients2.html
+               fast/gradients/unprefixed-radial-gradients.html
+               fast/gradients/unprefixed-radial-gradients2.html
+               fast/gradients/unprefixed-repeating-linear-gradient.html
+               fast/gradients/unprefixed-repeating-radial-gradients.html
+
+        * css/CSSGradientValue.cpp:
+        (WebCore::GradientStop::GradientStop): constructor initializes the midpoint variable
+        (WebCore::CSSGradientValue::gradientWithStylesResolved): this function checks for midpoint color stops
+        (WebCore::CSSGradientValue::addStops): this function processes midpoints and converts them to regular color stops
+        (WebCore::CSSLinearGradientValue::customCSSText): this routine was updated to do correct parsing for midpoints
+        (WebCore::CSSRadialGradientValue::customCSSText):
+        * css/CSSGradientValue.h:
+        (WebCore::CSSGradientColorStop::CSSGradientColorStop): this function stores if a stop is a midpoint
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseGradientColorStops): this function now allows color stops with no color
+
 2014-10-01  Chris Dumez  <cdumez@apple.com>
 
         Add basic caching for Document.cookie API
index 5bf133a..ea3afd7 100644 (file)
@@ -95,22 +95,25 @@ struct GradientStop {
     Color color;
     float offset;
     bool specified;
+    bool isMidpoint;
 
     GradientStop()
         : offset(0)
         , specified(false)
+        , isMidpoint(false)
     { }
 };
 
 PassRefPtr<CSSGradientValue> CSSGradientValue::gradientWithStylesResolved(StyleResolver* styleResolver)
 {
     bool derived = false;
-    for (unsigned i = 0; i < m_stops.size(); i++)
-        if (styleResolver->colorFromPrimitiveValueIsDerivedFromElement(m_stops[i].m_color.get())) {
+    for (unsigned i = 0; i < m_stops.size(); i++) {
+        if (!m_stops[i].isMidpoint && styleResolver->colorFromPrimitiveValueIsDerivedFromElement(m_stops[i].m_color.get())) {
             m_stops[i].m_colorIsDerivedFromElement = true;
             derived = true;
             break;
         }
+    }
 
     RefPtr<CSSGradientValue> result;
     if (!derived)
@@ -124,12 +127,29 @@ PassRefPtr<CSSGradientValue> CSSGradientValue::gradientWithStylesResolved(StyleR
         return 0;
     }
 
-    for (unsigned i = 0; i < result->m_stops.size(); i++)
-        result->m_stops[i].m_resolvedColor = styleResolver->colorFromPrimitiveValue(result->m_stops[i].m_color.get());
+    for (unsigned i = 0; i < result->m_stops.size(); i++) {
+        if (!result->m_stops[i].isMidpoint)
+            result->m_stops[i].m_resolvedColor = styleResolver->colorFromPrimitiveValue(result->m_stops[i].m_color.get());
+    }
 
     return result.release();
 }
 
+static inline int interpolate(int min, int max, float position)
+{
+    return min + static_cast<int>(position * (max - min));
+}
+
+static inline Color interpolate(Color color1, Color color2, float position)
+{
+    int red = interpolate(color1.red(), color2.red(), position);
+    int green = interpolate(color1.green(), color2.green(), position);
+    int blue = interpolate(color1.blue(), color2.blue(), position);
+    int alpha = interpolate(color1.alpha(), color2.alpha(), position);
+
+    return Color(red, green, blue, alpha);
+}
+
 void CSSGradientValue::addStops(Gradient& gradient, const CSSToLengthConversionData& conversionData, float maxLengthForRepeat)
 {
     if (m_gradientType == CSSDeprecatedLinearGradient || m_gradientType == CSSDeprecatedRadialGradient) {
@@ -169,6 +189,7 @@ void CSSGradientValue::addStops(Gradient& gradient, const CSSToLengthConversionD
     for (size_t i = 0; i < numStops; ++i) {
         const CSSGradientColorStop& stop = m_stops[i];
 
+        stops[i].isMidpoint = stop.isMidpoint;
         stops[i].color = stop.m_resolvedColor;
 
         if (stop.m_position) {
@@ -250,6 +271,86 @@ void CSSGradientValue::addStops(Gradient& gradient, const CSSToLengthConversionD
         }
     }
 
+    // Walk over the color stops, look for midpoints and add stops as needed.
+    // If mid < 50%, add 2 stops to the left and 6 to the right
+    // else add 6 stops to the left and 2 to the right.
+    // Stops on the side with the most stops start midway because the curve approximates
+    // a line in that region. We then add 5 more color stops on that side to minimize the change
+    // how the luminance changes at each of the colorstops. We don't have to add as many on the other side
+    // since it becomes small which increases the differentation of luminance which hides the colorstops.
+    // Even with 4 extra colorstops, it *is* possible to discern the steps when the gradient is large and has
+    // large luminance differences between midpoint and color stop. If this becomes an issue, we can consider
+    // making this algorithm a bit smarter.
+
+    // Midpoints that coincide with color stops are treated specially since they don't require
+    // extra stops and generate hard lines.
+    for (size_t x = 1; x < stops.size() - 1;) {
+        if (!stops[x].isMidpoint) {
+            ++x;
+            continue;
+        }
+
+        // Find previous and next color so we know what to interpolate between.
+        // We already know they have a color since we checked for that earlier.
+        Color color1 = stops[x - 1].color;
+        Color color2 = stops[x + 1].color;
+        // Likewise find the position of previous and next color stop.
+        float offset1 = stops[x - 1].offset;
+        float offset2 = stops[x + 1].offset;
+        float offset = stops[x].offset;
+
+        // Check if everything coincides or the midpoint is exactly in the middle.
+        // If so, ignore the midpoint.
+        if (offset - offset1 == offset2 - offset) {
+            stops.remove(x);
+            continue;
+        }
+
+        // Check if we coincide with the left color stop.
+        if (offset1 == offset) {
+            // Morph the midpoint to a regular stop with the color of the next color stop.
+            stops[x].color = color2;
+            stops[x].isMidpoint = false;
+            continue;
+        }
+
+        // Check if we coincide with the right color stop.
+        if (offset2 == offset) {
+            // Morph the midpoint to a regular stop with the color of the previous color stop.
+            stops[x].color = color1;
+            stops[x].isMidpoint = false;
+            continue;
+        }
+
+        float midpoint = (offset - offset1) / (offset2 - offset1);
+        GradientStop newStops[9];
+        if (midpoint > .5f) {
+            for (size_t y = 0; y < 7; ++y)
+                newStops[y].offset = offset1 + (offset - offset1) * (7 + y) / 13;
+
+            newStops[7].offset = offset + (offset2 - offset) / 3;
+            newStops[8].offset = offset + (offset2 - offset) * 2 / 3;
+        } else {
+            newStops[0].offset = offset1 + (offset - offset1) / 3;
+            newStops[1].offset = offset1 + (offset - offset1) * 2 / 3;
+
+            for (size_t y = 0; y < 7; ++y)
+                newStops[y + 2].offset = offset + (offset2 - offset) * y / 13;
+        }
+        // calculate colors
+        for (size_t y = 0; y < 9; ++y) {
+            float relativeOffset = (newStops[y].offset - offset1) / (offset2 - offset1);
+            float multiplier = powf(relativeOffset, logf(.5f) / logf(midpoint));
+            newStops[y].color = interpolate(color1, color2, multiplier);
+        }
+
+        stops.remove(x);
+        stops.insert(x, newStops, 9);
+        x += 9;
+    }
+
+    numStops = stops.size();
+
     // If the gradient is repeating, repeat the color stops.
     // We can't just push this logic down into the platform-specific Gradient code,
     // because we have to know the extent of the gradient, and possible move the end points.
@@ -561,9 +662,11 @@ String CSSLinearGradientValue::customCSSText() const
             const CSSGradientColorStop& stop = m_stops[i];
             if (i)
                 result.appendLiteral(", ");
-            result.append(stop.m_color->cssText());
+            if (!stop.isMidpoint)
+                result.append(stop.m_color->cssText());
             if (stop.m_position) {
-                result.append(' ');
+                if (!stop.isMidpoint)
+                    result.append(' ');
                 result.append(stop.m_position->cssText());
             }
         }
@@ -877,9 +980,11 @@ String CSSRadialGradientValue::customCSSText() const
             const CSSGradientColorStop& stop = m_stops[i];
             if (i)
                 result.appendLiteral(", ");
-            result.append(stop.m_color->cssText());
+            if (!stop.isMidpoint)
+                result.append(stop.m_color->cssText());
             if (stop.m_position) {
-                result.append(' ');
+                if (!stop.isMidpoint)
+                    result.append(' ');
                 result.append(stop.m_position->cssText());
             }
         }
index 61dbb5a..e45212f 100644 (file)
@@ -48,11 +48,11 @@ enum CSSGradientType {
 enum CSSGradientRepeat { NonRepeating, Repeating };
 
 struct CSSGradientColorStop {
-    CSSGradientColorStop() : m_colorIsDerivedFromElement(false) { };
     RefPtr<CSSPrimitiveValue> m_position; // percentage or length
     RefPtr<CSSPrimitiveValue> m_color;
     Color m_resolvedColor;
-    bool m_colorIsDerivedFromElement;
+    bool m_colorIsDerivedFromElement = false;
+    bool isMidpoint = false;
     bool operator==(const CSSGradientColorStop& other) const
     {
         return compareCSSValuePtr(m_color, other.m_color)
index 3d92213..bf95fb6 100644 (file)
@@ -8597,6 +8597,7 @@ bool CSSParser::parseRadialGradient(CSSParserValueList* valueList, RefPtr<CSSVal
 bool CSSParser::parseGradientColorStops(CSSParserValueList* valueList, CSSGradientValue* gradient, bool expectComma)
 {
     CSSParserValue* a = valueList->current();
+    bool previousStopWasMidpoint = true;
 
     // Now look for color stops.
     while (a) {
@@ -8613,21 +8614,32 @@ bool CSSParser::parseGradientColorStops(CSSParserValueList* valueList, CSSGradie
         // <color-stop> = <color> [ <percentage> | <length> ]?
         CSSGradientColorStop stop;
         stop.m_color = parseGradientColorOrKeyword(this, a);
-        if (!stop.m_color)
-            return false;
+        if (!stop.m_color) {
+            if (previousStopWasMidpoint) // 2 midpoints in a row is not allowed. This also catches starting with a midpoint.
+                return false;
+
+            stop.isMidpoint = true;
+        } else
+            a = valueList->next();
+
+        previousStopWasMidpoint = stop.isMidpoint;
 
-        a = valueList->next();
         if (a) {
             if (validUnit(a, FLength | FPercent)) {
                 stop.m_position = createPrimitiveNumericValue(a);
                 a = valueList->next();
-            }
+            } else if (stop.isMidpoint)
+                return false;
         }
 
         gradient->addStop(stop);
         expectComma = true;
     }
 
+    // We can't end on a midpoint.
+    if (previousStopWasMidpoint)
+        return false;
+
     // Must have 2 or more stops to be valid.
     return gradient->stopCount() >= 2;
 }