Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define srcdoc documents as matching about:srcdoc URL #9534

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

domfarolino
Copy link
Member

@domfarolino domfarolino commented Jul 18, 2023

Before this PR, the spec defined "an iframe srcdoc document" as being solely constructed from the contents of an iframe's srcdoc content attribute. This mean that what I'm calling "nontraditional srcdoc documents" technically didn't have the same behavior required by any part of the spec that defined behavior specifically for "an iframe srcdoc document". Nontraditional srcdoc documents can be constructed by either document.open() or navigating to a javascript: URL inside of an about:srcdoc iframe.

This PR removes the distinction between nontraditional srcdoc documents and the classic "iframe srcdoc documents" by introducing the "matches about:srcdoc" concept for URLs, and defining "an iframe srcdoc document" as a thin alias over this concept. This proposal was described by #9514 (comment).

Additionally, this new concept ensures that about:srcdoc#foo documents (modified via history.replaceState(null, '', 'about:srcdoc#foo')) are also counted as normal srcdoc documents, although Chromium and Firefox currently have issues with this (see bugs below).

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

Closes #9514.


/iframe-embed-object.html ( diff )
/urls-and-fetching.html ( diff )

@domfarolino domfarolino changed the title Nontraditional about:srcdoc docs are the same as normal about:srcdoc docs Define srcdoc documents as matching about:srcdoc URL Jul 18, 2023
@domfarolino domfarolino marked this pull request as ready for review July 18, 2023 23:45
@domfarolino domfarolino requested a review from domenic July 18, 2023 23:45
@domfarolino
Copy link
Member Author

I'm not sure if the navigation label really belongs on this PR since we're mostly impacting the behavior of srcdoc documents once navigated to. Separately, there may be other places in the spec where about:srcdoc being used raw should be replaced with matches about:srcdoc now, but I think I'd like to roll that evaluation into #9488 and make that issue about evaluating the "matches" algorithms more completely.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I felt that it was a bit of a layering violation for something that operates at the URL level to know about the fact that, at the document/iframe/history API level, we'll never modify these to have a query.

But then I realize we do basically the same thing for "matches about:blank", with username and password and host. So probably it's fine.

source Outdated Show resolved Hide resolved
@domenic domenic merged commit 78496a4 into main Jul 20, 2023
1 check passed
@domenic domenic deleted the domfarolino/matches-about-srcdoc branch July 20, 2023 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

What to do with non-srcdoc about:srcdoc documents
2 participants