Modified: trunk/Source/WebInspectorUI/ChangeLog (213960 => 213961)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-03-14 23:44:01 UTC (rev 213960)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-03-15 00:05:27 UTC (rev 213961)
@@ -1,3 +1,17 @@
+2017-03-14 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: Exception when fetching computed styles can break future updates of section
+ https://bugs.webkit.org/show_bug.cgi?id=169638
+ <rdar://problem/30588688>
+
+ Reviewed by Devin Rousso.
+
+ * UserInterface/Models/DOMNodeStyles.js:
+ (WebInspector.DOMNodeStyles.prototype.refresh.wrap):
+ (WebInspector.DOMNodeStyles.prototype.refresh):
+ Gracefully handle exceptions. If an exception did happen we
+ would be unable to update these in the future.
+
2017-03-14 Devin Rousso <[email protected]>
Web Inspector: RTL: add support for Memory timeline
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (213960 => 213961)
--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js 2017-03-14 23:44:01 UTC (rev 213960)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js 2017-03-15 00:05:27 UTC (rev 213961)
@@ -79,6 +79,18 @@
let fetchedInlineStylesPromise = new WebInspector.WrappedPromise;
let fetchedComputedStylesPromise = new WebInspector.WrappedPromise;
+ // Ensure we resolve these promises even in the case of an error.
+ function wrap(func, promise) {
+ return (...args) => {
+ try {
+ func.apply(this, args);
+ } catch (e) {
+ console.error(e);
+ promise.resolve();
+ }
+ };
+ }
+
function parseRuleMatchArrayPayload(matchArray, node, inherited)
{
var result = [];
@@ -239,9 +251,9 @@
// FIXME: Convert to pushing StyleSheet information to the frontend. <rdar://problem/13213680>
WebInspector.cssStyleManager.fetchStyleSheetsIfNeeded();
- CSSAgent.getMatchedStylesForNode.invoke({nodeId: this._node.id, includePseudo: true, includeInherited: true}, fetchedMatchedStyles.bind(this));
- CSSAgent.getInlineStylesForNode.invoke({nodeId: this._node.id}, fetchedInlineStyles.bind(this));
- CSSAgent.getComputedStyleForNode.invoke({nodeId: this._node.id}, fetchedComputedStyle.bind(this));
+ CSSAgent.getMatchedStylesForNode.invoke({nodeId: this._node.id, includePseudo: true, includeInherited: true}, wrap.call(this, fetchedMatchedStyles, fetchedMatchedStylesPromise));
+ CSSAgent.getInlineStylesForNode.invoke({nodeId: this._node.id}, wrap.call(this, fetchedInlineStyles, fetchedInlineStylesPromise));
+ CSSAgent.getComputedStyleForNode.invoke({nodeId: this._node.id}, wrap.call(this, fetchedComputedStyle, fetchedComputedStylesPromise));
this._pendingRefreshTask = Promise.all([fetchedMatchedStylesPromise.promise, fetchedInlineStylesPromise.promise, fetchedComputedStylesPromise.promise])
.then(() => {