Title: [243238] trunk/Source/WebInspectorUI
Revision
243238
Author
pecor...@apple.com
Date
2019-03-20 14:22:08 -0700 (Wed, 20 Mar 2019)

Log Message

Web Inspector: Timelines - Export fails for MediaTimelineRecords with originator DOM Node - Cannot serialize cyclic structure
https://bugs.webkit.org/show_bug.cgi?id=196027

Reviewed by Timothy Hatcher.

* UserInterface/Models/MediaTimelineRecord.js:
(WI.MediaTimelineRecord.prototype.toJSON):
Remove the originator since that is a WI.DOMNode and cannot
be JSON serialized.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (243237 => 243238)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-03-20 21:04:10 UTC (rev 243237)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-03-20 21:22:08 UTC (rev 243238)
@@ -1,3 +1,15 @@
+2019-03-20  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Timelines - Export fails for MediaTimelineRecords with originator DOM Node - Cannot serialize cyclic structure
+        https://bugs.webkit.org/show_bug.cgi?id=196027
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Models/MediaTimelineRecord.js:
+        (WI.MediaTimelineRecord.prototype.toJSON):
+        Remove the originator since that is a WI.DOMNode and cannot
+        be JSON serialized.
+
 2019-03-20  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: Debugger: move breakpoint storage to use `WI.ObjectStore`

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/MediaTimelineRecord.js (243237 => 243238)


--- trunk/Source/WebInspectorUI/UserInterface/Models/MediaTimelineRecord.js	2019-03-20 21:04:10 UTC (rev 243237)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/MediaTimelineRecord.js	2019-03-20 21:22:08 UTC (rev 243238)
@@ -49,11 +49,18 @@
     {
         // FIXME: DOMNode
 
+        // Don't include the DOMEvent's originator.
+        let domEvent = this._domEvent;
+        if (domEvent && domEvent.originator) {
+            domEvent = Object.shallowCopy(domEvent);
+            domEvent.originator = undefined;
+        }
+
         return {
             type: this.type,
             eventType: this._eventType,
             timestamp: this.startTime,
-            domEvent: this._domEvent,
+            domEvent,
             isLowPower: this._isLowPower,
         };
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to