Bug 30399 - <mask> and <pattern> don't handle texts
Summary: <mask> and <pattern> don't handle texts
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 15655 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-15 11:10 PDT by Dirk Schulze
Modified: 2010-07-01 09:18 PDT (History)
2 users (show)

See Also:


Attachments
Mask with text (302 bytes, image/svg+xml)
2009-10-15 11:10 PDT, Dirk Schulze
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Schulze 2009-10-15 11:10:16 PDT
Created attachment 41236 [details]
Mask with text

Texts in maks are ignored. I thougt that Eric already opened a bug about masking and texts but I couldn't find it.

I added a short example. If mask works correctly, you should see a green squarre with the red text "Mask" on it.
Comment 1 Dirk Schulze 2009-11-14 00:38:08 PST
*** Bug 15655 has been marked as a duplicate of this bug. ***
Comment 2 Dirk Schulze 2010-01-13 12:41:05 PST
The problem is in renderSubtreeToImage() (SVGRenderSupport.cpp). We set the paintInfo.rect to en empty IntRect.

    RenderObject::PaintInfo info(image->context(), IntRect(), PaintPhaseForeground, 0, 0, 0);

This causes problems in RenderSVGText::paint(). RenderSVGText::paint() calls

    RenderBlock::paint(pi, 0, 0);

and RenderBlock::paint intersects visibleOverflowRect() with paintInfo.rect and returns if this intersection is empty. But even disabling the return for testing didn't solve the problem. I had to add the paintInfo.rect of the SVGResource and the renderer with the relation to this resource to renderSubtreeToImage() manually to get texts working. Sounds a bit complicated atm :-P
Comment 3 Nikolas Zimmermann 2010-01-13 13:18:41 PST
(In reply to comment #2)
> The problem is in renderSubtreeToImage() (SVGRenderSupport.cpp). We set the
> paintInfo.rect to en empty IntRect.
> 
>     RenderObject::PaintInfo info(image->context(), IntRect(),
> PaintPhaseForeground, 0, 0, 0);
> 
> This causes problems in RenderSVGText::paint(). RenderSVGText::paint() calls
> 
>     RenderBlock::paint(pi, 0, 0);
> 
> and RenderBlock::paint intersects visibleOverflowRect() with paintInfo.rect and
> returns if this intersection is empty. But even disabling the return for
> testing didn't solve the problem. I had to add the paintInfo.rect of the
> SVGResource and the renderer with the relation to this resource to
> renderSubtreeToImage() manually to get texts working. Sounds a bit complicated
> atm :-P

Yeah, it's a bit involved. We need to fix SVG text renderers first, otherwhise there will be no clean solution available.
Comment 4 Dirk Schulze 2010-07-01 09:18:11 PDT
Works in trunk. Closing bug.