WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
192665
Resolved value for the 'width' and 'height' properties on SVG <rect>, <image>, <svg> and <foreignObject> should be the "used value"
https://bugs.webkit.org/show_bug.cgi?id=192665
Summary
Resolved value for the 'width' and 'height' properties on SVG <rect>, <image>...
Fredrik Söderquist
Reported
2018-12-13 07:58:27 PST
As defined by CSSOM:
https://drafts.csswg.org/cssom/#resolved-values
Simple testcase can be found in bugs.chromium.org/p/chromium/issues/detail?id=772707 (and hopefully soonish in WPT).
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-07-01 16:15:15 PDT
<
rdar://problem/96320059
>
Ahmad Saleem
Comment 2
2026-01-24 23:01:29 PST
template<CSSPropertyID propertyID> struct PreferredSizeSharedAdaptor { template<typename F> decltype(auto) computedValue(ExtractorState& state, const PreferredSize& value, F&& functor) const { auto sizingBox = [](auto& renderer) -> LayoutRect { auto* box = dynamicDowncast<RenderBox>(renderer); if (!box) return LayoutRect(); return box->style().boxSizing() == BoxSizing::BorderBox ? box->borderBoxRect() : box->computedCSSContentBoxRect(); }; auto isNonReplacedInline = [](auto& renderer) { return renderer.isInline() && !renderer.isBlockLevelReplacedOrAtomicInline(); }; if (state.renderer && !state.renderer->isRenderOrLegacyRenderSVGModelObject()) { // According to
http://www.w3.org/TR/CSS2/visudet.html#the-height-property
, // the "height" property does not apply for non-replaced inline elements. if (!isNonReplacedInline(*state.renderer)) { if constexpr (propertyID == CSSPropertyHeight) return functor(Length<> { sizingBox(*state.renderer).height() }); else if constexpr (propertyID == CSSPropertyWidth) return functor(Length<> { sizingBox(*state.renderer).width() }); } } return functor(value); } }; Might be need to add something specific for SVG here.
Ahmad Saleem
Comment 3
2026-03-16 09:16:00 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/60701
EWS
Comment 4
2026-05-25 17:32:03 PDT
Committed
313859@main
(58f3b64ab992): <
https://commits.webkit.org/313859@main
> Reviewed commits have been landed. Closing PR #60701 and removing active labels.
Ahmad Saleem
Comment 5
2026-05-26 00:27:04 PDT
***
Bug 296024
has been marked as a duplicate of this bug. ***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug