Open Ms2ger opened 7 years ago
It's defined to be an opaque origin, AFAICT
https://dom.spec.whatwg.org/#concept-document-origin
But is should be the template
element's node document's origin, right?
It seems like it also inherits URL in Gecko, but not in Chrome. This actually results in URL parsing differences for descendants.
Encoding and mode do not get copied in either.
Agreed that it should just be the origin of doc in the algorithm that creates this document.
I'm not sure how we can actually test it's the identical origin though. We can test the serialization, but not really the document.domain
implications I think.
We might also want to test the "cookie URL" thing (not yet properly defined).
Chrome does actually put the document in an opaque origin. document.origin
returns "null" there.
I don't think that necessarily affects anything so that might be okay to do.
Based on my test, making origin an opaque origin and making document.domain
fail don't seem such bad options. That's more or less what Chrome does already and pretty close to Safari.
Safari returns "http_www.web-platform.test_8000" for document.origin
which seems super weird. @cdumez?
Who has opinions here on behalf of Gecko? @smaug----?
So Chrome inherits domain and origin from creator when doing document.implementation.createHTMLDocument("", "")
Why would template owner document do something else.
Having opaque origin document somewhere in a context where origin isn't opaque feels odd.
@foolip opinions on behalf of Chrome?
Sorry for the delay, but I'll have to defer to @dominiccooney, I know next to nothing about the template
element.
Any news on that? Is this fixed?
No, we still need to define the origin (which affects document.domain
's getter). document.origin
will be removed hopefully as per https://github.com/whatwg/dom/issues/410.
https://bugzilla.mozilla.org/show_bug.cgi?id=1507849 suggests contentType
and the type internal slot (HTML vs XML) also need testing.
https://html.spec.whatwg.org/multipage/scripting.html#appropriate-template-contents-owner-document