LibWeb: Teach HTMLObjectElement to negotiate natural size with SVGs

We do this by generalizing the code previously used for SVGSVGBox into
something that can be used for NavigableViewportContainer as well.
This commit is contained in:
Andreas Kling 2024-11-26 12:30:11 +01:00 committed by Andreas Kling
commit 733c6b14ff
Notes: github-actions[bot] 2024-11-26 17:58:55 +00:00
8 changed files with 386 additions and 358 deletions

View file

@ -83,6 +83,14 @@ public:
[[nodiscard]] RefPtr<CSS::CSSStyleValue> width_style_value_from_attribute() const;
[[nodiscard]] RefPtr<CSS::CSSStyleValue> height_style_value_from_attribute() const;
struct NaturalMetrics {
Optional<CSSPixels> width;
Optional<CSSPixels> height;
Optional<CSSPixelFraction> aspect_ratio;
};
static NaturalMetrics negotiate_natural_metrics(SVGSVGElement const&);
private:
SVGSVGElement(DOM::Document&, DOM::QualifiedName);