Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 09e8854c854800fa8640edd36be6ab1ab1ec0c38
https://github.com/WebKit/WebKit/commit/09e8854c854800fa8640edd36be6ab1ab1ec0c38
Author: Lauro Moura <[email protected]>
Date: 2025-06-04 (Wed, 04 Jun 2025)
Changed paths:
M
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py
M Source/JavaScriptCore/inspector/scripts/codegen/models.py
M
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result
M
Source/JavaScriptCore/inspector/scripts/tests/type-declaration-object-type.json
M Source/WebKit/UIProcess/Automation/BidiBrowsingContextAgent.cpp
M Source/WebKit/UIProcess/Automation/BidiBrowsingContextAgent.h
M Source/WebKit/UIProcess/Automation/WebAutomationSession.h
M Source/WebKit/UIProcess/Automation/protocol/BidiBrowsingContext.json
M WebDriverTests/TestExpectations.json
Log Message:
-----------
[WebDriver][BiDi] Implement the browsingContext.getTree method
https://bugs.webkit.org/show_bug.cgi?id=283784
Reviewed by BJ Burg.
Add support for the root and maxDepth parameter. The root selection is
done by splitting the steps of selecting the navigables to traverse
and actually traversing them.
Also, fix the presence of some fields in the returned payload. In the
current version of the spec, only the "parent" field is actually
optional, while the other fields must be present, even if they're
null.
In order to support the latter, this commit also adds support for a new
boolean field in object types declared in the automation protocol:
"nullable". This field generates a "setNull..." method that sets the
related key in the underlying objet with JSON::Value::null(). That way
we can keep the original setter receiving the original types like
Ref<...>.
Originally, the generated inspector code also restricted the
non-optional fields to be set at construction time, with the nested
`Builder` class wrapping the generated type constructor. This commit
also exposes the normal setters for non-optional-but-nullable fields,
so we can set these fields later if needed. For example:
auto obj = Protocol::Module::Object::create()
.setRequiredField()
.setNullChildren() // "children" is a "nullable" member
.release();
...
obj.setChildren(childrenArray);
This "nullable" tag contrasts with "optional" in the sense that with
optional, the key might be missing from the final object.
Note that this doesn't cover nullable command parameters nor support for
processing of incoming frontend data with nullable fields, as we only
need to support outbound data from the backend (i.e. command return
values) for now.
*
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
* Generate new setter models in Builder and actual Model classes.
* Source/JavaScriptCore/inspector/scripts/codegen/models.py:
* Add "nullable" property to type declarations.
(Protocol.parse_type_member):
(TypeMember.__init__):
*
Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* Rebaseline results.
*
Source/JavaScriptCore/inspector/scripts/tests/type-declaration-object-type.json:
* Add testcase declaration.
* Source/WebKit/UIProcess/Automation/BidiBrowsingContextAgent.cpp:
(WebKit::BidiBrowsingContextAgent::getBrowsingContextID const): Helper
added.
(WebKit::BidiBrowsingContextAgent::getNavigableInfo): Added.
(WebKit::BidiBrowsingContextAgent::getNextTree): Added.
(WebKit::toOptionalUint): Added.
(WebKit::BidiBrowsingContextAgent::getTree): Add support for maxDepth,
root, and actually traverse the navigable trees.
* Source/WebKit/UIProcess/Automation/BidiBrowsingContextAgent.h: Declare
new methods and types.
* Source/WebKit/UIProcess/Automation/WebAutomationSession.h: Make
handleForWebFrame* methods public as the BrowsingContext agent uses
it.
* Source/WebKit/UIProcess/Automation/protocol/BidiBrowsingContext.json:
Fix optional and nullable fields for getTree parameters.
* WebDriverTests/TestExpectations.json: Gardening results with this
patch.
Canonical link: https://commits.webkit.org/295805@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes