mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
`<iframe>` and `<img>` tags share the same spec for several aspects of lazy-loading: how the `loading` attribute works, the "will lazy load element" steps, and a member for storing the lazy-load resumption steps. So let's share the implementation by using a base class. This mostly involves moving things around. However, we also change the `start_intersection_observing_a_lazy_loading_element()` method to take a LazyLoadingElement, and operate on one, instead of always casting to HTMLImageElement. We do unfortunately have to do some shenanigans to make the cast work, by adding a virtual function stub in DOM::Element.
46 KiB
46 KiB