Changeset 186289 in webkit


Ignore:
Timestamp:
Jul 5, 2015 11:46:54 AM (9 years ago)
Author:
Devin Rousso
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.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r186288 r186289  
     12015-07-05  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Deleting in the CSS sidebar causes the warning icon to appear mid-word
     4        https://bugs.webkit.org/show_bug.cgi?id=146617
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Views/CSSStyleDeclarationTextEditor.js:
     9        (WebInspector.CSSStyleDeclarationTextEditor.prototype._handleBeforeChange): Now removes all marks whenever the user deletes.
     10        (WebInspector.CSSStyleDeclarationTextEditor.prototype._createTextMarkerForPropertyIfNeeded): The invalid marker now calculates
     11        it's position based off of where the semicolon is in the property text.
     12
    1132015-07-05  Devin Rousso  <drousso@apple.com>
    214
  • trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js

    r186286 r186289  
    442442    _handleBeforeChange(codeMirror, change)
    443443    {
    444         if (change.origin !== "+delete" || change.to.ch)
     444        if (change.origin !== "+delete")
    445445            return CodeMirror.Pass;
    446446
     
    997997        if (propertyNameIsValid) {
    998998            // The property's name is valid but its value is not (either it is not supported for this property or there is no value).
    999             var start = {line: from.line, ch: from.ch + property.name.length + 2};
     999            var semicolon = /:\s*/.exec(property.text);
     1000            var start = {line: from.line, ch: semicolon.index + semicolon[0].length};
    10001001            var end = {line: to.line, ch: start.ch + property.value.length};
    10011002
Note: See TracChangeset for help on using the changeset viewer.