From a08939f010aaae1c73e6ea1c116e2160c75e290e Mon Sep 17 00:00:00 2001
From: Anne van Kesteren
Let current be the browsing context
of the Document with which this Location object is associated.
Loop: If current has no parent browsing context, jump to - the step labeled end.
While current has a parent browsing context:
-Let current be current's parent browsing - context.
Append (current's parent browsing + context's active document's origin, current's + active document's referrer) to + parentOrigins.
Append the serialization of current's active document's - origin to output.
Set current to current's parent browsing + context.
Return to the step labeled loop.
Let output be a new list of strings.
Let lastRedactedOrigin be null.
For each tuple in parentOrigins:
+ +If lastRedactedOrigin is not null and tuple's parent's origin is same origin with
+ lastRedactedOrigin, then append
+ "null" to output and continue.
Set lastRedactedOrigin to null.
Let origin be null.
End: Return output.
If tuple's referrer is not the empty + string, then:
+ +Let referrerURL be the result of parsing + tuple's referrer.
Assert: referrerURL is not failure.
Set origin to referrerURL's origin.
If origin is null or tuple's parent's origin is not same origin with origin, then set
+ lastRedactedOrigin to tuple's parent's origin and append "null" to output.
Otherwise, append the serialization of tuple's parent's origin to output.
Return output.
The reliance on browsing contexts and their
+ active document in this algorithm is safe as the active document is the
+ Document object that the browsing contexts are
+ nested through, and both are available when
+ a Location object is created at which point this algorithm is run.
A Location object has an associated Location-object-setter
navigate algorithm, which given a url, runs these steps:
The details of how the ancestorOrigins attribute works are still
- controversial and might change. See issue
- #1918 for more information.
As explained earlier, the Location exotic object