[Web Inspector][WinCairo] The error "TypeError: selection.focusNode.closest is not a function." happens by selecting an error message
I tested with WinCairo WK2, trunk, r255482.
1. Start MiniBrowser
2. Open Web Inspector
3. Open Console Tab
4. Enter "foo"
5. An error message "ReferenceError: Can't find variable: foo" is output
6. Press left mouse button on the string of the error message
6. Drug the mouse
7. "TypeError: selection.focusNode.closest is not a function." happens
These uncaught exceptions caused the problem:
TypeError: selection.focusNode.closest is not a function. (In 'selection.focusNode.closest("." + WI.LogContentView.ItemWrapperStyleClassName)', 'selection.focusNode.closest' is undefined) (at LogContentView.js:552:54)
_mousemove @ LogContentView.js:552:54
handleEvent @ LogContentView.js:653:28
I don't see this issue in Mac port.
Hmm, Devin Rousso seems to have reported similar for mac at https://bugs.webkit.org/show_bug.cgi?id=198594
Looks a same issue. Thanks. But surprisingly Mac port doesn't reproduce the issue even this Bug 198594's test case on my Mac. 🤔
selection.focusNode is a Text node at the time. closest is a method of Element.
The code was added by r242174 (Bug 173747).
Created attachment 389941 [details]
Comment on attachment 389941 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=389941&action=review
> + var focusElement = selection.focusNode;
Style: we prefer using `let`
Created attachment 390037 [details]
Patch for landing
Thank you for the reveiw.
Committed r256006: <https://trac.webkit.org/changeset/256006>