WebKit Bugzilla
Attachment 358725 Details for
Bug 192884
: Web Inspector: Confusingly nested events in the timeline for Mutation Observers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
192884.diff (text/plain), 3.12 KB, created by
Devin Rousso
on 2019-01-09 12:35:56 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-01-09 12:35:56 PST
Size:
3.12 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 6ca6684ff15..9ed089fe427 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,20 @@ >+2019-01-09 Devin Rousso <drousso@apple.com> >+ >+ WebInspector: Confusingly nested events in the timeline for Mutation Observers >+ https://bugs.webkit.org/show_bug.cgi?id=192884 >+ <rdar://problem/46854178> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ If a microtask event (e.g. `ObserverCallback`) is contained within a `EvaluatedScript` >+ event, move that microtask event to be a sibling of the `EvaluateScript`, subtracting the >+ microtask's time taken from the `EvaluateScript`'s time. If there are no other children >+ after this move, then remove the `EvaluateScript` altogether. >+ >+ * UserInterface/Controllers/TimelineManager.js: >+ (WI.TimelineManager.prototype.eventRecorded.fixMicrotaskPlacement): Added. >+ (WI.TimelineManager.prototype.eventRecorded): >+ > 2019-01-09 Devin Rousso <drousso@apple.com> > > Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js b/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >index a254f0059f2..348140c36e6 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >@@ -356,6 +356,28 @@ WI.TimelineManager = class TimelineManager extends WI.Object > if (!this._isCapturing) > return; > >+ function fixMicrotaskPlacement(children) >+ { >+ let newChildren = []; >+ for (let child of children) { >+ if (child.type === TimelineAgent.EventType.EvaluateScript) { >+ let [microtasks, events] = child.children.partition((grandchild) => { >+ return grandchild.type === TimelineAgent.EventType.ObserverCallback; >+ }); >+ >+ if (events.length) { >+ child.children = events; >+ child.endTime = events.lastValue.endTime; >+ newChildren.push(child); >+ } >+ >+ newChildren = newChildren.concat(microtasks); >+ } else >+ newChildren.push(child); >+ } >+ return newChildren; >+ } >+ > var records = []; > > // Iterate over the records tree using a stack. Doing this recursively has >@@ -376,7 +398,7 @@ WI.TimelineManager = class TimelineManager extends WI.Object > } > > if (recordPayload.children && recordPayload.children.length) >- stack.push({array: recordPayload.children, parent: recordPayload, parentRecord: record || entry.parentRecord, index: 0}); >+ stack.push({array: fixMicrotaskPlacement(recordPayload.children), parent: recordPayload, parentRecord: record || entry.parentRecord, index: 0}); > ++entry.index; > } else > stack.pop();
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 192884
:
357735
|
357736
|
358725
|
358726
|
359810