Web Inspector: highlight diff in the gutter, not in the line content.
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Apr 2012 15:17:50 +0000 (15:17 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Apr 2012 15:17:50 +0000 (15:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83371

Reviewed by Yury Semikhatsky.

Now that the editing mode is enabled by default, diff highlighting gets annoying.
I am moving it to the gutter (same decoration as before, but now coloring gutter only).

* inspector/front-end/TextViewer.js:
(WebInspector.TextEditorGutterPanel.prototype.textChanged):
* inspector/front-end/textViewer.css:
(.diff-container .webkit-added-line.webkit-line-number):
(.diff-container .webkit-removed-line.webkit-line-number):
(.diff-container .webkit-changed-line.webkit-line-number):

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/TextViewer.js
Source/WebCore/inspector/front-end/textViewer.css

index 8733e8b..6d0a83b 100644 (file)
@@ -1,5 +1,22 @@
 2012-04-06  Pavel Feldman  <pfeldman@chromium.org>
 
+        Web Inspector: highlight diff in the gutter, not in the line content.
+        https://bugs.webkit.org/show_bug.cgi?id=83371
+
+        Reviewed by Yury Semikhatsky.
+
+        Now that the editing mode is enabled by default, diff highlighting gets annoying.
+        I am moving it to the gutter (same decoration as before, but now coloring gutter only).
+
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextEditorGutterPanel.prototype.textChanged):
+        * inspector/front-end/textViewer.css:
+        (.diff-container .webkit-added-line.webkit-line-number):
+        (.diff-container .webkit-removed-line.webkit-line-number):
+        (.diff-container .webkit-changed-line.webkit-line-number):
+
+2012-04-06  Pavel Feldman  <pfeldman@chromium.org>
+
         Web Inspector: remove url from the saved urls map before the save action.
         https://bugs.webkit.org/show_bug.cgi?id=83364
 
index c566cc3..0f404e1 100644 (file)
@@ -690,6 +690,9 @@ WebInspector.TextEditorGutterPanel.prototype = {
                 // Do not move decorations before the start position.
                 if (lineNumber < oldRange.startLine)
                     continue;
+                // Decorations follow the first character of line.
+                if (lineNumber === oldRange.startLine && oldRange.startColumn)
+                    continue;
 
                 var lineDecorationsCopy = this._decorations[lineNumber].slice();
                 for (var i = 0; i < lineDecorationsCopy.length; ++i) {
index 9fcc4df..95066a7 100644 (file)
     outline: 1px solid rgb(64, 115, 244);
 }
 
-.diff-container .webkit-added-line.webkit-line-content {
-    background-color: rgb(220, 255, 220);
+.diff-container .webkit-added-line.webkit-line-number {
+    background-color: rgb(170, 255, 170);
+    color: #333;
 }
 
-.diff-container .webkit-removed-line.webkit-line-content {
+.diff-container .webkit-removed-line.webkit-line-number {
     background-color: rgb(255, 220, 220);
     text-decoration: line-through;
 }
 
-.diff-container .webkit-changed-line.webkit-line-content {
-    background-color: rgb(220, 220, 255);
+.diff-container .webkit-changed-line.webkit-line-number {
+    background-color: rgb(170, 170, 255);
+    color: #333;
 }
 
 .webkit-highlighted-line.webkit-line-content {