mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
ad95a602f8
commit
944e795606
3 changed files with 11 additions and 3 deletions
|
@ -1253,7 +1253,15 @@ where
|
|||
self.handle_exit();
|
||||
},
|
||||
EmbedderToConstellationMessage::GetFocusTopLevelBrowsingContext(resp_chan) => {
|
||||
let _ = resp_chan.send(self.webviews.focused_webview().map(|(id, _)| id));
|
||||
let focused_context = self
|
||||
.webviews
|
||||
.focused_webview()
|
||||
.filter(|(_, webview)| {
|
||||
self.browsing_contexts
|
||||
.contains_key(&webview.focused_browsing_context_id)
|
||||
})
|
||||
.map(|(id, _)| id);
|
||||
let _ = resp_chan.send(focused_context);
|
||||
},
|
||||
// Perform a navigation previously requested by script, if approved by the embedder.
|
||||
// If there is already a pending page (self.pending_changes), it will not be overridden;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue