RESOLVED FIXED257614
Set intrinsic size for inline SVG earlier
https://bugs.webkit.org/show_bug.cgi?id=257614
Summary Set intrinsic size for inline SVG earlier
Ahmad Saleem
Reported 2023-06-01 12:21:56 PDT
Hi Team, While going through failing testcases and bugs in SVG from Blink's Monorail, came across another failing: Test Case: https://jsfiddle.net/k8w1og6d/show ^ Show 'Red' in STP171 while Chrome Canary 116 and Firefox Nightly 115 works fine and only have green. Blink Commit: https://chromium.googlesource.com/chromium/src.git/+/545b2183e1b4ee3eb433537f9a6386b5337d6588 Just wanted to raise, so we can track. Marking this as 'BrowserCompat'. Thanks!
Attachments
Radar WebKit Bug Importer
Comment 1 2023-06-08 12:22:16 PDT
Ahmad Saleem
Comment 2 2023-07-25 15:42:30 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.
EWS
Comment 3 2023-07-26 08:50:00 PDT
Committed 266314@main (dbdb89fe49e8): <https://commits.webkit.org/266314@main> Reviewed commits have been landed. Closing PR #16084 and removing active labels.
Ahmad Saleem
Comment 4 2023-07-26 09:34:48 PDT
*** Bug 230045 has been marked as a duplicate of this bug. ***
Ahmad Saleem
Comment 5 2023-07-26 09:34:59 PDT
*** Bug 243661 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.