Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 45357243b63d563a66741b70de401ff70ea6eadd
      
https://github.com/WebKit/WebKit/commit/45357243b63d563a66741b70de401ff70ea6eadd
  Author: Serge Deh <[email protected]>
  Date:   2026-04-20 (Mon, 20 Apr 2026)

  Changed paths:
    M Source/WebKit/UIProcess/Automation/BidiScriptAgent.cpp
    M Source/WebKit/UIProcess/Automation/BidiScriptAgent.h
    M Source/WebKit/UIProcess/Automation/protocol/BidiScript.json
    M WebDriverTests/TestExpectations.json

  Log Message:
  -----------
  [WebDriver BiDi] Add foundation implementation for script.disown command
https://bugs.webkit.org/show_bug.cgi?id=288059

Reviewed by BJ Burg.

This patch adds a foundation implementation of the script.disown command that 
validates
parameters but returns NotImplemented, as the core functionality (WebProcess 
forwarding
to release JavaScript objects) requires resultOwnership="root" support (bug 
288059).

The implementation provides:
- Parameter validation for handles array and target (realm/context)
- Target resolution using parseRealmIdentifier and browsingContextForRealm
- Proper JSON field presence detection using find() to avoid getString returning
  empty strings for missing keys
- Clean NotImplemented return without side effects

Implementation details:
- parseRealmIdentifier() validates and parses realm ID strings 
("realm-<number>")
  into strongly typed RealmIdentifier values
- browsingContextForRealm() looks up the browsing context for a RealmIdentifier
  via m_activeRealms, keeping realm IDs as opaque identifiers
- Realm validation occurs early, even when a browsing context is also provided
- All validation occurs before the NotImplemented return
- No state mutation to maintain consistency with "not implemented" semantics

* Source/WebKit/UIProcess/Automation/protocol/BidiScript.json:
Add bug field to script.disown command.

* Source/WebKit/UIProcess/Automation/BidiScriptAgent.h:
Add disown, parseRealmIdentifier, and browsingContextForRealm declarations.

* Source/WebKit/UIProcess/Automation/BidiScriptAgent.cpp:
(WebKit::BidiScriptAgent::disown): Implement parameter validation, return 
NotImplemented.
(WebKit::BidiScriptAgent::parseRealmIdentifier): Parse realm ID strings into
strongly typed RealmIdentifier values.
(WebKit::BidiScriptAgent::browsingContextForRealm): Look up browsing context for
a RealmIdentifier via the active realms registry.

* WebDriverTests/TestExpectations.json:
Update disown/invalid.py test expectations to reflect passing subtests.

Canonical link: https://commits.webkit.org/311598@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to