Changeset 225568 in webkit


Ignore:
Timestamp:
Dec 5, 2017 11:01:29 PM (6 years ago)
Author:
Nikita Vasilyev
Message:

Web Inspector: Styles Redesign: adding a property before or after the first one appends it to the end
https://bugs.webkit.org/show_bug.cgi?id=180321
<rdar://problem/35816402>

Reviewed by Timothy Hatcher.

  • UserInterface/Models/CSSStyleDeclaration.js:

(WI.CSSStyleDeclaration.prototype._rangeAfterPropertyAtIndex):

  • UserInterface/Models/TextRange.js:

(WI.TextRange.prototype.collapseToStart):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r225560 r225568  
     12017-12-05  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Web Inspector: Styles Redesign: adding a property before or after the first one appends it to the end
     4        https://bugs.webkit.org/show_bug.cgi?id=180321
     5        <rdar://problem/35816402>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * UserInterface/Models/CSSStyleDeclaration.js:
     10        (WI.CSSStyleDeclaration.prototype._rangeAfterPropertyAtIndex):
     11        * UserInterface/Models/TextRange.js:
     12        (WI.TextRange.prototype.collapseToStart):
     13
    1142017-12-05  Joseph Pecoraro  <pecoraro@apple.com>
    215
  • trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js

    r224174 r225568  
    419419    _rangeAfterPropertyAtIndex(index)
    420420    {
    421         if (index > 0) {
    422             let property = this.allVisibleProperties[index];
    423             if (property && property.styleSheetTextRange)
    424                 return property.styleSheetTextRange.collapseToEnd();
    425         }
    426 
    427         return this._styleSheetTextRange.collapseToEnd();
     421        if (index < 0)
     422            return this._styleSheetTextRange.collapseToStart();
     423
     424        if (index >= this.allVisibleProperties.length)
     425            return this._styleSheetTextRange.collapseToEnd();
     426
     427        let property = this.allVisibleProperties[index];
     428        return property.styleSheetTextRange.collapseToEnd();
    428429    }
    429430};
  • trunk/Source/WebInspectorUI/UserInterface/Models/TextRange.js

    r222959 r225568  
    129129    }
    130130
     131    collapseToStart()
     132    {
     133        console.assert(!isNaN(this._startLine), "TextRange needs line/column data.");
     134        return new WI.TextRange(this._startLine, this._startColumn, this._startLine, this._startColumn);
     135    }
     136
    131137    collapseToEnd()
    132138    {
Note: See TracChangeset for help on using the changeset viewer.