REOPENED 23963
[LegacySVG] Margin collapsing should not occur at the foreignObject boundary
https://bugs.webkit.org/show_bug.cgi?id=23963
Summary [LegacySVG] Margin collapsing should not occur at the foreignObject boundary
Simon Fraser (smfr)
Reported 2009-02-14 22:02:41 PST
WebKit's behavior differs from Firefox and Opera when it comes to margin collapsing in an SVG foreignObject. In FF/Opera, margins don't extend outside of the foreignObject. In WebKit, they do.
Attachments
Testcase; compare with Firefox (516 bytes, text/html)
2009-02-14 22:04 PST, Simon Fraser (smfr)
no flags
Simon Fraser (smfr)
Comment 1 2009-02-14 22:04:57 PST
Created attachment 27681 [details] Testcase; compare with Firefox
Simon Fraser (smfr)
Comment 2 2009-02-16 10:57:10 PST
Notes from irc: [10:54am] dhyatt:if (!parent()->isBoxModelObject()) [10:54am] dhyatt: would be good enough i would think [10:55am] dhyatt: m_canCollapseWithChildren = !block->isRenderView() && !block->isRoot() && !block->isPositioned() && [10:55am] dhyatt: !block->isFloating() && !block->isTableCell() && !block->hasOverflowClip() && !block->isInlineBlockOrInlineTable(); [10:55am] dhyatt: line 91 of RenderBlock.cpp
Simon Fraser (smfr)
Comment 3 2009-02-16 10:59:34 PST
dhyatt: we actually don't even let <html> collapse margins with its children [10:57am] dhyatt: could probably just ditch the isRenderView check and replace with !parent() || !parent()->isBoxModelObject() dhyatt: but before doing that would need to see if the <html> in a foreign object collapses with the <body> dhyatt: <html style="margin:100px;"><body style="margin:100px">Hello world dhyatt: in safari that will leave 200px of space above hello world
Simon Fraser (smfr)
Comment 4 2009-02-16 11:02:28 PST
dhyatt: if <html> is special we may end up just having to ask about <html> [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
Simon Fraser (smfr)
Comment 5 2022-08-01 10:21:13 PDT
*** Bug 205550 has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 6 2022-08-01 11:53:51 PDT
Ahmad Saleem
Comment 7 2022-10-17 07:18:12 PDT
Ahmad Saleem
Comment 8 2022-10-17 07:58:26 PDT
*** This bug has been marked as a duplicate of bug 245908 ***
Ahmad Saleem
Comment 9 2023-03-03 04:02:52 PST
I manage to fix this locally, will do new PR. Had to use - isSVGForeignObjectOrLegacySVGForeignObject();
Ahmad Saleem
Comment 10 2023-03-04 06:23:06 PST
Ahmad Saleem
Comment 11 2024-08-24 07:42:39 PDT
Note You need to log in before you can comment on or make changes to this bug.