Bug 302336

Summary: [WebDriver][BiDi] Some browsing context events are sending empty context handle field
Product: WebKit Reporter: Lauro Moura <lmoura>
Component: WebDriverAssignee: Lauro Moura <lmoura>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 281932    

Lauro Moura
Reported 2025-11-11 10:13:28 PST
Currently, we send some events like `dom_content_loaded` with an empty `context` field. This happens because we use `handleForWebFrameProxy(frame)` for this field, which returns an empty string for frames that happens to be the main frame. This is related to the original scheme from WebDriver classic of keeping track of the top level contexts, etc. For such main frames, the `context` field must have its WebPageProxy's handle (i.e. "page-UUID"), returned through `handleForWebPageProxy(page)`. Patch incoming.
Attachments
Lauro Moura
Comment 1 2025-11-11 10:15:40 PST
Example of tests affected: FAILED WebDriverTests/imported/w3c/webdriver/tests/bidi/browsing_context/dom_content_loaded/dom_content_loaded.py::test_subscribe - AssertionError FAILED WebDriverTests/imported/w3c/webdriver/tests/bidi/browsing_context/dom_content_loaded/dom_content_loaded.py::test_timestamp - AssertionError FAILED WebDriverTests/imported/w3c/webdriver/tests/bidi/browsing_context/dom_content_loaded/dom_content_loaded.py::test_early_same_document_navigation - AssertionError FAILED WebDriverTests/imported/w3c/webdriver/tests/bidi/browsing_context/dom_content_loaded/dom_content_loaded.py::test_page_with_base_tag - AssertionError Note that these are currently skipped in `main`, as I'm unskipping/gardening them in bug302107
Lauro Moura
Comment 2 2025-11-11 10:52:06 PST
EWS
Comment 3 2025-11-16 15:04:48 PST
Committed 303095@main (6aa3d2c0520d): <https://commits.webkit.org/303095@main> Reviewed commits have been landed. Closing PR #53752 and removing active labels.
Radar WebKit Bug Importer
Comment 4 2025-11-16 15:05:13 PST
Note You need to log in before you can comment on or make changes to this bug.