mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
CanGc fixes through focusevent.rs & hashchangeevent.rs (#33921)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
This commit is contained in:
parent
d0d02cd56c
commit
a57b6a3f79
20 changed files with 140 additions and 69 deletions
|
@ -634,8 +634,8 @@ impl HTMLFormElementMethods for HTMLFormElement {
|
|||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-form-reportvalidity>
|
||||
fn ReportValidity(&self) -> bool {
|
||||
self.interactive_validation().is_ok()
|
||||
fn ReportValidity(&self, can_gc: CanGc) -> bool {
|
||||
self.interactive_validation(can_gc).is_ok()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -733,7 +733,7 @@ impl HTMLFormElement {
|
|||
// Step 6.2
|
||||
self.firing_submission_events.set(true);
|
||||
// Step 6.3
|
||||
if !submitter.no_validate(self) && self.interactive_validation().is_err() {
|
||||
if !submitter.no_validate(self) && self.interactive_validation(can_gc).is_err() {
|
||||
self.firing_submission_events.set(false);
|
||||
return;
|
||||
}
|
||||
|
@ -1029,7 +1029,7 @@ impl HTMLFormElement {
|
|||
|
||||
/// Interactively validate the constraints of form elements
|
||||
/// <https://html.spec.whatwg.org/multipage/#interactively-validate-the-constraints>
|
||||
fn interactive_validation(&self) -> Result<(), ()> {
|
||||
fn interactive_validation(&self, can_gc: CanGc) -> Result<(), ()> {
|
||||
// Step 1-2
|
||||
let unhandled_invalid_controls = match self.static_validation() {
|
||||
Ok(()) => return Ok(()),
|
||||
|
@ -1045,7 +1045,7 @@ impl HTMLFormElement {
|
|||
}
|
||||
if first {
|
||||
if let Some(html_elem) = elem.downcast::<HTMLElement>() {
|
||||
html_elem.Focus();
|
||||
html_elem.Focus(can_gc);
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue