Web Inspector: CSS Pretty Printing: still fails fails to put space between rgb(....
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Feb 2015 21:41:53 +0000 (21:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Feb 2015 21:41:53 +0000 (21:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141411

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-02-10
Reviewed by Timothy Hatcher.

* Tools/PrettyPrinting/CodeMirrorFormatters.js:
* UserInterface/Views/CodeMirrorFormatters.js:
Token actually was "number m-css" so we should check token strings
more robustly, like elsewhere in the formatters.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Tools/PrettyPrinting/CodeMirrorFormatters.js
Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js

index ba88a47..321d960 100644 (file)
@@ -1,3 +1,15 @@
+2015-02-10  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: CSS Pretty Printing: still fails fails to put space between rgb(...) and numbers in minified gradients
+        https://bugs.webkit.org/show_bug.cgi?id=141411
+
+        Reviewed by Timothy Hatcher.
+
+        * Tools/PrettyPrinting/CodeMirrorFormatters.js:
+        * UserInterface/Views/CodeMirrorFormatters.js:
+        Token actually was "number m-css" so we should check token strings
+        more robustly, like elsewhere in the formatters.
+
 2015-02-09  Brian J. Burg  <burg@cs.washington.edu>
 
         Web Inspector: Uncaught exception when reporting wrong backend command call signature
index 81d74cb..fec8392 100644 (file)
@@ -323,7 +323,7 @@ CodeMirror.extendMode("css", {
             if (lastContent === ":") // Space in "prop: value" but not in a selectors "a:link" or "div::after" or media queries "(max-device-width:480px)".
                 return state.state === "prop";
             if (lastContent === ")" && (content !== ")" && content !== ",")) {
-                if (token === "number") // linear-gradient(rgb(...)0%,rgb(...)100%)
+                if (/\bnumber\b/.test(token)) // linear-gradient(rgb(...)0%,rgb(...)100%)
                     return true;
                 if (state.state === "prop") // -webkit-transform:rotate(...)translate(...);
                     return true;
index 81d74cb..fec8392 100644 (file)
@@ -323,7 +323,7 @@ CodeMirror.extendMode("css", {
             if (lastContent === ":") // Space in "prop: value" but not in a selectors "a:link" or "div::after" or media queries "(max-device-width:480px)".
                 return state.state === "prop";
             if (lastContent === ")" && (content !== ")" && content !== ",")) {
-                if (token === "number") // linear-gradient(rgb(...)0%,rgb(...)100%)
+                if (/\bnumber\b/.test(token)) // linear-gradient(rgb(...)0%,rgb(...)100%)
                     return true;
                 if (state.state === "prop") // -webkit-transform:rotate(...)translate(...);
                     return true;