<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>257614</bug_id>
          
          <creation_ts>2023-06-01 12:21:56 -0700</creation_ts>
          <short_desc>Set intrinsic size for inline SVG earlier</short_desc>
          <delta_ts>2023-07-26 09:34:59 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=230045</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=243661</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>709922234</cc>
    
    <cc>karlcow</cc>
    
    <cc>murrayadcock+webkit</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1959393</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-06-01 12:21:56 -0700</bug_when>
    <thetext>Hi Team,

While going through failing testcases and bugs in SVG from Blink&apos;s Monorail, came across another failing:

Test Case: https://jsfiddle.net/k8w1og6d/show

^ Show &apos;Red&apos; 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 &apos;BrowserCompat&apos;.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1960596</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-06-08 12:22:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/110480382&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1968131</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-07-25 15:42:30 -0700</bug_when>
    <thetext>Changes needed in Source/WebCore/rendering/svg/LegacyRenderSVGRoot.cpp:

const int defaultWidth = 300;
const int defaultHeight = 150;

LegacyRenderSVGRoot::LegacyRenderSVGRoot(SVGSVGElement&amp; element, RenderStyle&amp;&amp; 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&amp; intrinsicSize, FloatSize&amp; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1968233</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-07-26 08:50:00 -0700</bug_when>
    <thetext>Committed 266314@main (dbdb89fe49e8): &lt;https://commits.webkit.org/266314@main&gt;

Reviewed commits have been landed. Closing PR #16084 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1968243</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-07-26 09:34:48 -0700</bug_when>
    <thetext>*** Bug 230045 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1968245</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-07-26 09:34:59 -0700</bug_when>
    <thetext>*** Bug 243661 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>