Changeset 246621 in webkit


Ignore:
Timestamp:
Jun 19, 2019 5:40:27 PM (5 years ago)
Author:
Nikita Vasilyev
Message:

REGRESSION(r240946): Web Inspector: Styles: Pasting multiple properties has issues
https://bugs.webkit.org/show_bug.cgi?id=198505
<rdar://problem/51374780>

Reviewed by Matt Baker.

Source/WebInspectorUI:

Since r240946, setting WI.CSSStyleDeclaration.prototype.text updates the text immediately.
When WI.CSSStyleDeclaration.prototype.update gets called after setting text, it exits early
without firing WI.CSSStyleDeclaration.Event.PropertiesChanged.

  • UserInterface/Models/CSSStyleDeclaration.js:

(WI.CSSStyleDeclaration):
(WI.CSSStyleDeclaration.prototype.set text):

LayoutTests:

  • inspector/css/modify-css-property.html:

Listen for PropertiesChanged on the specific inline style declaration.
In Debug, PropertiesChanged may fire on a computed style declaration first,
causing the test to fail.

  • inspector/css/pseudo-element-matches-for-pseudo-element-node.html:

Drive-by: fix trailing white space.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r246619 r246621  
     12019-06-19  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        REGRESSION(r240946): Web Inspector: Styles: Pasting multiple properties has issues
     4        https://bugs.webkit.org/show_bug.cgi?id=198505
     5        <rdar://problem/51374780>
     6
     7        Reviewed by Matt Baker.
     8
     9        * inspector/css/modify-css-property.html:
     10        Listen for PropertiesChanged on the specific inline style declaration.
     11        In Debug, PropertiesChanged may fire on a computed style declaration first,
     12        causing the test to fail.
     13
     14        * inspector/css/pseudo-element-matches-for-pseudo-element-node.html:
     15        Drive-by: fix trailing white space.
     16
    1172019-06-19  Ryan Haddad  <ryanhaddad@apple.com>
    218
  • trunk/LayoutTests/inspector/css/modify-css-property.html

    r241011 r246621  
    118118            let styleDeclaration = getInlineStyleDeclaration();
    119119
    120             WI.CSSStyleDeclaration.awaitEvent(WI.CSSStyleDeclaration.Event.PropertiesChanged).then((event) => {
     120            styleDeclaration.awaitEvent(WI.CSSStyleDeclaration.Event.PropertiesChanged).then((event) => {
    121121                InspectorTest.expectThat(!styleDeclaration.locked, `Style declaration is unlocked.`);
    122122                InspectorTest.expectEqual(getProperty("width").rawValue, "200px", `"width" property value should update to "200px".`);
  • trunk/LayoutTests/inspector/css/pseudo-element-matches-for-pseudo-element-node.html

    r236766 r246621  
    3535        }
    3636
    37         InspectorTest.completeTest();               
     37        InspectorTest.completeTest();
    3838    }
    3939
  • trunk/Source/WebInspectorUI/ChangeLog

    r246618 r246621  
     12019-06-19  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        REGRESSION(r240946): Web Inspector: Styles: Pasting multiple properties has issues
     4        https://bugs.webkit.org/show_bug.cgi?id=198505
     5        <rdar://problem/51374780>
     6
     7        Reviewed by Matt Baker.
     8
     9        Since r240946, setting WI.CSSStyleDeclaration.prototype.text updates the text immediately.
     10        When WI.CSSStyleDeclaration.prototype.update gets called after setting text, it exits early
     11        without firing WI.CSSStyleDeclaration.Event.PropertiesChanged.
     12
     13        * UserInterface/Models/CSSStyleDeclaration.js:
     14        (WI.CSSStyleDeclaration):
     15        (WI.CSSStyleDeclaration.prototype.set text):
     16
    1172019-06-19  Matt Baker  <mattbaker@apple.com>
    218
  • trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js

    r245991 r246621  
    4343        this._initialState = null;
    4444        this._updatesInProgressCount = 0;
     45        this._pendingPropertiesChanged = false;
    4546        this._locked = false;
    4647        this._pendingProperties = [];
     
    184185        // Don't fire the event if text hasn't changed. However, it should still fire for Computed style declarations
    185186        // because it never has text.
    186         if (oldText === this._text && this._type !== WI.CSSStyleDeclaration.Type.Computed)
    187             return;
     187        if (oldText === this._text && !this._pendingPropertiesChanged && this._type !== WI.CSSStyleDeclaration.Type.Computed)
     188            return;
     189
     190        this._pendingPropertiesChanged = false;
    188191
    189192        function delayed()
     
    238241            timeoutId = null;
    239242            this._updatesInProgressCount = Math.max(0, this._updatesInProgressCount - 1);
     243            this._pendingPropertiesChanged = true;
    240244        };
    241245
Note: See TracChangeset for help on using the changeset viewer.