WebKit Bugzilla
Attachment 372003 Details for
Bug 198505
: REGRESSION(r240946): Web Inspector: Styles: Pasting multiple properties has issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch.txt (text/plain), 4.11 KB, created by
Nikita Vasilyev
on 2019-06-12 17:09:58 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Nikita Vasilyev
Created:
2019-06-12 17:09:58 PDT
Size:
4.11 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 788d30a070f..25dedfc0b59 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,22 @@ >+2019-06-08 Nikita Vasilyev <nvasilyev@apple.com> >+ >+ REGRESSION(r240946): Web Inspector: Styles: Pasting multiple properties has issues >+ https://bugs.webkit.org/show_bug.cgi?id=198505 >+ <rdar://problem/51374780> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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. >+ >+ This patch adds _pendingPropertiesChanged flag to fire WI.CSSStyleDeclaration.Event.PropertiesChanged >+ after changing text. >+ >+ * UserInterface/Models/CSSStyleDeclaration.js: >+ (WI.CSSStyleDeclaration): >+ (WI.CSSStyleDeclaration.prototype.set text): >+ > 2019-05-24 Devin Rousso <drousso@apple.com> > > Web Inspector: Overlay: don't show setting for showing rulers/guides during element selection if it's not supported >diff --git a/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js b/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js >index 74b694f2212..ffbd924ce3d 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js >+++ b/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js >@@ -42,6 +42,7 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object > > this._initialState = null; > this._updatesInProgressCount = 0; >+ this._pendingPropertiesChanged = false; > this._locked = false; > this._pendingProperties = []; > this._propertyNameMap = {}; >@@ -183,9 +184,11 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object > > // Don't fire the event if text hasn't changed. However, it should still fire for Computed style declarations > // because it never has text. >- if (oldText === this._text && this._type !== WI.CSSStyleDeclaration.Type.Computed) >+ if (oldText === this._text && !this._pendingPropertiesChanged && this._type !== WI.CSSStyleDeclaration.Type.Computed) > return; > >+ this._pendingPropertiesChanged = false; >+ > function delayed() > { > this.dispatchEventToListeners(WI.CSSStyleDeclaration.Event.PropertiesChanged); >@@ -237,6 +240,7 @@ WI.CSSStyleDeclaration = class CSSStyleDeclaration extends WI.Object > clearTimeout(timeoutId); > timeoutId = null; > this._updatesInProgressCount = Math.max(0, this._updatesInProgressCount - 1); >+ this._pendingPropertiesChanged = true; > }; > > this._nodeStyles.changeStyleText(this, text, styleTextDidChange); >diff --git a/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js b/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js >index a57b5201e35..b4cd59bf46a 100644 >--- a/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js >+++ b/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js >@@ -144,10 +144,12 @@ WI.DOMNodeStyles = class DOMNodeStyles extends WI.Object > > refresh() > { >- if (this._pendingRefreshTask) >+ if (this._pendingRefreshTask) { >+ // A promise in progress cannot be canceled. Refresh again after the current refresh is done. >+ this._needsRefresh = true; > return this._pendingRefreshTask; >- >- this._needsRefresh = false; >+ } else >+ this._needsRefresh = false; > > let previousStylesMap = this._stylesMap.copy(); > >@@ -318,6 +320,10 @@ WI.DOMNodeStyles = class DOMNodeStyles extends WI.Object > this._pendingRefreshTask = Promise.all([fetchedMatchedStylesPromise.promise, fetchedInlineStylesPromise.promise, fetchedComputedStylesPromise.promise]) > .then(() => { > this._pendingRefreshTask = null; >+ >+ if (this._needsRefresh) >+ this.refresh(); >+ > return this; > }); >
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
Flags:
nvasilyev
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198505
:
371683
|
371688
|
371690
|
371694
|
371783
|
371814
|
372003
|
372011
|
372203
|
372208
|
372308
|
372318
|
372355
|
372362
|
372394