mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
CanGc fixes from eventtarget.rs (#33973)
Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
This commit is contained in:
parent
7b392db02f
commit
7fbd2a521e
23 changed files with 108 additions and 81 deletions
|
@ -35,11 +35,11 @@ pub trait Validatable {
|
|||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#check-validity-steps>
|
||||
fn check_validity(&self) -> bool {
|
||||
fn check_validity(&self, can_gc: CanGc) -> bool {
|
||||
if self.is_instance_validatable() && !self.satisfies_constraints() {
|
||||
self.as_element()
|
||||
.upcast::<EventTarget>()
|
||||
.fire_cancelable_event(atom!("invalid"));
|
||||
.fire_cancelable_event(atom!("invalid"), can_gc);
|
||||
false
|
||||
} else {
|
||||
true
|
||||
|
@ -61,7 +61,7 @@ pub trait Validatable {
|
|||
let event = self
|
||||
.as_element()
|
||||
.upcast::<EventTarget>()
|
||||
.fire_cancelable_event(atom!("invalid"));
|
||||
.fire_cancelable_event(atom!("invalid"), can_gc);
|
||||
|
||||
// Step 1.2.
|
||||
if !event.DefaultPrevented() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue