-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider removing document.origin
#410
Comments
WebKit does not currently support self.origin but we will likely implement it in the future. Once we support self.origin, we can start deprecating document.origin in WebKit but I suspect it is going to be a while until we actually remove it (if ever, depending on how much it beaks existing content). That said, I do not have an objection if people want to drop document.origin from the spec, I just think it is a bit early given that self.origin is not well deployed yet. Here are a few things that are not mentioned on this issue that would help decide:
|
Correct on both counts, as far as I know: |
I think we're just looking for feedback from other vendors at this point. If you're on board with the idea of migrating to To your questions:
|
Sure, I can commit to implementing self.origin in WebKit in the relatively short-term, given that other browsers are already implementing it and I like the idea. I also do not object to dropping document.origin from the spec given that this is a Blink/WebKit thing only and there is a better alternative available. |
As predicted the use counter in Blink is around ~0.09%: https://www.chromestatus.com/metrics/feature/timeline/popularity/1828 But we have no idea how much of that is just enumeration of the document's properties. @mikewest, what's our next move? |
If we remove document.origin, am I right that developers will have no way of setting the document's origin via JS? I believe self.origin is readonly while document.origin is not. |
Maybe you were thinking about |
Yeah. The numbers are higher than I'd hoped. I think there's a reasonable argument to be made that until Safari's change actually hits users (with Safari 11, I imagine?), that these pages are actually broken. @cdumez, it looks like If so, then it seems reasonable to try for deprecation. |
Oh I was thinking of document.domain, sorry. |
Self.origin is in Safari 11, yes. |
Is there any update here? We (Edge) have to decide if we're going to implement this or not. We're currently working on the other missing features. |
I think we would have liked that, but judging from the spike to 0.75% in https://www.chromestatus.com/metrics/feature/timeline/popularity/1828 it seems like it might be way too late. Given #410 (comment) we probably need to add some more tests for |
What do the uses look like? If it's |
Chatted with @dstorey and we think we can help the situation out by not implementing |
To summarise:
Considering the above I'd propose we:
|
Proposal sounds fine to me. |
Sounds reasonable to me, but someone will need to do the analysis to come up with a concrete deprecation plan according to our compat principles. We don't add deprecation messages without an approved removal timeframe anymore. But given the existing lack of interop, I suspect this may be as simple as showing some evidence that removal is unlikely to cause observable breakage (eg. spot check a handful of sites we find via HTTP archive) and giving removal a try. @mikewest perhaps you or someone on your team could do this? |
@foolip can you help with this? I'm happy to help with tests and the specification. |
Update: origin on WorkerGlobalScope and Window is now in code review. Will be in some future version of Edge (probably 18) |
Looks like we already had an Intent to Deprecate: |
@mikewest did usage analysis in https://groups.google.com/a/chromium.org/d/msg/blink-dev/CO52Bt15cuc/x_V5frbBCQAJ |
New Intent to Deprecate and Remove: |
Based on discussion in whatwg/html#2697 I think we should also remove document's origin concept, alongside the attribute. All the security checks we have are about origins of globals, not of documents. |
(Removing the concept might be harder than I thought, there's a fair number of dependencies on it at the moment that would have to be revamped. See also whatwg/html#2697 (comment).) |
… in cookie-helper.sub.js, a=testonly Automatic update from web-platform-testsReplace document.origin with self.origin in cookie-helper.sub.js (#12377) In anticipation of whatwg/dom#410 -- wpt-commits: 0e1ac363581d4bf0851a00a5563619bfef622fe4 wpt-pr: 12377
… in cookie-helper.sub.js, a=testonly Automatic update from web-platform-testsReplace document.origin with self.origin in cookie-helper.sub.js (#12377) In anticipation of whatwg/dom#410 -- wpt-commits: 0e1ac363581d4bf0851a00a5563619bfef622fe4 wpt-pr: 12377
… in cookie-helper.sub.js, a=testonly Automatic update from web-platform-testsReplace document.origin with self.origin in cookie-helper.sub.js (#12377) In anticipation of whatwg/dom#410 -- wpt-commits: 0e1ac363581d4bf0851a00a5563619bfef622fe4 wpt-pr: 12377 UltraBlame original commit: d27af016f4fc054d00c7cd424d7f6392362b62e8
… in cookie-helper.sub.js, a=testonly Automatic update from web-platform-testsReplace document.origin with self.origin in cookie-helper.sub.js (#12377) In anticipation of whatwg/dom#410 -- wpt-commits: 0e1ac363581d4bf0851a00a5563619bfef622fe4 wpt-pr: 12377 UltraBlame original commit: d27af016f4fc054d00c7cd424d7f6392362b62e8
… in cookie-helper.sub.js, a=testonly Automatic update from web-platform-testsReplace document.origin with self.origin in cookie-helper.sub.js (#12377) In anticipation of whatwg/dom#410 -- wpt-commits: 0e1ac363581d4bf0851a00a5563619bfef622fe4 wpt-pr: 12377 UltraBlame original commit: d27af016f4fc054d00c7cd424d7f6392362b62e8
document.origin is now only in Safari, and self.origin is in all engines. It's probably time to remove document.origin from the spec \o/ |
Use self.origin instead. (The document's origin internal concept is kept for now. Maybe at some point we can only use that of the relevant global object, but not now.) Tests: ... Closes #410.
Use self.origin instead. Tests: web-platform-tests/wpt#20995. Closes #410.
https://bugs.webkit.org/show_bug.cgi?id=205681 Reviewed by Geoffrey Garen. LayoutTests/imported/w3c: Merge upstream changes from: - web-platform-tests/wpt#20995 * web-platform-tests/dom/historical-expected.txt: * web-platform-tests/dom/historical.html: * web-platform-tests/dom/nodes/Document-constructor-svg.svg: * web-platform-tests/dom/nodes/Document-constructor-xml.xml: * web-platform-tests/dom/nodes/Document-constructor.html: * web-platform-tests/dom/nodes/Node-cloneNode.html: * web-platform-tests/html/browsers/windows/browsing-context.html: * web-platform-tests/html/dom/usvstring-reflection.https.html: Source/WebCore: Remove document.origin, which was replaced by self.origin as per: - whatwg/dom#815 - whatwg/dom#410 Gecko has never supported this and Blink has already dropped support for it. No new tests, updated existing tests. * dom/Document.cpp: (WebCore::Document::origin const): Deleted. * dom/Document.h: * dom/Document.idl: * dom/ScriptExecutionContext.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::printAccessDeniedMessage const): * workers/WorkerGlobalScope.h: * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::origin const): Deleted. * worklets/WorkletGlobalScope.h: Source/WebKitLegacy/mac: * DOM/DOMDocument.mm: (-[DOMDocument origin]): LayoutTests: * fast/dom/Document/document-constructor-expected.txt: * fast/dom/Document/document-constructor.html: * fast/dom/domparser-parsefromstring-origin-expected.txt: * fast/dom/domparser-parsefromstring-origin.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@254182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=205681 Reviewed by Geoffrey Garen. LayoutTests/imported/w3c: Merge upstream changes from: - web-platform-tests/wpt#20995 * web-platform-tests/dom/historical-expected.txt: * web-platform-tests/dom/historical.html: * web-platform-tests/dom/nodes/Document-constructor-svg.svg: * web-platform-tests/dom/nodes/Document-constructor-xml.xml: * web-platform-tests/dom/nodes/Document-constructor.html: * web-platform-tests/dom/nodes/Node-cloneNode.html: * web-platform-tests/html/browsers/windows/browsing-context.html: * web-platform-tests/html/dom/usvstring-reflection.https.html: Source/WebCore: Remove document.origin, which was replaced by self.origin as per: - whatwg/dom#815 - whatwg/dom#410 Gecko has never supported this and Blink has already dropped support for it. No new tests, updated existing tests. * dom/Document.cpp: (WebCore::Document::origin const): Deleted. * dom/Document.h: * dom/Document.idl: * dom/ScriptExecutionContext.h: * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::printAccessDeniedMessage const): * workers/WorkerGlobalScope.h: * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::origin const): Deleted. * worklets/WorkletGlobalScope.h: Source/WebKitLegacy/mac: * DOM/DOMDocument.mm: (-[DOMDocument origin]): LayoutTests: * fast/dom/Document/document-constructor-expected.txt: * fast/dom/Document/document-constructor.html: * fast/dom/domparser-parsefromstring-origin-expected.txt: * fast/dom/domparser-parsefromstring-origin.html: Canonical link: https://commits.webkit.org/219041@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
We have
self.origin
in HTML, present inside workers and documents. It seems redundant and confusing to suggest that there's a different origin for documents than for the global object they host. Perhaps we can simply remove this in favor of the property on the global?@bzbarsky seems to be on board with this notion. @cdumez, WDYT?
Edge hasn't implemented this yet, but perhaps @travisleithead has an opinion from a TAG/platformey perspective?
The text was updated successfully, but these errors were encountered: