Re: [whatwg/dom] Patch HTML's base URL stuff to be in terms of DOM (#61)

domenic left a comment (whatwg/dom#61)

I've looked at the code for this recently as it impacts speculation rules (https://github.com/whatwg/html/pull/11426).

In Chromium, document base URL changes have [the following impacts](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/document.cc;l=4792-4839;drc=17252ebab8c8f8977b19616706fa98dcf4d9d7ae):

- Clearing the `fill_or_clip_path_uri_value_cache_` in the style engine.
- Invalidating `:visited`
- Clearing the cache we use to resolve relative URLs
- Re-parsing `<script type=speculationrules>`
- Re-triggering speculation rules

So I think we can basically remove the current concept, and then add back something more rigorous for speculation rules.

Although `:visited` is directly observable, it's specified in a very hand-wavey way ([HTML](https://html.spec.whatwg.org/multipage/semantics-other.html#selector-visited), [CSS](https://drafts.csswg.org/selectors/#visited-pseudo); basically "has this link been visited") which does not need an explicit hook in the spec to update it.

I'll post a PR for this.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/61#issuecomment-3051213049
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/61/3051213049@github.com>

Received on Wednesday, 9 July 2025 05:50:32 UTC