Changeset 240351 in webkit
- Timestamp:
- Jan 23, 2019 11:29:18 AM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r240347 r240351 1 2019-01-23 Devin Rousso <drousso@apple.com> 2 3 WebInspector: Confusingly nested events in the timeline for Mutation Observers 4 https://bugs.webkit.org/show_bug.cgi?id=192884 5 <rdar://problem/46854178> 6 7 Reviewed by Joseph Pecoraro. 8 9 If a microtask event (e.g. `ObserverCallback`) is contained within a `EvaluatedScript` 10 event, move that microtask event to be a sibling of the `EvaluateScript`, subtracting the 11 microtask's time taken from the `EvaluateScript`'s time. If there are no other children 12 after this move, then remove the `EvaluateScript` altogether. 13 14 * UserInterface/Controllers/TimelineManager.js: 15 (WI.TimelineManager.prototype.eventRecorded.fixMicrotaskPlacement): Added. 16 (WI.TimelineManager.prototype.eventRecorded): 17 (WI.TimelineManager.prototype._mergeScriptProfileRecords): 18 1 19 2019-01-23 Joseph Pecoraro <pecoraro@apple.com> 2 20 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r240323 r240351 357 357 return; 358 358 359 function fixMicrotaskPlacement(children) 360 { 361 let newChildren = []; 362 for (let child of children) { 363 if (child.type === TimelineAgent.EventType.EvaluateScript) { 364 let [microtasks, events] = child.children.partition((grandchild) => { 365 return grandchild.type === TimelineAgent.EventType.ObserverCallback; 366 }); 367 368 if (events.length) { 369 child.children = events; 370 child.endTime = events.lastValue.endTime; 371 newChildren.push(child); 372 } 373 374 newChildren = newChildren.concat(microtasks); 375 } else 376 newChildren.push(child); 377 } 378 return newChildren; 379 } 380 359 381 var records = []; 360 382 … … 377 399 378 400 if (recordPayload.children && recordPayload.children.length) 379 stack.push({array: recordPayload.children, parent: recordPayload, parentRecord: record || entry.parentRecord, index: 0});401 stack.push({array: fixMicrotaskPlacement(recordPayload.children), parent: recordPayload, parentRecord: record || entry.parentRecord, index: 0}); 380 402 ++entry.index; 381 403 } else … … 1056 1078 profilerRecord = nextScriptProfilerRecord(); 1057 1079 1080 let firstProfilerRecordForWebRecord = null; 1081 1058 1082 // If there are more script profile records in the same time interval, add them 1059 1083 // as individual script evaluated records with profiles. This can happen with … … 1061 1085 // FIXME: <https://webkit.org/b/152903> Web Inspector: Timeline Cleanup: Better Timeline Record for Microtask Checkpoints 1062 1086 while (profilerRecord && recordEnclosesRecord(webRecord, profilerRecord)) { 1087 if (!firstProfilerRecordForWebRecord) 1088 firstProfilerRecordForWebRecord = profilerRecord; 1089 1063 1090 this._addRecord(profilerRecord); 1064 1091 profilerRecord = nextScriptProfilerRecord(); 1065 1092 } 1093 1094 if (firstProfilerRecordForWebRecord) 1095 webRecord.endTime = firstProfilerRecordForWebRecord.startTime; 1066 1096 1067 1097 webRecord = nextWebTimelineRecord();
Note: See TracChangeset
for help on using the changeset viewer.