Replace fallback base URL with DOM's base URL override - #12674
Open
annevk wants to merge 2 commits into
Open
Conversation
Define a Document's get the base URL algorithm, used by DOM's baseURI getter, to return the document base URL. And have the document base URL take the base URL override into account, which DOM sets when a document is cloned, so that a clone without a base element reports the base URL of the document it was cloned from. See whatwg/dom#454. Tests: web-platform-tests/wpt#61232
Remove the fallback base URL and a Document's about base URL, and have the document base URL consult DOM's base URL override instead. A base element now resolves its href against its Document's URL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace fallback base URL with DOM's base URL override
A Document's base URL now comes from a single field, DOM's base URL override, replacing the fallback base URL and a Document's about base URL. The document base URL consults it when there is no base element. It is populated at creation for "about:"-schemed Documents from the initiator's base URL, and by DOM when a Document is cloned, so that a clone without a base element reports the base URL of the Document it was cloned from. DOM's baseURI getter defers to a new get the base URL algorithm, which this specification overrides to return the document base URL, so DOM no longer reaches into HTML for a value returned by a DOM API.
As a consequence a base element resolves its href against its Document's URL instead of the inherited base URL. A relative href in an "about:"-schemed Document therefore no longer resolves, as those URLs have an opaque path; ordinary relative URLs keep inheriting.
See whatwg/dom#454.
Tests: web-platform-tests/wpt#61231 & web-platform-tests/wpt#61232.
<base>hrefin anabout:blankdocument against the inherited base URL, which this changes)(See WHATWG Working Mode: Changes for more details.)
/browsing-the-web.html ( diff )
/document-lifecycle.html ( diff )
/document-sequences.html ( diff )
/dom.html ( diff )
/infrastructure.html ( diff )
/semantics.html ( diff )
/urls-and-fetching.html ( diff )