Title: [170868] trunk/Source/WebInspectorUI
Revision
170868
Author
jonowe...@apple.com
Date
2014-07-07 18:38:35 -0700 (Mon, 07 Jul 2014)

Log Message

Web Inspector: CSS style declaration editor should ignore empty lines when determining prefix whitespace
https://bugs.webkit.org/show_bug.cgi?id=134704

Reviewed by Joseph Pecoraro.

When checking for zero-length prefix whitespace, completely empty lines are now ignored
as these lines are most often used for organizing rules into groups and often have their
whitespace removed due to trailing whitespace removal conventions.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (170867 => 170868)


--- trunk/Source/WebInspectorUI/ChangeLog	2014-07-08 00:14:18 UTC (rev 170867)
+++ trunk/Source/WebInspectorUI/ChangeLog	2014-07-08 01:38:35 UTC (rev 170868)
@@ -1,3 +1,16 @@
+2014-07-07  Jonathan Wells  <jonowe...@apple.com>
+
+        Web Inspector: CSS style declaration editor should ignore empty lines when determining prefix whitespace
+        https://bugs.webkit.org/show_bug.cgi?id=134704
+
+        Reviewed by Joseph Pecoraro.
+
+        When checking for zero-length prefix whitespace, completely empty lines are now ignored
+        as these lines are most often used for organizing rules into groups and often have their
+        whitespace removed due to trailing whitespace removal conventions.
+
+        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
+
 2014-07-07  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Uncaught Exception debugging iOS 7 NetworkAgent.loadResource is unavailable

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js (170867 => 170868)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js	2014-07-08 00:14:18 UTC (rev 170867)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js	2014-07-08 01:38:35 UTC (rev 170868)
@@ -869,9 +869,11 @@
                     var lineContent = this._codeMirror.getLine(i);
                     var prefixWhitespaceMatch = lineContent.match(/^\s+/);
 
-                    // If there is no prefix whitespace, then the prefix whitespace of all
-                    // other lines will be retained as is. Update markers and return.
+                    // If there is no prefix whitespace (except for empty lines) then the prefix
+                    // whitespace of all other lines will be retained as is. Update markers and return.
                     if (!prefixWhitespaceMatch) {
+                        if (!lineContent)
+                            continue;
                         this._linePrefixWhitespace = "";
                         this._updateTextMarkers(true);
                         return;
@@ -912,7 +914,7 @@
 
                 var lineNumber = 0;
 
-                // Iterate only visible properties if we have original style text. That way we known we only syntesize
+                // Iterate only visible properties if we have original style text. That way we known we only synthesize
                 // what was originaly in the style text.
                 this._iterateOverProperties(styleText ? true : false, function(property) {
                     // Some property text can have line breaks, so consider that in the ranges below.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to