1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:45:07 +00:00

LibWeb: Wait for media candidates without endlessly queueing microtasks

Rather than queueing microtasks ad nauseam to check if a media element
has a new source candidate, let the media element tell us when it might
have a new child to inspect. This removes endless CPU churn in cases
where there is never a candidate that we can play.
This commit is contained in:
Timothy Flynn 2023-05-22 07:41:34 -04:00 committed by Andreas Kling
parent 76aa17be86
commit b865277275
2 changed files with 23 additions and 6 deletions

View file

@ -93,6 +93,7 @@ protected:
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
virtual void did_remove_attribute(DeprecatedFlyString const&) override;
virtual void removed_from(DOM::Node*) override;
virtual void children_changed() override;
// Override in subclasses to handle implementation-specific behavior when the element state changes
// to playing or paused, e.g. to start/stop play timers.