[Webkit-unassigned] [Bug 41386] REGRESSION(58212): html foreignObjects with positions other than static not hidden correctly when parent has display:none
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Feb 17 01:53:06 PST 2012
https://bugs.webkit.org/show_bug.cgi?id=41386
--- Comment #4 from Nikolas Zimmermann <zimmermann at kde.org> 2012-02-17 01:53:06 PST ---
(In reply to comment #3)
> Regression confirmed. The issue is that we create renderers for SVGGElement, that have display: none set. This is needed for constructs like: <g display="none"><linearGradient/> ... If we wouldn't create a renderer for <g>, the <linearGradient/> renderer wouldn't be constructed. For display: none the <g> gets a RenderSVGHiddenContainer renderer, which is like a regular container, but overrides paint() to do nothing.
>
> The problem here is that the <body> in the <fO> still creates inline boxes, which gets renderered, by RenderBlock::paint (trough the <body> renderer). All non-inline objects (direct block children of the <fO>) are treated correctly. Looking into a fix.
I forgot to mention that the problem doesn't happen with non-relative positioned content in the <body>.
Here's a dump of your test case:
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (0,0) size 100x90
RenderSVGHiddenContainer {g} at (0,0) size 0x0
RenderSVGForeignObject {foreignObject} at (0,0) size 0x0
RenderBlock {html} at (0,0) size 0x100
RenderSVGRect {rect} at (0,0) size 100x90 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=90.00]
layer at (0,0) size 100x100
RenderBody {body} at (0,0) size 100x100 [color=#FF0000]
RenderText {#text} at (0,0) size 76x36
text run at (0,0) width 76: "FAILED IF"
text run at (0,18) width 62: "VISIBLE"
Removing the position: relative yields:
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (0,0) size 100x90
RenderSVGHiddenContainer {g} at (0,0) size 0x0
RenderSVGForeignObject {foreignObject} at (0,0) size 0x0
RenderBlock {html} at (0,0) size 0x100
RenderBody {body} at (0,0) size 100x100 [color=#FF0000]
RenderText {#text} at (0,0) size 76x36
text run at (0,0) width 76: "FAILED IF"
text run at (0,18) width 62: "VISIBLE"
RenderSVGRect {rect} at (0,0) size 100x90 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=90.00]
The key problem here is that due position: relative, a new RenderLayer is created for the <body>. Now when the full document paints we have two separated layers, that get painted! The second layer doesn't know that its contained in a hidden SVG subtree, and thus gets painted.
HTML doesn't suffer from problems like this, because it never creates renderers for children, of a display: none object. Anyhow, the bug is fully understood and can be fixed now.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list