Skip to content

Inline dispatch_load_event and dispatch_error_event found in htmlscriptelement.rs #43280

@Gae24

Description

@Gae24

Currently, both dispatch_load_event and dispatch_error_event are just wrappers around dispatch_event.

fn dispatch_event(
&self,
type_: Atom,
bubbles: EventBubbles,
cancelable: EventCancelable,
can_gc: CanGc,
) -> bool {
let window = self.owner_window();
let event = Event::new(window.upcast(), type_, bubbles, cancelable, can_gc);
event.fire(self.upcast(), can_gc)
}

They both call it with EventBubbles::DoesNotBubble, EventCancelable::NotCancelable and the respective Atom, we should directly call dispatch_event and pass only the required Atom.

Metadata

Metadata

Assignees

Labels

A-content/scriptRelated to the script threadC-assignedThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.I-cleanupNo impact; the issue is one of maintainability or tidiness.good first issueNewcomer-friendly issues.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions