<?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>252903</bug_id>
          
          <creation_ts>2023-02-24 07:30:40 -0800</creation_ts>
          <short_desc>[Resize-observer] The `getBoundingBox` of a non-empty SVG element is 0x0</short_desc>
          <delta_ts>2023-03-27 06:24:04 -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>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="cathiechen">cathiechen</reporter>
          <assigned_to name="cathiechen">cathiechen</assigned_to>
          <cc>cathiechen</cc>
    
    <cc>rbuis</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1936516</commentid>
    <comment_count>0</comment_count>
      <attachid>465152</attachid>
    <who name="cathiechen">cathiechen</who>
    <bug_when>2023-02-24 07:30:40 -0800</bug_when>
    <thetext>Created attachment 465152
test-case

In ResizeObservation::computeObservedSizes(), it calls `downcast&lt;SVGElement&gt;(*m_target).getBoundingBox()` which returns 0x0 when the layout size of SVG is not empty.
See the attached test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1936531</commentid>
    <comment_count>1</comment_count>
    <who name="cathiechen">cathiechen</who>
    <bug_when>2023-02-24 08:50:12 -0800</bug_when>
    <thetext>According to [1],

&gt; Web content can also contain SVG elements. SVG elements that do not have associated CSS layout boxes define bounding box instead of a content box. Content rect for the SVGGraphicsElements without CSS layout boxes is a rect whose:
&gt; width is bounding box width
&gt; height is bounding box height

So from ResizeObserver size, it is correct to call `downcast&lt;SVGElement&gt;(*m_target).getBoundingBox()` in `ResizeObservation::computeObservedSizes()`.

I&apos;ll leave this bug to an SVG Expert.

[1] https://drafts.csswg.org/resize-observer/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1938262</commentid>
    <comment_count>2</comment_count>
    <who name="cathiechen">cathiechen</who>
    <bug_when>2023-03-02 13:28:54 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/10955</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1938500</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-03-03 07:31:14 -0800</bug_when>
    <thetext>&lt;rdar://problem/106194536&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1944202</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-03-27 06:24:00 -0700</bug_when>
    <thetext>Committed 262145@main (afa718b1cfd9): &lt;https://commits.webkit.org/262145@main&gt;

Reviewed commits have been landed. Closing PR #10955 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>465152</attachid>
            <date>2023-02-24 07:30:40 -0800</date>
            <delta_ts>2023-02-24 07:30:40 -0800</delta_ts>
            <desc>test-case</desc>
            <filename>auto-007-real-simplify-003.html</filename>
            <type>text/html</type>
            <size>785</size>
            <attacher name="cathiechen">cathiechen</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzdHlsZT4KICAgIC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