| Summary: | Set intrinsic size for inline SVG earlier | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | 709922234, karlcow, murrayadcock+webkit, sabouhallawa, simon.fraser, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=230045 https://bugs.webkit.org/show_bug.cgi?id=243661 |
||
|
Description
Ahmad Saleem
2023-06-01 12:21:56 PDT
Changes needed in Source/WebCore/rendering/svg/LegacyRenderSVGRoot.cpp:
const int defaultWidth = 300;
const int defaultHeight = 150;
LegacyRenderSVGRoot::LegacyRenderSVGRoot(SVGSVGElement& element, RenderStyle&& style)
: RenderReplaced(element, WTFMove(style))
, m_isLayoutSizeChanged(false)
, m_needsBoundariesOrTransformUpdate(true)
, m_hasBoxDecorations(false)
{
LayoutSize intrinsicSize(calculateIntrinsicSize());
if (!intrinsicSize.width())
intrinsicSize.setWidth(defaultWidth);
if (!intrinsicSize.height())
intrinsicSize.setHeight(defaultHeight);
setIntrinsicSize(intrinsicSize);
}
and
FloatSize LegacyRenderSVGRoot::calculateIntrinsicSize() const
{
return FloatSize(floatValueForLength(svgSVGElement().intrinsicWidth(), 0), floatValueForLength(svgSVGElement().intrinsicHeight(), 0));
}
void LegacyRenderSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, FloatSize& intrinsicRatio) const
{
ASSERT(!shouldApplySizeContainment());
// https://www.w3.org/TR/SVG/coords.html#IntrinsicSizing
intrinsicSize = calculateIntrinsicSize();
if (style().aspectRatio
...
__
and Source/WebCore/rendering/svg/LegacyRenderSVGRoot.h:
FloatSize calculateIntrinsicSize() const;
_____
Make us pass the test in Legacy, will try LBSE next.
Committed 266314@main (dbdb89fe49e8): <https://commits.webkit.org/266314@main> Reviewed commits have been landed. Closing PR #16084 and removing active labels. *** Bug 230045 has been marked as a duplicate of this bug. *** *** Bug 243661 has been marked as a duplicate of this bug. *** |