Closed Bug 1874920 Opened 11 months ago Closed 10 months ago

Add "userContext" field to "browsingContext.Info" type

Categories

(Remote Protocol :: WebDriver BiDi, task, P2)

task
Points:
2

Tracking

(firefox124 fixed)

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 2 open bugs, )

Details

(Whiteboard: [webdriver:m10][wptsync upstream][webdriver:relnote])

Attachments

(5 files)

The PR adding support for user contexts also adds a new userContext field to browsingContext.Info, which is used for the payload of various events and commands of the browsingContext module.

Summary: Add userContext field to browsingContext.Info → Add "userContext" field to "browsingContext.Info" type

At the moment, the main way to retrieve the userContext for a BrowsingContext is to check the usercontextid attribute on the embedderElement. While this is fine for browsingContext.contextCreated and browsingContext.getTree, it won't work for browsingContext.contextDestroyed because the embedder element will no longer be defined on a deleted browsing context.

Either we can get the information to be stored on the browsing context or we will need to do something similar to what we did for navigable ids in Bug 1694390, ie keep track of a map between navigables and user context ids.

Olli, do you know if we could have the user context id information directly set on the browsing context, to avoid reading it from the embedderElement?

Flags: needinfo?(smaug)
Priority: -- → P2
Whiteboard: [webdriver:m10]

Where do we need this information? Can we get it from WindowGlobal's principal?

Flags: needinfo?(smaug)

(In reply to Olli Pettay [:smaug][bugs@pettay.fi] from comment #3)

Where do we need this information? Can we get it from WindowGlobal's principal?

From the parent process, but you're right this is available on the principal and this seems to work fine even when destroying the context. Thanks for the pointer!

Depends on: 1876721
Points: --- → 2
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

Depends on D200032

This should ensure good coverage of the user_context field

Attachment #9377449 - Attachment description: Bug 1874920 - [wdspec] Add tests for user context in frames and reference context → Bug 1874920 - [wdspec] Add various user_context tests for browsingContext.create
Blocks: 1878649
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ab9c141ac485 [bidi] Add userContext field to browsingContext.Info r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/0237b0c99f39 [wdspec] Add type hint parameter for context_created and context_destroyed user context tests r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/8a66a3b89c40 [wdspec] Always assert user context in assert_browsing_context r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/1c00d395406f [wdspec] Add various user_context tests for browsingContext.create r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/246fa8615ed5 [bidi] Avoid using internal user context id in bidi modules r=webdriver-reviewers,whimboo
Failed to create upstream wpt PR due to merge conflicts. This requires fixup from a wpt sync admin.
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Whiteboard: [webdriver:m10] → [webdriver:m10], [wptsync upstream error]
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/44418 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m10], [wptsync upstream error] → [webdriver:m10], [wptsync upstream]
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/24ad3719a4b9 [wpt PR 44418] - [Gecko Bug 1874920] [wdspec] Add type hint parameter for context_created and context_destroyed user context tests, a=testonly
Whiteboard: [webdriver:m10], [wptsync upstream] → [webdriver:m10][wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: