WebKit Bugzilla
Attachment 359942 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.04 KB, created by
Nikita Vasilyev
on 2019-01-23 14:29:34 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Nikita Vasilyev
Created:
2019-01-23 14:29:34 PST
Size:
4.04 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 2c0371f0c1b..af2e9217fbb 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,18 @@ >+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!). >+ >+ Don't pass addedProperties and removedProperties to WI.CSSStyleDeclaration.Event.PropertiesChanged >+ event since they are never used. >+ >+ Use `let` instead of `var`. >+ >+ * 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..a1edd32d45a 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,16 +140,13 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object > } > } > >- var removedProperties = []; >- for (var i = 0; i < oldProperties.length; ++i) { >- var oldProperty = oldProperties[i]; >+ for (let i = 0; i < oldProperties.length; ++i) { >+ let oldProperty = oldProperties[i]; > > if (!this._enabledProperties.includes(oldProperty)) { > // 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) >@@ -160,26 +157,19 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object > if (dontFireEvents) > return; > >- var addedProperties = []; >- for (var i = 0; i < this._enabledProperties.length; ++i) { >+ let addedProperties = []; >+ for (let 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