webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.13k stars 165 forks source link

[ShadyDOM] Add `ShadyDOM.querySelectorImplementation` setting. #517

Closed bicknellr closed 1 year ago

bicknellr commented 1 year ago

This PR splits the selectors passed to querySelector and querySelectorAll, then traverses the logical tree manually to match them. This fixes :scope by allowing Shady DOM to decide if the candidate elements being tested against simple selectors containing :scope are the context element and should therefore match.

Fixes #480.

bicknellr commented 1 year ago

I've been looking into the Sauce tests since they were passing before and nothing meaningful happened between then and now that should have caused them to start completely refusing to run on a handful of older browsers. I see the same thing when running the full list of browsers on sauce locally but running those same browsers individually seems to work. I tried debugging a run with the full list and found that the older browsers were being served code that wasn't correctly compiled for their feature sets, so my best guess as of now is that Sauce Connect Proxy might be caching responses between different browser sessions that the single tunnel is used for, causing the older browsers later in the list to see code generated for the newer browsers earlier in the list.

Sauce Connect Proxy used to have a --no-proxy-caching flag which is now deprecated, so next I'm going to try to inject Cache-Control: no-cache into the responses.

bicknellr commented 1 year ago

I think https://github.com/webcomponents/polyfills/pull/522 will resolve the test issue.

bicknellr commented 1 year ago

The test timeout probably needs to be increased; I had to restart them a few times.