Changeset 224210 in webkit


Ignore:
Timestamp:
Oct 30, 2017 4:11:06 PM (6 years ago)
Author:
Nikita Vasilyev
Message:

Web Inspector: [PARITY] Styles Redesign: Ability to modify style attributes
https://bugs.webkit.org/show_bug.cgi?id=178328
<rdar://problem/35000990>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Before this patch, modifying a property of a style attribute duplicated the old property
and appended the new one. This happened because WI.TextRange.prototype.resolveOffsets
didn't resolve offsets correctly when text didn't end with a trailing new line.

Since WI.TextRange.prototype.resolveOffsets is used elsewhere and this could be expected
behavior, append a line break before resolving a range.

  • UserInterface/Models/CSSProperty.js:

(WI.CSSProperty.prototype._updateOwnerStyleText):

LayoutTests:

Add tests for WI.TextRange.protopyte.resolveOffsets.

  • inspector/unit-tests/text-range-expected.txt: Added.
  • inspector/unit-tests/text-range.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r224209 r224210  
     12017-10-30  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Web Inspector: [PARITY] Styles Redesign: Ability to modify style attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=178328
     5        <rdar://problem/35000990>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Add tests for WI.TextRange.protopyte.resolveOffsets.
     10
     11        * inspector/unit-tests/text-range-expected.txt: Added.
     12        * inspector/unit-tests/text-range.html: Added.
     13
    1142017-10-30  Matt Lewis  <jlewis3@apple.com>
    215
  • trunk/Source/WebInspectorUI/ChangeLog

    r224203 r224210  
     12017-10-30  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        Web Inspector: [PARITY] Styles Redesign: Ability to modify style attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=178328
     5        <rdar://problem/35000990>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Before this patch, modifying a property of a style attribute duplicated the old property
     10        and appended the new one. This happened because WI.TextRange.prototype.resolveOffsets
     11        didn't resolve offsets correctly when text didn't end with a trailing new line.
     12
     13        Since WI.TextRange.prototype.resolveOffsets is used elsewhere and this could be expected
     14        behavior, append a line break before resolving a range.
     15
     16        * UserInterface/Models/CSSProperty.js:
     17        (WI.CSSProperty.prototype._updateOwnerStyleText):
     18
    1192017-10-30  Ross Kirsling  <ross.kirsling@sony.com>
    220
  • trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js

    r224174 r224210  
    356356        // range is the position of the property within the rule.
    357357        let range = this._styleSheetTextRange.relativeTo(this._ownerStyle.styleSheetTextRange.startLine, this._ownerStyle.styleSheetTextRange.startColumn);
    358         range.resolveOffsets(styleText);
     358
     359        // Append a line break to count the last line of styleText towards endOffset.
     360        range.resolveOffsets(styleText + "\n");
    359361
    360362        console.assert(oldText === styleText.slice(range.startOffset, range.endOffset), "_styleSheetTextRange data is invalid.");
Note: See TracChangeset for help on using the changeset viewer.