There're a few methods defined in Utilities.js that could be replaced by Element.prototype.closest[1]: Node.prototype.enclosingNodeOrSelfWithClass Node.prototype.enclosingNodeOrSelfWithNodeName Node.prototype.enclosingNodeOrSelfWithNodeNameInArray [1]: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
Created attachment 363127 [details] Patch I haven't tested every single case, but the ones I did worked fine :)
Comment on attachment 363127 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=363127&action=review r=me > Source/WebInspectorUI/UserInterface/Base/Main.js:2340 > + let contentBrowserElement = this.currentFocusElement.closest("content-browser"); This should be ".content-browser"
Created attachment 363137 [details] Patch
Comment on attachment 363137 [details] Patch Clearing flags on attachment: 363137 Committed r242174: <https://trac.webkit.org/changeset/242174>
All reviewed patches have been landed. Closing bug.
<rdar://problem/48454502>
Comment on attachment 363137 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=363137&action=review > Source/WebInspectorUI/UserInterface/Views/LogContentView.js:536 > + wrapper = selection.focusNode.closest("." + WI.LogContentView.ItemWrapperStyleClassName); selection.focusNode isn't necessarily an Element. Filed: Bug 207248 – [Web Inspector][WinCairo] Selecting an error message in Console causes "TypeError: selection.focusNode.closest is not a function."