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

Add comments linking to the steps of the specs in the checks on Location setters #25714

Closed
wants to merge 9 commits into from

Conversation

@UxioAndrade
Copy link

UxioAndrade commented Feb 9, 2020

As stated in #23670 (comment), I added some comments to the checks on Location setters, so that it is easier to follow the steps in specs.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #23522 (GitHub issue number if applicable)
  • These changes do not require tests because I just added some comments
braddunbar and others added 8 commits Jun 29, 2019
@highfive
Copy link

highfive commented Feb 9, 2020

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @paulrouget (or someone else) soon.

@highfive
Copy link

highfive commented Feb 9, 2020

Heads up! This PR modifies the following files:

@gterzian
Copy link
Member

gterzian commented Feb 10, 2020

Thanks! Could you please also squash into one commit?

@@ -242,7 +256,11 @@ impl LocationMethods for Location {
// https://html.spec.whatwg.org/multipage/#dom-location-protocol
fn SetProtocol(&self, value: USVString) -> ErrorResult {
self.check_same_origin_domain()?;
self.set_url_component(value, UrlHelper::SetProtocol);
// Step 6: If copyURL's scheme is not an HTTP(S) scheme, then terminate these steps.
let scheme = value.split(':').next().unwrap();

This comment has been minimized.

@paulrouget

paulrouget Feb 10, 2020

Contributor

Isn’t it dangerous to have unwrap() here?

This comment has been minimized.

@gterzian

gterzian Feb 10, 2020

Member

Yes you're right, actually per Step 5 of the protocol setter spec, I think we should return a Error::Syntax here instead of unwrap, see https://html.spec.whatwg.org/multipage/history.html#dom-location-protocol

This would be using use crate::dom::bindings::error::Error;

This comment has been minimized.

@UxioAndrade

UxioAndrade Feb 10, 2020

Author

Would my latest commit fix that?

@UxioAndrade
Copy link
Author

UxioAndrade commented Feb 10, 2020

Hi @gterzian should I squash all the commits or just the ones before I merged the master branch?

@gterzian
Copy link
Member

gterzian commented Feb 10, 2020

I would say just one(and I think it will still automatically list @braddunbar as co-author, which would be a good thing).

@@ -216,7 +222,10 @@ impl LocationMethods for Location {
// https://html.spec.whatwg.org/multipage/#dom-location-pathname
fn SetPathname(&self, value: USVString) -> ErrorResult {
self.check_same_origin_domain()?;
self.set_url_component(value, UrlHelper::SetPathname);
// Step 3: If copyURL's cannot-be-a-base-URL flag is set, terminate these steps.

This comment has been minimized.

@gterzian

gterzian Feb 10, 2020

Member

Actually, can we put this comment, and all others, above the Ok(()) branch, because the comments all refer to the steps take when the condition is not met.

}
Ok(())
} else {
Err(Error::Syntax)

This comment has been minimized.

@gterzian

gterzian Feb 10, 2020

Member

Here we can put a comment for Step 5, throw a "SyntaxError" DOMException.

@bors-servo
Copy link
Contributor

bors-servo commented Mar 9, 2020

The latest upstream changes (presumably #25931) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link
Contributor

bors-servo commented Mar 11, 2020

The latest upstream changes (presumably #25947) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link
Contributor

bors-servo commented Mar 26, 2020

The latest upstream changes (presumably #26039) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo
Copy link
Contributor

bors-servo commented Apr 6, 2020

The latest upstream changes (presumably #26119) made this pull request unmergeable. Please resolve the merge conflicts.

@dralley
Copy link
Contributor

dralley commented Apr 12, 2020

@UxioAndrade Are you planning on finishing up the PR?

@bors-servo
Copy link
Contributor

bors-servo commented Apr 19, 2020

The latest upstream changes (presumably #26222) made this pull request unmergeable. Please resolve the merge conflicts.

@jdm jdm closed this Apr 20, 2020
@jdm
Copy link
Member

jdm commented Apr 20, 2020

Closing due to inactivity.

@utsavoza utsavoza mentioned this pull request Apr 20, 2020
4 of 4 tasks complete
bors-servo added a commit that referenced this pull request Apr 22, 2020
Implement various checks on the Location setters

Since there are no existing open PRs for the issue, I am raising one based on the work done by @UxioAndrade and @braddunbar in previous two PRs for the issue (#25714 and #23670) respectively.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23522
- [x] There are tests for these changes
bors-servo added a commit that referenced this pull request Apr 24, 2020
Implement various checks on the Location setters

Since there are no existing open PRs for the issue, I am raising one based on the work done by @UxioAndrade and @braddunbar in previous two PRs for the issue (#25714 and #23670) respectively.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23522
- [x] There are tests for these changes
bors-servo added a commit that referenced this pull request Apr 24, 2020
Implement various checks on the Location setters

Since there are no existing open PRs for the issue, I am raising one based on the work done by @UxioAndrade and @braddunbar in previous two PRs for the issue (#25714 and #23670) respectively.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23522
- [x] There are tests for these changes
bors-servo added a commit that referenced this pull request Apr 24, 2020
Implement various checks on the Location setters

Since there are no existing open PRs for the issue, I am raising one based on the work done by @UxioAndrade and @braddunbar in previous two PRs for the issue (#25714 and #23670) respectively.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23522
- [x] There are tests for these changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

8 participants
You can’t perform that action at this time.