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

Location: implement location-object-setter-navigate #23425

Open
gterzian opened this issue May 19, 2019 · 1 comment
Open

Location: implement location-object-setter-navigate #23425

gterzian opened this issue May 19, 2019 · 1 comment

Comments

@gterzian
Copy link
Member

@gterzian gterzian commented May 19, 2019

Spec: https://html.spec.whatwg.org/multipage/#location-object-setter-navigate

The spec mentions at various places(example: dom-location-protocol setter) in the Location interface to location-object-setter-navigate the Location, versus merely location-object-navigate it, like is done at other places(example: dom-location-replace).

The main difference is potentially setting a replacement flag, which will result in the navigation occuring with replacement-enabled.

In our current implementation, we don't perform the additional checks and potentially set the replacement flag, for example, SetProtocol simply does a load_url with replacement always false. So instead we should perform the checks mentioned here and potentially do a load_url with replacement being true.

The required checks are threefold:

  1. "This Location object's relevant Document has completely loaded". Look to use Document.completely_loaded
  2. "In the task in which the algorithm is running, an activation behavior is currently being processed whose click event's isTrusted attribute is true", Look into using Element.click_in_progress or something else using activation
  3. "In the task in which the algorithm is running, the event listener for a click event, whose isTrusted attribute is true, is being handled.". Not completely sure how to do that, to be looked into.

A Location object has access to a Window, which itself has access, via the Document method, to a Document. I think it's via the window and or document associated with the location object that the above checks can be successfully performed.

Marked "interesting project" because it's an opportunity to dig into well spec'ed out concepts and their implementations, which will involve understanding the lifecycle of a web page(and the parts it is made of), as well as that of "tasks" running on the event-loop of a web-page, and is a good example of how some well-known JS web APIs are implemented in Servo(and the web in general).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.