Closed Bug 1475599 Opened 7 years ago Closed 1 year ago

Implement Cookie-Store API

Categories

(Core :: DOM: Core & HTML, enhancement, P5)

enhancement

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: baku, Assigned: baku)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-complete, parity-chrome, parity-safari)

Attachments

(12 files, 1 obsolete file)

106.26 KB, patch
Details | Diff | Splinter Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
An asynchronous Javascript cookies API for documents and workers
Attached patch patch (obsolete) — Splinter Review
This is just a proof of concept. It works, but many details are missing: . the API is not exposed to workers . not all the WPTs pass I don't have time to work on this, but if somebody wants to continue the development, this patch is a good starting point. I can also help or be mentor.
Attached patch cookie.patchSplinter Review
Attachment #8991974 - Attachment is obsolete: true
Component: DOM → DOM: Core & HTML
Assignee: nobody → amarchesini

Any eta on this?

It would be great if this could be implemented in Firefox. The API is much nicer to work with than document.cookie, and would allow many developers to remove third party dependencies that they use purely for nice cookie management.

Assignee: amarchesini → nobody
Severity: normal → S3

FWIW, having an async, far cleaner API for cookies is nice DX and may benefit performance, but I think it's worth calling out that one of the key additions is the "Monitoring Cookies" feature.

In order to achieve this in a polyfill—as per Keith Cirkel's comment—involves using postMessage and BroadcastChannel, which could conflict with other uses of those APIs and would add significant weight to the polyfill.

I'm not suggesting the Monitoring Cookies feature should be implemented in lieu of the rest of the API, I'm just trying to add weight to the need for the overall Cookie Store API to be implemented given that feature is a significant challenge to polyfill.

WebKit appear to have made significant progress on their implementation now, only one bug is outstanding: https://bugs.webkit.org/show_bug.cgi?id=258504 so if this make a Safari release shortly, this would leave Firefox being the only browser without support.

Assignee: nobody → amarchesini
Status: NEW → ASSIGNED
Attachment #9410012 - Attachment description: WIP: Bug 1475599 - part 1 - CookieStore API - WebIDL, =edgul → Bug 1475599 - part 1 - CookieStore API - WebIDL, r?edgul,smaug
Attachment #9410013 - Attachment description: Bug 1475599 - part 2 - CookieStore API - IPDL, r?edgul → Bug 1475599 - part 2 - CookieStore API - IPDL, r?edgul,smaug

The following patch is waiting for review from an inactive reviewer:

ID Title Author Reviewer Status
D215146 Bug 1475599 - part 3 - CookieStore API - WPT, r?edgul baku edgul: Back Jul 8, 2024

:baku, could you please find another reviewer?

For more information, please visit BugBot documentation.

Flags: needinfo?(amarchesini)
Flags: needinfo?(amarchesini)
Attachment #9414620 - Attachment description: Bug 1475599 - part 7 - CookieStore API - Expose `isPartitioned` to nsICookieManager::AddNative, r?edgul → Bug 1475599 - part 6 - CookieStore API - Expose `isPartitioned` to nsICookieManager::AddNative, r?edgul
Attachment #9414619 - Attachment description: Bug 1475599 - part 6 - CookieStore API - e10s support, r?smaug → Bug 1475599 - part 8 - CookieStore API - e10s support, r?smaug
Attachment #9414881 - Attachment description: WIP: Bug 1475599 - part 8 - CookieStore API - Extra security for cookie propagation child to parent, → WIP: Bug 1475599 - part 9 - CookieStore API - Extra security for cookie propagation child to parent,
Attachment #9414881 - Attachment description: WIP: Bug 1475599 - part 9 - CookieStore API - Extra security for cookie propagation child to parent, → Bug 1475599 - part 9 - CookieStore API - Extra security for cookie propagation child to parent, r?tschuster
Attachment #9421063 - Attachment description: WIP: Bug 1475599 - part 10 - CookieStore API - CHIP implementation shared between Document and CookieStore → Bug 1475599 - part 10 - CookieStore API - CHIP implementation shared between Document and CookieStore
Attachment #9421063 - Attachment description: Bug 1475599 - part 10 - CookieStore API - CHIP implementation shared between Document and CookieStore → WIP: Bug 1475599 - part 10 - CookieStore API - CHIP implementation shared between Document and CookieStore
Attachment #9421063 - Attachment description: WIP: Bug 1475599 - part 10 - CookieStore API - CHIP implementation shared between Document and CookieStore → Bug 1475599 - part 10 - CookieStore API - CHIP implementation shared between Document and CookieStore, r?valentin
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9c8b6e35bf3f part 1 - CookieStore API - WebIDL, r=smaug,edgul https://hg.mozilla.org/integration/autoland/rev/0868fb4018a7 part 2 - CookieStore API - IPDL, r=edgul,webidl,smaug https://hg.mozilla.org/integration/autoland/rev/4063d0c74231 part 3 - CookieStore API - WPT, r=edgul https://hg.mozilla.org/integration/autoland/rev/f279f023c340 part 4 - CookieStore API - bfcache tests, r=smaug https://hg.mozilla.org/integration/autoland/rev/fc19677480ad part 5 - CookieStore API - cookie notifications in the content-process, r=smaug,cookie-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/0cfe4b34b57a part 6 - CookieStore API - Expose `isPartitioned` to nsICookieManager::AddNative, r=edgul,cookie-reviewers https://hg.mozilla.org/integration/autoland/rev/fc3b4c5ee4b2 part 7 - CookieStore API - Expose `operationID` to nsICookieManager::{AddNative,RemoveNative} and nsICookieNotifications, r=smaug,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/30d5dfedf252 part 8 - CookieStore API - e10s support, r=smaug,cookie-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/2d925ea3da19 part 9 - CookieStore API - Extra security for cookie propagation child to parent, r=tschuster,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/01c2bc6d727a part 10 - CookieStore API - CHIP implementation shared between Document and CookieStore, r=cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/51aa424e5ec9 part 11 - CookieStore API - Extra tests for document URLs with fragments, r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/48079 for changes under testing/web-platform/tests

