WebKit Bugzilla
Attachment 359810 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
bug-192884-20190122165608.patch (text/plain), 4.59 KB, created by
Devin Rousso
on 2019-01-22 16:56:08 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-01-22 16:56:08 PST
Size:
4.59 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 67cdda3ec3a96450140d666744689c76e4f911e5..d201cf7bbc11401d1bb1de9ba6e9953b0eae4557 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-22 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): >+ (WI.TimelineManager.prototype._mergeScriptProfileRecords): >+ > 2019-01-22 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Network Table appears broken after filter - rows look collapsed >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js b/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >index a254f0059f20411c49f3381e014f75cc8ad65ff3..2bb1118de8ffc8408729e2d1844baa004c9aae25 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(); >@@ -1057,15 +1079,23 @@ WI.TimelineManager = class TimelineManager extends WI.Object > webRecord.profilePayload = profilerRecord.profilePayload; > profilerRecord = nextScriptProfilerRecord(); > >+ let firstProfilerRecordForWebRecord = null; >+ > // If there are more script profile records in the same time interval, add them > // as individual script evaluated records with profiles. This can happen with > // web microtask checkpoints that are technically inside of other web records. > // FIXME: <https://webkit.org/b/152903> Web Inspector: Timeline Cleanup: Better Timeline Record for Microtask Checkpoints > while (profilerRecord && recordEnclosesRecord(webRecord, profilerRecord)) { >+ if (!firstProfilerRecordForWebRecord) >+ firstProfilerRecordForWebRecord = profilerRecord; >+ > this._addRecord(profilerRecord); > profilerRecord = nextScriptProfilerRecord(); > } > >+ if (firstProfilerRecordForWebRecord) >+ webRecord.endTime = firstProfilerRecordForWebRecord.startTime; >+ > webRecord = nextWebTimelineRecord(); > continue; > }
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