Title: [240368] trunk/Source/WebInspectorUI
- Revision
- 240368
- Author
- [email protected]
- Date
- 2019-01-23 16:59:12 -0800 (Wed, 23 Jan 2019)
Log Message
Web Inspector: Refactor WI.CSSStyleDeclaration.prototype.update
https://bugs.webkit.org/show_bug.cgi?id=193737
Reviewed by Matt Baker.
Remove unused event data from the WI.CSSStyleDeclaration.Event.PropertiesChanged event.
* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.update):
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (240367 => 240368)
--- trunk/Source/WebInspectorUI/ChangeLog 2019-01-24 00:57:59 UTC (rev 240367)
+++ trunk/Source/WebInspectorUI/ChangeLog 2019-01-24 00:59:12 UTC (rev 240368)
@@ -1,3 +1,15 @@
+2019-01-23 Nikita Vasilyev <[email protected]>
+
+ Web Inspector: Refactor WI.CSSStyleDeclaration.prototype.update
+ https://bugs.webkit.org/show_bug.cgi?id=193737
+
+ Reviewed by Matt Baker.
+
+ Remove unused event data from the WI.CSSStyleDeclaration.Event.PropertiesChanged event.
+
+ * UserInterface/Models/CSSStyleDeclaration.js:
+ (WI.CSSStyleDeclaration.prototype.update):
+
2019-01-23 Devin Rousso <[email protected]>
WebInspector: Confusingly nested events in the timeline for Mutation Observers
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js (240367 => 240368)
--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js 2019-01-24 00:57:59 UTC (rev 240367)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js 2019-01-24 00:59:12 UTC (rev 240368)
@@ -111,8 +111,8 @@
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 @@
this._visibleProperties = null;
- var editable = this.editable;
+ let editable = this.editable;
for (let property of this._properties) {
property.ownerStyle = this;
@@ -140,46 +140,29 @@
}
}
- 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 (oldText && this._text && oldText === this._text)
+ return;
- if (!addedProperties.length && !removedProperties.length)
- 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.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes