Bug 23963 - [LegacySVG] Margin collapsing should not occur at the foreignObject boundary
Summary: [LegacySVG] Margin collapsing should not occur at the foreignObject boundary
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 205550 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-14 22:02 PST by Simon Fraser (smfr)
Modified: 2024-03-14 04:10 PDT (History)
7 users (show)

See Also:


Attachments
Testcase; compare with Firefox (516 bytes, text/html)
2009-02-14 22:04 PST, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 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.
Comment 1 Simon Fraser (smfr) 2009-02-14 22:04:57 PST
Created attachment 27681 [details]
Testcase; compare with Firefox
Comment 2 Simon Fraser (smfr) 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
Comment 3 Simon Fraser (smfr) 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
Comment 4 Simon Fraser (smfr) 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
Comment 5 Simon Fraser (smfr) 2022-08-01 10:21:13 PDT
*** Bug 205550 has been marked as a duplicate of this bug. ***
Comment 6 Alexey Proskuryakov 2022-08-01 11:53:51 PDT
<rdar://problem/97208795>
Comment 7 Ahmad Saleem 2022-10-17 07:18:12 PDT
It will be done with LBSE - https://bugs.webkit.org/show_bug.cgi?id=245908
Comment 8 Ahmad Saleem 2022-10-17 07:58:26 PDT

*** This bug has been marked as a duplicate of bug 245908 ***
Comment 9 Ahmad Saleem 2023-03-03 04:02:52 PST
I manage to fix this locally, will do new PR.

Had to use - isSVGForeignObjectOrLegacySVGForeignObject();
Comment 10 Ahmad Saleem 2023-03-04 06:23:06 PST
PR - https://github.com/WebKit/WebKit/pull/10991