LibWeb: Use dimension image source for images

Fixes tiny images on Wikipedia
This commit is contained in:
Chase Knowlden
2026-02-11 20:41:13 -05:00
committed by Sam Atkins
parent 31cbe2061a
commit b8f31179b2
Notes: github-actions[bot] 2026-02-13 10:44:04 +00:00
5 changed files with 83 additions and 14 deletions

View File

@@ -92,6 +92,10 @@ public:
void set_source_set(SourceSet);
// https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element:dimension-attribute-source
DOM::Element const& dimension_attribute_source() const;
void set_dimension_attribute_source(DOM::Element const*);
ImageRequest& current_request() { return *m_current_request; }
ImageRequest const& current_request() const { return *m_current_request; }
@@ -168,6 +172,10 @@ private:
CSSPixelSize m_last_seen_viewport_size;
// https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element:dimension-attribute-source
// Each img element has a dimension attribute source, which must initially be the img element itself.
GC::Ptr<DOM::Element const> m_dimension_attribute_source;
u64 m_update_the_image_data_count { 0 };
};