<?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>23963</bug_id>
          
          <creation_ts>2009-02-14 22:02:41 -0800</creation_ts>
          <short_desc>[LegacySVG] Margin collapsing should not occur at the foreignObject boundary</short_desc>
          <delta_ts>2025-12-23 18:44:13 -0800</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>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=245908</see_also>
          <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="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Ahmad Saleem">ahmad.saleem792</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>eric</cc>
    
    <cc>hyatt</cc>
    
    <cc>olexander.danilchenko</cc>
    
    <cc>rbuis</cc>
    
    <cc>robert</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>109789</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2009-02-14 22:02:41 -0800</bug_when>
    <thetext>WebKit&apos;s behavior differs from Firefox and Opera when it comes to margin collapsing in an SVG foreignObject. In FF/Opera, margins don&apos;t extend outside of the foreignObject. In WebKit, they do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109790</commentid>
    <comment_count>1</comment_count>
      <attachid>27681</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2009-02-14 22:04:57 -0800</bug_when>
    <thetext>Created attachment 27681
Testcase; compare with Firefox</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109861</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2009-02-16 10:57:10 -0800</bug_when>
    <thetext>Notes from irc:

[10:54am] dhyatt:if (!parent()-&gt;isBoxModelObject())
[10:54am] dhyatt: would be good enough i would think
[10:55am] dhyatt: m_canCollapseWithChildren = !block-&gt;isRenderView() &amp;&amp; !block-&gt;isRoot() &amp;&amp; !block-&gt;isPositioned() &amp;&amp;
[10:55am] dhyatt:         !block-&gt;isFloating() &amp;&amp; !block-&gt;isTableCell() &amp;&amp; !block-&gt;hasOverflowClip() &amp;&amp; !block-&gt;isInlineBlockOrInlineTable();
[10:55am] dhyatt: line 91 of RenderBlock.cpp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109864</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2009-02-16 10:59:34 -0800</bug_when>
    <thetext>dhyatt: we actually don&apos;t even let &lt;html&gt; collapse margins with its children
[10:57am] dhyatt: could probably just ditch the isRenderView check and replace with !parent() || !parent()-&gt;isBoxModelObject()
dhyatt: but before doing that would need to see if the &lt;html&gt; in a foreign object collapses with the &lt;body&gt;
dhyatt: &lt;html style=&quot;margin:100px;&quot;&gt;&lt;body style=&quot;margin:100px&quot;&gt;Hello world
dhyatt: in safari that will leave 200px of space above hello world</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109865</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2009-02-16 11:02:28 -0800</bug_when>
    <thetext>dhyatt: if &lt;html&gt; is special we may end up just having to ask about &lt;html&gt;
[11:00am] dhyatt: so yeah the first thing i suggested would fix the isrenderview check
[11:00am] dhyatt: but would also need to do something about the isroot check</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888100</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2022-08-01 10:21:13 -0700</bug_when>
    <thetext>*** Bug 205550 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1888122</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-08-01 11:53:51 -0700</bug_when>
    <thetext>&lt;rdar://problem/97208795&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1906120</commentid>
    <comment_count>7</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-10-17 07:18:12 -0700</bug_when>
    <thetext>It will be done with LBSE - https://bugs.webkit.org/show_bug.cgi?id=245908</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1906126</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-10-17 07:58:26 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 245908 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1938456</commentid>
    <comment_count>9</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-03 04:02:52 -0800</bug_when>
    <thetext>I manage to fix this locally, will do new PR.

Had to use - isSVGForeignObjectOrLegacySVGForeignObject();</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1938826</commentid>
    <comment_count>10</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-03-04 06:23:06 -0800</bug_when>
    <thetext>PR - https://github.com/WebKit/WebKit/pull/10991</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2055123</commentid>
    <comment_count>11</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-08-24 07:42:39 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/32668</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2168019</commentid>
    <comment_count>12</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-12-23 17:00:20 -0800</bug_when>
    <thetext>Committed 304916@main (45d2ff003832): &lt;https://commits.webkit.org/304916@main&gt;

Reviewed commits have been landed. Closing PR #32668 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2168042</commentid>
    <comment_count>13</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-12-23 18:44:13 -0800</bug_when>
    <thetext>*** Bug 261109 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>27681</attachid>
            <date>2009-02-14 22:04:57 -0800</date>
            <delta_ts>2009-02-14 22:04:57 -0800</delta_ts>
            <desc>Testcase; compare with Firefox</desc>
            <filename>html-margin-collapse.svg</filename>
            <type>text/html</type>
            <size>516</size>
            <attacher name="Simon Fraser (smfr)">simon.fraser</attacher>
            
              <data encoding="base64">PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJ5ZXMiPz4KPHN2ZyB4bWxucyA9ICJodHRw
Oi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgc3R5bGU9ImZpbGw6IGdyZWVuOyBzdHJva2U6
IGJsYWNrOyBzdHJva2Utd2lkdGg6IDI7Ij4KICAgIDxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9
IjMwMCIgaGVpZ2h0PSI0MDAiLz4KICAgIDxmb3JlaWduT2JqZWN0ICB4PSIxMCIgeT0iMTAiIHdp
ZHRoPSI0MDAiIGhlaWdodD0iNjAwIj4KICAgICAgPGh0bWwgeG1sbnM9Imh0dHA6Ly93d3cudzMu
b3JnLzE5OTkveGh0bWwiPgogICAgICAgIDxib2R5IHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiBn
cmF5OyBoZWlnaHQ6IDIwMHB4OyI+CiAgICAgICAgICA8ZGl2IHN0eWxlPSJtYXJnaW46IDIwcHg7
IGJhY2tncm91bmQtY29sb3I6IG9yYW5nZSI+SSBoYXZlIGJpZyBtYXJnaW5zPC9kaXY+CiAgICAg
ICAgPC9ib2R5PgogICAgICA8L2h0bWw+CiAgICA8L2ZvcmVpZ25PYmplY3Q+CiAgPC9nPgo8L3N2
Zz4K
</data>

          </attachment>
      

    </bug>

</bugzilla>