mirror of
https://github.com/servo/servo.git
synced 2025-07-15 19:33:46 +01:00
script_thread: handle_unfocus_msg ignores unfocus request of top-level document (#37955)
`ScriptThread::handle_unfocus_msg` ignores unfocus request of top-level document Fix errors in webdriver navigation commands, which may request unfocus on top-level documents. Testing: `tests/wpt/meta/webdriver/tests/classic/back/back.py` `tests/wpt/meta/webdriver/tests/classic/forward/forward.py` Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
parent
75c13f1422
commit
edfacec9c8
1 changed files with 4 additions and 4 deletions
|
@ -1217,10 +1217,10 @@ impl Document {
|
||||||
/// document's container is removed from the top-level browsing context's
|
/// document's container is removed from the top-level browsing context's
|
||||||
/// focus chain (not considering system focus).
|
/// focus chain (not considering system focus).
|
||||||
pub(crate) fn handle_container_unfocus(&self, can_gc: CanGc) {
|
pub(crate) fn handle_container_unfocus(&self, can_gc: CanGc) {
|
||||||
assert!(
|
if self.window().parent_info().is_none() {
|
||||||
self.window().parent_info().is_some(),
|
warn!("Top-level document cannot be unfocused");
|
||||||
"top-level document cannot be unfocused",
|
return;
|
||||||
);
|
}
|
||||||
|
|
||||||
// Since this method is called from an event loop, there mustn't be
|
// Since this method is called from an event loop, there mustn't be
|
||||||
// an in-progress focus transaction
|
// an in-progress focus transaction
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue