🐛 fix purgeShadowRoots sometimes fails to recognize connected nodes as such#15906
Conversation
dvoytenko
left a comment
There was a problem hiding this comment.
Any tests need to be updated?
|
Updating some tests now, but they seem to be related to infra changes, not to this PR |
|
It looks like |
|
/to @dvoytenko I'm not sure what you mean wrt that test in your previous comment. What should I do with it? /to @rsimha I modified |
|
I think @alanorozco has already made it so you can pass in a regex. And yeah, optionally passing in a count sgtm. |
|
Yup, it now accepts regex! |
|
@danielrozenberg here's an idea of the test, similar to the "should stop broadcasting after force-close". Stub |
1f73789 to
69f530e
Compare
…nt.contains stubbed to return false
69f530e to
c30c813
Compare
|
@dvoytenko PTAL |
The
purgeShadowRoots_method looks to see whether shadow roots are attached by checking whetherthis.win.document.contains(shadowroot.host)which fails on occasion (for reasons.) This PR replaces this logic with the more predictableisConnected(more specifically with @jridgewell'sisConnectedNodepolyfill)Fix is basically 99% from @dvoytenko, thanks!
This issue affects pages that have multiple shadow roots, and so it resolves #12645