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

Editorial: use break in navigate algorithm rather than a variable #5277

Merged
merged 1 commit into from
Feb 12, 2020

Conversation

annevk
Copy link
Member

@annevk annevk commented Feb 12, 2020

Also do not assume that all responses have a location URL (even though that would make more sense data-model-wise).


/browsing-the-web.html ( diff )

Also do not assume that all responses have a location URL (even though that would make more sense data-model-wise).
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.

Oof, having both null and not present is pretty icky. Are you sure you don't want to fix that in Fetch? :)


<li>
<p>While <var>done</var> is false:</p>
<p>While true:</p>

<ol>
<li><p>Let <var>currentURL</var> be <var>response</var>'s <span
Copy link
Member

Choose a reason for hiding this comment

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

This also assumes that there's a location URL.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's fine in that case as there's a break when there's not.

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand. If response is non-null but response has no location URL, then the following steps:

  1. Let currentURL be response's location URL, if response is not null, and request's current URL otherwise.

  2. If reservedEnvironment is not null and currentURL's origin is not the same as reservedEnvironment's creation URL's origin, then:

will "crash" first when you try to access response's location URL, and then crash a second time when you try to access the non-existent location URL's origin.

Copy link
Member Author

Choose a reason for hiding this comment

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

How can you get there with a response that has no location URL though?

Copy link
Member

Choose a reason for hiding this comment

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

I see. However, note that one has to look down to step 7.4 and up to step 1 to figure that out. Perhaps add an assert beforehand?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's just leave it until the Fetch thing is fixed?

Copy link
Member

Choose a reason for hiding this comment

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

I guess so.

@annevk
Copy link
Member Author

annevk commented Feb 12, 2020

The Fetch issue is whatwg/fetch#958 and I might do it I suppose, but I was hoping someone would pick it up as part of learning how to do things.

@annevk annevk merged commit fdbd2bd into master Feb 12, 2020
@annevk annevk deleted the annevk/navigate-cleanup branch February 12, 2020 16:53
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.

2 participants