Patch to follow.
Created attachment 127399 [details] Patch
Comment on attachment 127399 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=127399&action=review > Source/WebCore/inspector/front-end/StylesSidebarPane.js:333 > + _validateNode: function(userCallback) I'm not sure this is a good method: it looks like "return current node but do something and invoke userCallback ONLY if the node is null". This conditional callback invocation is not consistent with other code using callbacks: all paths invoke at least one of the provided callbacks. On a similar note, returning this.node here is not necessary, since you can assign this.node at the call site instead.
(In reply to comment #2) > (From update of attachment 127399 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=127399&action=review > > > Source/WebCore/inspector/front-end/StylesSidebarPane.js:333 > > + _validateNode: function(userCallback) > > I'm not sure this is a good method: it looks like "return current node but do something and invoke userCallback ONLY if the node is null". This conditional callback invocation is not consistent with other code using callbacks: all paths invoke at least one of the provided callbacks. We are using this exact pattern as asserNode and assertStyleSheet on the backend. validateNode is used to guard methods that require valid node and take care of calling the userCallback. > > On a similar note, returning this.node here is not necessary, since you can assign this.node at the call site instead. See above, I need to return validated node or null for the guard to work.
Committed r108058: <http://trac.webkit.org/changeset/108058>