constellation: Only return focused browsing contexts that exist. (#36330)

The webdriver server relies on the constellation to report which
browsing context is focused, and assumes that a focused context is ready
for interaction. However, new browsing contexts exist in a weird state
where they are not tracked by the constellation until the initial load
is complete, which leads to the constellation rejecting attempts to
navigate a browsing context right after it's created. These changes
ensure the constellation does not report a browsing context as focused
until it's actually created and ready for interaction.

Testing: Run `./mach test-wpt --product servodriver
tests/wpt/mozilla/tests/mozilla/DOMParser.html`, which now runs to
completion.
Fixes: #34551
Fixes: #36328

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-04-04 17:41:14 -04:00 committed by GitHub
parent ad95a602f8
commit 944e795606
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 3 deletions

View file

@ -510216,7 +510216,7 @@
[]
],
"servodriver.py": [
"bd16d7987e539a3325d88876982462ea1a3eb638",
"7121e1dafcc2d55ebc18bdf3e922ce9978b94ee1",
[]
],
"webkit.py": [

View file

@ -101,7 +101,7 @@ class ServoWebDriverBrowser(WebDriverBrowser):
# For some reason rustls does not like the certificate generated by the WPT tooling.
"--ignore-certificate-errors",
"--window-size", "800x600",
"data:,",
"about:blank",
]
ca_cert_path = server_config.ssl_config["ca_cert_path"]