Skip to content

Copy a document's base URL when cloning#1492

Open
annevk wants to merge 1 commit into
mainfrom
base-url-clone
Open

Copy a document's base URL when cloning#1492
annevk wants to merge 1 commit into
mainfrom
base-url-clone

Conversation

@annevk

@annevk annevk commented Jul 11, 2026

Copy link
Copy Markdown
Member

Copy a document's base URL when cloning

The baseURI getter now defers to a new "get the base URL" algorithm, which returns null by default and falls back to the node document's URL. HTML overrides this algorithm (to return the document base URL), so DOM no longer reaches into HTML for a value returned by a DOM API.

Cloning a document now copies its base URL into a new "base URL override", so that a shallow clone, which has no base element, still reports the base URL of the document it was cloned from.

Fixes #454.

Tests: web-platform-tests/wpt#61232

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

The baseURI getter now defers to a new "get the base URL" algorithm, which
returns null by default and falls back to the node document's URL. HTML
overrides this algorithm (to return the document base URL), so DOM no longer
reaches into HTML for a value returned by a DOM API.

Cloning a document now copies its base URL into a new "base URL override", so
that a shallow clone, which has no base element, still reports the base URL of
the document it was cloned from.

Fixes #454.

Tests: web-platform-tests/wpt#61232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Document's base URL needs to be cloned

1 participant