Title: [186289] trunk/Source/WebInspectorUI
Revision
186289
Author
drou...@apple.com
Date
2015-07-05 11:46:54 -0700 (Sun, 05 Jul 2015)

Log Message

Web Inspector: Deleting in the CSS sidebar causes the warning icon to appear mid-word
https://bugs.webkit.org/show_bug.cgi?id=146617

Reviewed by Timothy Hatcher.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._handleBeforeChange): Now removes all marks whenever the user deletes.
(WebInspector.CSSStyleDeclarationTextEditor.prototype._createTextMarkerForPropertyIfNeeded): The invalid marker now calculates
it's position based off of where the semicolon is in the property text.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (186288 => 186289)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-07-05 18:23:44 UTC (rev 186288)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-07-05 18:46:54 UTC (rev 186289)
@@ -1,5 +1,17 @@
 2015-07-05  Devin Rousso  <drou...@apple.com>
 
+        Web Inspector: Deleting in the CSS sidebar causes the warning icon to appear mid-word
+        https://bugs.webkit.org/show_bug.cgi?id=146617
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
+        (WebInspector.CSSStyleDeclarationTextEditor.prototype._handleBeforeChange): Now removes all marks whenever the user deletes.
+        (WebInspector.CSSStyleDeclarationTextEditor.prototype._createTextMarkerForPropertyIfNeeded): The invalid marker now calculates
+        it's position based off of where the semicolon is in the property text.
+
+2015-07-05  Devin Rousso  <drou...@apple.com>
+
         Web Inspector: CSS rule with 2 pseudo-selectors appears twice
         https://bugs.webkit.org/show_bug.cgi?id=146576
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js (186288 => 186289)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js	2015-07-05 18:23:44 UTC (rev 186288)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js	2015-07-05 18:46:54 UTC (rev 186289)
@@ -441,7 +441,7 @@
 
     _handleBeforeChange(codeMirror, change)
     {
-        if (change.origin !== "+delete" || change.to.ch)
+        if (change.origin !== "+delete")
             return CodeMirror.Pass;
 
         var marks = codeMirror.findMarksAt(change.to);
@@ -996,7 +996,8 @@
 
         if (propertyNameIsValid) {
             // The property's name is valid but its value is not (either it is not supported for this property or there is no value).
-            var start = {line: from.line, ch: from.ch + property.name.length + 2};
+            var semicolon = /:\s*/.exec(property.text);
+            var start = {line: from.line, ch: semicolon.index + semicolon[0].length};
             var end = {line: to.line, ch: start.ch + property.value.length};
 
             this._codeMirror.markText(start, end, {className: "invalid"});
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to