Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to implement and ship: self.origin

85 views
Skip to first unread message

Boris Zbarsky

unread,
Feb 8, 2017, 6:10:27 PM2/8/17
to
Summary: self.origin returns the Unicode serialization of the origin of
the settings object of the global represented by "self" (a Window or
WorkerGlobalScope). This gives scripts a consistent way of getting
their origin in both situations. Note that unlike location.origin this
represents the actual origin of the global, not the origin of the URL
it's loaded from. The difference can be substantial in the case of
sandboxing, for example.

In the window case, this returns the same thing as self.document.origin
if document.origin is also implemented.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1306170

Spec: https://html.spec.whatwg.org/multipage/webappapis.html#dom-origin

Platfrom coverage: All

Estimated release: 54

Preference: none.

Devtools bug: None needed, I think.

Status in other implementations: no one else implements this yet. I am
not aware of either WebKit or Blink bugs to implement this either. I
just filed https://bugs.webkit.org/show_bug.cgi?id=168023 and
https://bugs.chromium.org/p/chromium/issues/detail?id=690195 bug have no
idea whether they will actually pick them up.

Tests: I will make sure there are some. ;)

-Boris

Mike West

unread,
Feb 9, 2017, 5:46:19 AM2/9/17
to Boris Zbarsky, dev-pl...@lists.mozilla.org
LGTM, FWIW. Filed an intent to ship for Blink at
https://groups.google.com/a/chromium.org/d/msg/blink-dev/oPGdc9lqpg8/gSjBah0YCAAJ.
I look forward to stealing your tests. :)

-mike
> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>

Boris Zbarsky

unread,
Feb 9, 2017, 2:00:27 PM2/9/17
to
On 2/9/17 5:45 AM, Mike West wrote:
> I look forward to stealing your tests. :)

Yep, sounds good. I put up patches in
https://bugzilla.mozilla.org/show_bug.cgi?id=1306170 with the test bits;
in fact most of the patches are changes to the tests. Note that you'll
want https://github.com/w3c/testharness.js/pull/242 and
https://github.com/w3c/testharness.js/pull/241 too (included in those
patches).

-Boris
0 new messages