CanGc fixes through focusevent.rs & hashchangeevent.rs (#33921)

Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
This commit is contained in:
tanishka 2024-10-20 13:35:11 +05:30 committed by GitHub
parent d0d02cd56c
commit a57b6a3f79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 140 additions and 69 deletions

View file

@ -677,6 +677,7 @@ pub fn handle_focus_element(
pipeline: PipelineId,
element_id: String,
reply: IpcSender<Result<(), ErrorStatus>>,
can_gc: CanGc,
) {
reply
.send(
@ -684,7 +685,7 @@ pub fn handle_focus_element(
match node.downcast::<HTMLElement>() {
Some(element) => {
// Need a way to find if this actually succeeded
element.Focus();
element.Focus(can_gc);
Ok(())
},
None => Err(ErrorStatus::UnknownError),
@ -1072,6 +1073,7 @@ pub fn handle_element_click(
pipeline: PipelineId,
element_id: String,
reply: IpcSender<Result<Option<String>, ErrorStatus>>,
can_gc: CanGc,
) {
reply
.send(
@ -1122,7 +1124,7 @@ pub fn handle_element_click(
// Step 8.5
match parent_node.downcast::<HTMLElement>() {
Some(html_element) => html_element.Focus(),
Some(html_element) => html_element.Focus(can_gc),
None => return Err(ErrorStatus::UnknownError),
}