Backed out for causing mochitest failures on browser_script_command_execute_basic.js.

[task 2024-09-10T20:36:05.960Z] 20:36:05     INFO - TEST-PASS | devtools/shared/commands/script/tests/browser_script_command_execute_basic.js | property 'input' for 'typeof document.cookie' - 
[task 2024-09-10T20:36:05.960Z] 20:36:05     INFO - Buffered messages finished
[task 2024-09-10T20:36:05.961Z] 20:36:05     INFO - TEST-UNEXPECTED-FAIL | devtools/shared/commands/script/tests/browser_script_command_execute_basic.js | property 'result' for 'typeof document.cookie' - Got [object Object], expected "string"
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - Stack trace:
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:test_is:1625
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - chrome://mochitests/content/browser/devtools/shared/commands/script/tests/head.js:checkValue:38
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - chrome://mochitests/content/browser/devtools/shared/commands/script/tests/head.js:checkObject:20
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - chrome://mochitests/content/browser/devtools/shared/commands/script/tests/browser_script_command_execute_basic.js:doEagerEvalDOMGetters:956
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - chrome://mochitests/content/browser/devtools/shared/commands/script/tests/browser_script_command_execute_basic.js:null:103
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:handleTask:1145
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1217
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1358
[task 2024-09-10T20:36:05.962Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1134
[task 2024-09-10T20:36:05.963Z] 20:36:05     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1058
[task 2024-09-10T20:36:05.963Z] 20:36:05     INFO - Not taking screenshot here: see the one that was previously logged
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - TEST-UNEXPECTED-FAIL | devtools/shared/commands/script/tests/browser_script_command_execute_basic.js | no eval exception - 
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - Stack trace:
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:test_ok:1597
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - chrome://mochitests/content/browser/devtools/shared/commands/script/tests/browser_script_command_execute_basic.js:doEagerEvalDOMGetters:965
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - chrome://mochitests/content/browser/devtools/shared/commands/script/tests/browser_script_command_execute_basic.js:null:103
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:handleTask:1145
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1217
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1358
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1134
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1058
[task 2024-09-10T20:36:05.965Z] 20:36:05     INFO - TEST-PASS | devtools/shared/commands/script/tests/browser_script_command_execute_basic.js | no helper result - 
Flags: needinfo?(amarchesini)
Upstream PR was closed without merging
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2fc9a3d0ad8b part 1 - CookieStore API - WebIDL, r=smaug,edgul https://hg.mozilla.org/integration/autoland/rev/cc3c39aa8fb8 part 2 - CookieStore API - IPDL, r=edgul,webidl,smaug https://hg.mozilla.org/integration/autoland/rev/7eccbaa8e62e part 3 - CookieStore API - WPT, r=edgul https://hg.mozilla.org/integration/autoland/rev/d3c7729a1972 part 4 - CookieStore API - bfcache tests, r=smaug https://hg.mozilla.org/integration/autoland/rev/ef2cdfb059af part 5 - CookieStore API - cookie notifications in the content-process, r=smaug,cookie-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/cd8cc80dc7e9 part 6 - CookieStore API - Expose `isPartitioned` to nsICookieManager::AddNative, r=edgul,cookie-reviewers https://hg.mozilla.org/integration/autoland/rev/a63a5bcb0524 part 7 - CookieStore API - Expose `operationID` to nsICookieManager::{AddNative,RemoveNative} and nsICookieNotifications, r=smaug,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/0d57b435d872 part 8 - CookieStore API - e10s support, r=smaug,cookie-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/8620daea37ad part 9 - CookieStore API - Extra security for cookie propagation child to parent, r=tschuster,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/7e736b5732c1 part 10 - CookieStore API - CHIP implementation shared between Document and CookieStore, r=cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/74d0efb3b0d1 part 11 - CookieStore API - Extra tests for document URLs with fragments, r=smaug

Backed out for causing wpt failures on change_eventhandler_in_bfcache.https.window.html.

[task 2024-09-11T20:18:34.542Z] 20:18:34     INFO - TEST-PASS | /workers/semantics/run-a-worker/003.html | shared 
[task 2024-09-11T20:18:34.542Z] 20:18:34     INFO - TEST-UNEXPECTED-TIMEOUT | /_mozilla/cookie-store/change_eventhandler_in_bfcache.https.window.html | CookieStore queues events when bfcached - Test timed out
[task 2024-09-11T20:18:34.633Z] 20:18:34     INFO - TEST-UNEXPECTED-TIMEOUT | /_mozilla/cookie-store/change_eventhandler_in_bfcache.https.window.html | expected OK
[task 2024-09-11T20:18:34.633Z] 20:18:34     INFO - TEST-INFO took 40768ms
[task 2024-09-11T20:18:34.634Z] 20:18:34     INFO - Restarting browser for new test group
[task 2024-09-11T20:18:35.033Z] 20:18:35     INFO - STDOUT: cleanup aborted: Unable to remount device
[task 2024-09-11T20:18:35.188Z] 20:18:35     INFO - STDOUT: cleanup aborted: Unable to remount device
[task 2024-09-11T20:18:35.189Z] 20:18:35     INFO - Closing logging queue
[task 2024-09-11T20:18:35.190Z] 20:18:35     INFO - queue closed
[task 2024-09-11T20:18:35.205Z] 20:18:35     INFO - Setting up ssl
[task 2024-09-11T20:18:35.453Z] 20:18:35     INFO - certutil | b''
[task 2024-09-11T20:18:35.585Z] 20:18:35     INFO - certutil | b''
[task 2024-09-11T20:18:35.600Z] 20:18:35     INFO - certutil | b'\nCertificate Nickname                                         Trust Attributes\n                                                             SSL,S/MIME,JAR/XPI\n\nweb-platform-tests                                           CT,, \n'
[task 2024-09-11T20:18:36.378Z] 20:18:36     INFO - adb Granting important runtime permissions to org.mozilla.geckoview.test_runner
[task 2024-09-11T20:18:37.632Z] 20:18:37     INFO - adb launch_application: am start -W -n org.mozilla.geckoview.test_runner/org.mozilla.geckoview.test_runner.TestRunnerActivity -a android.intent.action.MAIN --es env0 MOZ_CRASHREPORTER=1 --es env1 MOZ_CRASHREPORTER_NO_REPORT=1 --es env2 MOZ_CRASHREPORTER_SHUTDOWN=1 --es env3 MOZ_HIDE_RESULTS_TABLE=1 --es env4 MOZ_IN_AUTOMATION=1 --es env5 MOZ_LOG=signaling:3,mtransport:4,DataChannel:4,jsep:4 --es env6 R_LOG_LEVEL=6 --es env7 R_LOG_DESTINATION=stderr --es env8 R_LOG_VERBOSE=1 --es env9 MOZ_PROCESS_LOG=/tmp/tmpj1vpytxypidlog --es env10 MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 --es arg0 -no-remote --es arg1 -profile --es arg2 /data/local/tmp/test_root/profile --es arg3 --marionette --es arg4 about:blank
[task 2024-09-11T20:18:39.246Z] 20:18:39     INFO - Starting runner
[task 2024-09-11T20:18:40.114Z] 20:18:40     INFO - TEST-START | /_mozilla/mathml/disabled/dynamic-math-tree-001.html
Flags: needinfo?(amarchesini)
Flags: needinfo?(amarchesini)
Upstream PR was closed without merging
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d55b6525d7b2 part 1 - CookieStore API - WebIDL, r=smaug,edgul https://hg.mozilla.org/integration/autoland/rev/5e078f860dfb part 2 - CookieStore API - IPDL, r=edgul,webidl,smaug https://hg.mozilla.org/integration/autoland/rev/bbf48c250215 part 3 - CookieStore API - WPT, r=edgul https://hg.mozilla.org/integration/autoland/rev/6cd4304de43b part 4 - CookieStore API - bfcache tests, r=smaug https://hg.mozilla.org/integration/autoland/rev/6017acfcb2bc part 5 - CookieStore API - cookie notifications in the content-process, r=smaug,cookie-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/d2c278cfa955 part 6 - CookieStore API - Expose `isPartitioned` to nsICookieManager::AddNative, r=edgul,cookie-reviewers https://hg.mozilla.org/integration/autoland/rev/c6e20b939a21 part 7 - CookieStore API - Expose `operationID` to nsICookieManager::{AddNative,RemoveNative} and nsICookieNotifications, r=smaug,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/2081d42e6ccd part 8 - CookieStore API - e10s support, r=smaug,cookie-reviewers,timhuang https://hg.mozilla.org/integration/autoland/rev/2fbb65a885f6 part 9 - CookieStore API - Extra security for cookie propagation child to parent, r=tschuster,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/6a36e7a65173 part 10 - CookieStore API - CHIP implementation shared between Document and CookieStore, r=cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/8283b857e25f part 11 - CookieStore API - Extra tests for document URLs with fragments, r=smaug
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(amarchesini)
Regressions: 1920534
Regressions: 1934330
Depends on: 1918643
Blocks: 1918643
No longer depends on: 1918643
Blocks: cookie-store
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: