WebKit Bugzilla
Attachment 359957 Details for
Bug 193737
: Web Inspector: Refactor WI.CSSStyleDeclaration.prototype.update
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch.txt (text/plain), 4.18 KB, created by
Nikita Vasilyev
on 2019-01-23 15:29:25 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Nikita Vasilyev
Created:
2019-01-23 15:29:25 PST
Size:
4.18 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 2c0371f0c1b..7634a2bbcfc 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-23 Nikita Vasilyev <nvasilyev@apple.com> >+ >+ Web Inspector: Refactor WI.CSSStyleDeclaration.prototype.update >+ https://bugs.webkit.org/show_bug.cgi?id=193737 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove unused event data from the WI.CSSStyleDeclaration.Event.PropertiesChanged event. >+ >+ * UserInterface/Models/CSSStyleDeclaration.js: >+ (WI.CSSStyleDeclaration.prototype.update): >+ > 2019-01-23 Devin Rousso <drousso@apple.com> > > WebInspector: Confusingly nested events in the timeline for Mutation Observers >diff --git a/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js b/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js >index 1ddc3ff558d..99780b9b139 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js >+++ b/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js >@@ -111,8 +111,8 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object > text = text || ""; > properties = properties || []; > >- var oldProperties = this._properties || []; >- var oldText = this._text; >+ let oldProperties = this._properties || []; >+ let oldText = this._text; > > this._text = text; > this._properties = properties; >@@ -123,7 +123,7 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object > > this._visibleProperties = null; > >- var editable = this.editable; >+ let editable = this.editable; > > for (let property of this._properties) { > property.ownerStyle = this; >@@ -140,46 +140,29 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object > } > } > >- var removedProperties = []; >- for (var i = 0; i < oldProperties.length; ++i) { >- var oldProperty = oldProperties[i]; >+ for (let oldProperty of oldProperties) { >+ if (this._enabledProperties.includes(oldProperty)) >+ continue; > >- if (!this._enabledProperties.includes(oldProperty)) { >- // Clear the index, since it is no longer valid. >- oldProperty.index = NaN; >+ // Clear the index, since it is no longer valid. >+ oldProperty.index = NaN; > >- removedProperties.push(oldProperty); >- >- // Keep around old properties in pending in case they >- // are needed again during editing. >- if (editable) >- this._pendingProperties.push(oldProperty); >- } >+ // Keep around old properties in pending in case they >+ // are needed again during editing. >+ if (editable) >+ this._pendingProperties.push(oldProperty); > } > > if (dontFireEvents) > return; > >- var addedProperties = []; >- for (var i = 0; i < this._enabledProperties.length; ++i) { >- if (!oldProperties.includes(this._enabledProperties[i])) >- addedProperties.push(this._enabledProperties[i]); >- } >- > // Don't fire the event if there is text and it hasn't changed. >- if (oldText && this._text && oldText === this._text) { >- if (!this._locked || suppressLock) { >- // We shouldn't have any added or removed properties in this case. >- console.assert(!addedProperties.length && !removedProperties.length); >- } >- >- if (!addedProperties.length && !removedProperties.length) >- return; >- } >+ if (oldText && this._text && oldText === this._text) >+ return; > > function delayed() > { >- this.dispatchEventToListeners(WI.CSSStyleDeclaration.Event.PropertiesChanged, {addedProperties, removedProperties}); >+ this.dispatchEventToListeners(WI.CSSStyleDeclaration.Event.PropertiesChanged); > } > > // Delay firing the PropertiesChanged event so DOMNodeStyles has a chance to mark overridden and associated properties.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193737
:
359942
| 359957 |
359964
|
359966