The spec currently refers to the "active document", which is a property of a browsing context. However, it doesn't define which browsing context it's getting the "active document" from.
However, this doesn't appear to be the correct concept in the first place. Gecko, Chrome and WebKit all seem to use the URL of the relevant global's associated Document.
In particular, this difference is significant if the browsing context is navigated. In that case, the "active document" would change, and the spec would suggest using the URL the BC was navigated to. All browsers I tested use the pre-navigation URL instead.
The spec currently refers to the "active document", which is a property of a browsing context. However, it doesn't define which browsing context it's getting the "active document" from.
However, this doesn't appear to be the correct concept in the first place. Gecko, Chrome and WebKit all seem to use the URL of the relevant global's associated Document.
In particular, this difference is significant if the browsing context is navigated. In that case, the "active document" would change, and the spec would suggest using the URL the BC was navigated to. All browsers I tested use the pre-navigation URL instead.