<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>283784</bug_id>
          
          <creation_ts>2024-11-27 21:58:21 -0800</creation_ts>
          <short_desc>[WebDriver][BiDi] Implement the browsingContext.getTree method</short_desc>
          <delta_ts>2025-06-04 05:04:12 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebDriver</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>281943</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Lauro Moura">lmoura</reporter>
          <assigned_to name="Lauro Moura">lmoura</assigned_to>
          <cc>bburg</cc>
    
    <cc>hskupin</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2077994</commentid>
    <comment_count>0</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2024-11-27 21:58:21 -0800</bug_when>
    <thetext>https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree

Required by the `top_context` fixture, used in many BiDi tests in WPT repository: https://github.com/web-platform-tests/wpt/blob/master/webdriver/tests/support/fixtures.py#L484

```
@pytest_asyncio.fixture
async def top_context(bidi_session):
    contexts = await bidi_session.browsing_context.get_tree()
    return contexts[0]
```

In a nutshell:

- If the `parent` argument is null, return a list with all top-level navigables
- If `parent` is not null, run the &quot;get navigable info&quot; algorithm[1], to traverse the navigable tree under `parent`, collecting information.

[1] https://w3c.github.io/webdriver-bidi/#get-the-navigable-info</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2077996</commentid>
    <comment_count>1</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2024-11-27 22:01:13 -0800</bug_when>
    <thetext>Given this is one of the many methods in the &quot;browsingContext&quot; module, add this one as a blocker for the main one, which can act as a meta bug.

(In the log method at bug271956, the initial implementation went in the main bug as it&apos;s a single event, with futher updates blocked by it)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2079322</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-12-04 22:38:52 -0800</bug_when>
    <thetext>&lt;rdar://problem/140959523&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2119507</commentid>
    <comment_count>3</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2025-05-23 21:46:53 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/45875</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2121645</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-06-04 05:04:08 -0700</bug_when>
    <thetext>Committed 295805@main (09e8854c8548): &lt;https://commits.webkit.org/295805@main&gt;

Reviewed commits have been landed. Closing PR #45875 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>