Web Inspector: gradient editor does not appear for linear-gradient with no specified...
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 14:37:15 +0000 (14:37 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 14:37:15 +0000 (14:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132083

Reviewed by Timothy Hatcher.

Only assume we're parsing a legacy-formatted gradient if the first parameter is not a color.

* UserInterface/Models/Gradient.js:
(WebInspector.LinearGradient.linearGradientWithComponents):

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Models/Gradient.js

index cbe0637..17c1fed 100644 (file)
@@ -1,3 +1,15 @@
+2014-04-24  Antoine Quint  <graouts@webkit.org>
+
+        Web Inspector: gradient editor does not appear for linear-gradient with no specified angle
+        https://bugs.webkit.org/show_bug.cgi?id=132083
+
+        Reviewed by Timothy Hatcher.
+
+        Only assume we're parsing a legacy-formatted gradient if the first parameter is not a color.
+
+        * UserInterface/Models/Gradient.js:
+        (WebInspector.LinearGradient.linearGradientWithComponents):
+
 2014-04-22  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Support Python 2.7 in Cygwin
index beaacbb..10aa3f6 100644 (file)
@@ -188,8 +188,9 @@ WebInspector.LinearGradient.linearGradientWithComponents = function(components)
             return null;
         }
         components.shift();
-    } else {
-        // We don't support any of the legacy linear gradient formats.
+    } else if (components[0].length !== 1 && !WebInspector.Color.fromString(components[0][0])) {
+        // If the first component is not a color, then we're dealing with a
+        // legacy linear gradient format that we don't support.
         return null;
     }