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

Clarification on about:blank pages in "Initialize the Document object" #7031

Closed
yoavweiss opened this issue Sep 6, 2021 · 6 comments
Closed
Labels
clarification Standard could be clearer

Comments

@yoavweiss
Copy link
Contributor

I'm reading through initialize the Document object to understand if Create an NT entry (in step 16) is supposed to be called for about:blank pages.

I think the answer is yes, but step 5 is ambigous: "If browsingContext is still on its initial about:blank Document .... then do nothing" and step 6 starts with "otherwise".

I'm assuming that means that for about:blank pages, steps 7+ still run, but it's not super clear.
If I'm right with my assumptions, I think it'd be better to eliminate step 5 and include its (negated) condition directly in step 6. If I'm wrong, it'd be better to say "abort these steps" or something else that's more precise than "do nothing".

@domenic
Copy link
Member

domenic commented Sep 7, 2021

Your reading is correct. I'm a bit unsure how you could read it any other way? Does it help to mentally translate the "If/Otherwise" into if/else code blocks?

We've avoided the architecture you suggest because the negated condition is hard to reason about and doesn't capture any clear property of the situation. Whereas the condition as stated today is clearly about same-origin initial about:blank replacement.

@domenic domenic added the clarification Standard could be clearer label Sep 7, 2021
@yoavweiss
Copy link
Contributor Author

In that case, I think it would help to make the "if/otherwise" conditions all live in the same step (or as substeps of a single steps).

@domenic
Copy link
Member

domenic commented Sep 8, 2021

That would be a pretty big departure from how we do other if/otherwise conditions in the spec, so I think it would just make things more confusing for readers...

@yoavweiss
Copy link
Contributor Author

OK, that's fair. Thanks for clarifying.

@noamr
Copy link
Contributor

noamr commented Oct 4, 2021

Note that that if/otherwise statement refers to navigating from about:blank with history.replace.
Loading about:blank in the first place does not go through the "Initialize the document" algorithm.

@noamr
Copy link
Contributor

noamr commented Oct 4, 2021

IIUC about:blank's document is created here, without navigation params and everything that goes into initializing a document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer
Development

No branches or pull requests

3 participants