mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
fix crash occurs when the focus element is adopted (#36608)
fix crash occurs when the focus element is adopted. Testing: wpt dom/nodes/insertion-removing-steps/blur-event.window.html not crash Fixes: #36607 #32972 --------- Signed-off-by: kongbai1996 <1782765876@qq.com>
This commit is contained in:
parent
b6a89ae408
commit
bab788f5d5
4 changed files with 45 additions and 3 deletions
|
@ -1180,7 +1180,9 @@ impl Document {
|
|||
let node = elem.upcast::<Node>();
|
||||
elem.set_focus_state(false);
|
||||
// FIXME: pass appropriate relatedTarget
|
||||
self.fire_focus_event(FocusEventType::Blur, node, None, can_gc);
|
||||
if node.is_connected() {
|
||||
self.fire_focus_event(FocusEventType::Blur, node, None, can_gc);
|
||||
}
|
||||
|
||||
// Notify the embedder to hide the input method.
|
||||
if elem.input_method_type().is_some() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue