Title: [174484] trunk/Source/WebInspectorUI
- Revision
- 174484
- Author
- [email protected]
- Date
- 2014-10-08 17:08:47 -0700 (Wed, 08 Oct 2014)
Log Message
Web Inspector: CSS Pretty Printing fails to put space between value functions around ending parenthesis
https://bugs.webkit.org/show_bug.cgi?id=137415
Reviewed by Timothy Hatcher.
Add a space after a closing parenthesis if we are still inside a property.
This adds space between space separated function lists such as
-webkit-transform:foo(...)bar(...). Also add a test for keyframe syntax.
* Tools/PrettyPrinting/CodeMirrorFormatters.js:
* Tools/PrettyPrinting/css-tests/keyframes-expected.css: Added.
* Tools/PrettyPrinting/css-tests/keyframes.css: Added.
* Tools/PrettyPrinting/index.html:
* UserInterface/Views/CodeMirrorFormatters.js:
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (174483 => 174484)
--- trunk/Source/WebInspectorUI/ChangeLog 2014-10-09 00:08:45 UTC (rev 174483)
+++ trunk/Source/WebInspectorUI/ChangeLog 2014-10-09 00:08:47 UTC (rev 174484)
@@ -1,5 +1,22 @@
2014-10-08 Joseph Pecoraro <[email protected]>
+ Web Inspector: CSS Pretty Printing fails to put space between value functions around ending parenthesis
+ https://bugs.webkit.org/show_bug.cgi?id=137415
+
+ Reviewed by Timothy Hatcher.
+
+ Add a space after a closing parenthesis if we are still inside a property.
+ This adds space between space separated function lists such as
+ -webkit-transform:foo(...)bar(...). Also add a test for keyframe syntax.
+
+ * Tools/PrettyPrinting/CodeMirrorFormatters.js:
+ * Tools/PrettyPrinting/css-tests/keyframes-expected.css: Added.
+ * Tools/PrettyPrinting/css-tests/keyframes.css: Added.
+ * Tools/PrettyPrinting/index.html:
+ * UserInterface/Views/CodeMirrorFormatters.js:
+
+2014-10-08 Joseph Pecoraro <[email protected]>
+
Web Inspector: CSS Pretty Printing fails to put space between rgb(...) and numbers in minified gradients
https://bugs.webkit.org/show_bug.cgi?id=137414
Modified: trunk/Source/WebInspectorUI/Tools/PrettyPrinting/CodeMirrorFormatters.js (174483 => 174484)
--- trunk/Source/WebInspectorUI/Tools/PrettyPrinting/CodeMirrorFormatters.js 2014-10-09 00:08:45 UTC (rev 174483)
+++ trunk/Source/WebInspectorUI/Tools/PrettyPrinting/CodeMirrorFormatters.js 2014-10-09 00:08:47 UTC (rev 174484)
@@ -325,7 +325,11 @@
if (lastContent === ")" && (content !== ")" && content !== ",")) {
if (token === "number") // linear-gradient(rgb(...)0%,rgb(...)100%)
return true;
- return state.state === "media" || state.state === "media_parens"; // Space in "not(foo)and" but not at the end of "not(not(foo))"
+ if (state.state === "prop") // -webkit-transform:rotate(...)translate(...);
+ return true;
+ if (state.state === "media" || state.state === "media_parens") // Space in "not(foo)and" but not at the end of "not(not(foo))"
+ return true;
+ return false; // color: rgb(...);
}
return ">+~-*/".indexOf(lastContent) >= 0; // calc() _expression_ or child/sibling selectors
}
Added: trunk/Source/WebInspectorUI/Tools/PrettyPrinting/css-tests/keyframes-expected.css (0 => 174484)
--- trunk/Source/WebInspectorUI/Tools/PrettyPrinting/css-tests/keyframes-expected.css (rev 0)
+++ trunk/Source/WebInspectorUI/Tools/PrettyPrinting/css-tests/keyframes-expected.css 2014-10-09 00:08:47 UTC (rev 174484)
@@ -0,0 +1,10 @@
+@-webkit-keyframes spin {
+ 0% {
+ -webkit-transform: rotate(-180deg) translate(0px, 0px);
+ }
+
+ 100% {
+ -webkit-transform: rotate(180deg) translate(10px, 75px);
+ }
+}
+
Added: trunk/Source/WebInspectorUI/Tools/PrettyPrinting/css-tests/keyframes.css (0 => 174484)
--- trunk/Source/WebInspectorUI/Tools/PrettyPrinting/css-tests/keyframes.css (rev 0)
+++ trunk/Source/WebInspectorUI/Tools/PrettyPrinting/css-tests/keyframes.css 2014-10-09 00:08:47 UTC (rev 174484)
@@ -0,0 +1 @@
+@-webkit-keyframes spin{0%{-webkit-transform:rotate(-180deg)translate(0px,0px);}100%{-webkit-transform:rotate(180deg)translate(10px,75px);}}
Modified: trunk/Source/WebInspectorUI/Tools/PrettyPrinting/index.html (174483 => 174484)
--- trunk/Source/WebInspectorUI/Tools/PrettyPrinting/index.html 2014-10-09 00:08:45 UTC (rev 174483)
+++ trunk/Source/WebInspectorUI/Tools/PrettyPrinting/index.html 2014-10-09 00:08:47 UTC (rev 174484)
@@ -245,6 +245,7 @@
"css-tests/basic.css",
"css-tests/calc.css",
"css-tests/gradient.css",
+ "css-tests/keyframes.css",
"css-tests/media-query.css",
"css-tests/selectors.css",
"css-tests/wrapping.css",
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js (174483 => 174484)
--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js 2014-10-09 00:08:45 UTC (rev 174483)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorFormatters.js 2014-10-09 00:08:47 UTC (rev 174484)
@@ -325,7 +325,11 @@
if (lastContent === ")" && (content !== ")" && content !== ",")) {
if (token === "number") // linear-gradient(rgb(...)0%,rgb(...)100%)
return true;
- return state.state === "media" || state.state === "media_parens"; // Space in "not(foo)and" but not at the end of "not(not(foo))"
+ if (state.state === "prop") // -webkit-transform:rotate(...)translate(...);
+ return true;
+ if (state.state === "media" || state.state === "media_parens") // Space in "not(foo)and" but not at the end of "not(not(foo))"
+ return true;
+ return false; // color: rgb(...);
}
return ">+~-*/".indexOf(lastContent) >= 0; // calc() _expression_ or child/sibling selectors
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes