Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upLocation: implement location-object-setter-navigate #23425
Comments
|
maybe relevant test: https://github.com/servo/servo/blob/master/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html and metadata set to The relevant test folder is https://github.com/servo/servo/tree/master/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface (although there might be relevant tests elsewhere too). |
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-navigatethe Location, versus merely location-object-navigate it, like is done at other places(example: dom-location-replace).The main difference is potentially setting a
replacementflag, 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
replacementflag, for example,SetProtocolsimply does aload_urlwithreplacementalwaysfalse. So instead we should perform the checks mentioned here and potentially do aload_urlwithreplacementbeingtrue.The required checks are threefold:
A Location object has access to a
Window, which itself has access, via theDocumentmethod, to aDocument. 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).