Bug 68251 - clipPath does not work on foreignObject
Summary: clipPath does not work on foreignObject
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 44071 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-16 10:01 PDT by Rob Crowther
Modified: 2012-01-30 14:26 PST (History)
5 users (show)

See Also:


Attachments
A foreignObject containing a 300px square div is not clipped (881 bytes, image/svg+xml)
2011-09-16 10:01 PDT, Rob Crowther
no flags Details
The same clipPath applied to an svg rect works correctly (697 bytes, image/svg+xml)
2011-09-16 10:02 PDT, Rob Crowther
no flags Details
Patch (6.18 KB, patch)
2011-11-08 14:29 PST, Florin Malita
no flags Details | Formatted Diff | Diff
Patch (14.33 KB, patch)
2011-11-10 16:08 PST, Florin Malita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Crowther 2011-09-16 10:01:14 PDT
Created attachment 107670 [details]
A foreignObject containing a 300px square div is not clipped

No clipping occurs when applying a clipPath to a foreignObject.
Comment 1 Rob Crowther 2011-09-16 10:02:44 PDT
Created attachment 107671 [details]
The same clipPath applied to an svg rect works correctly
Comment 2 Florin Malita 2011-11-08 14:26:58 PST
The foreignObject element currently doesn't support clip-path. I have a patch but it relies on the FO atomic paint fix to pass the tests (https://bugs.webkit.org/show_bug.cgi?id=58417).
Comment 3 Florin Malita 2011-11-08 14:29:12 PST
Created attachment 114155 [details]
Patch
Comment 4 WebKit Review Bot 2011-11-08 16:50:00 PST
Comment on attachment 114155 [details]
Patch

Attachment 114155 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10369241

New failing tests:
svg/foreignObject/clip-path.html
Comment 5 Dirk Schulze 2011-11-09 02:47:00 PST
Comment on attachment 114155 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=114155&action=review

It looks good for me in  general, I r- it because not only clip-path is effected. I'd like to see masked and filtered FO examples as well. And one example for opacity.

> Source/WebCore/ChangeLog:6
> +        clipPath does not work on foreignObject
> +        https://bugs.webkit.org/show_bug.cgi?id=68251
> +
> +        Reviewed by NOBODY (OOPS!).

The change log needs to be more details. What have you done and why? This should be included in the change log.

> Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp:62
>      if (opacity < 1.0f)
>          childPaintInfo.context->beginTransparencyLayer(opacity);

I think we do the opacity in SVGRenderSupport as well. Can you remove the calls here and after your code please? Also, can you add a test to verify the behavior please?

> Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp:75
>      if (opacity < 1.0f)
>          childPaintInfo.context->endTransparencyLayer();

(needs to be removed as well)
Comment 6 Florin Malita 2011-11-10 16:08:18 PST
Created attachment 114593 [details]
Patch
Comment 7 Florin Malita 2011-11-10 16:14:32 PST
Comment on attachment 114155 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=114155&action=review

Thanks for the review Dirk. I've added tests to exercise clipping, masking, filtering and opacity on FOs as suggested.

>> Source/WebCore/ChangeLog:6
>> +        Reviewed by NOBODY (OOPS!).
> 
> The change log needs to be more details. What have you done and why? This should be included in the change log.

Done.

>> Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp:62
>>          childPaintInfo.context->beginTransparencyLayer(opacity);
> 
> I think we do the opacity in SVGRenderSupport as well. Can you remove the calls here and after your code please? Also, can you add a test to verify the behavior please?

Done.

>> Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp:75
>>          childPaintInfo.context->endTransparencyLayer();
> 
> (needs to be removed as well)

Done.
Comment 8 Dirk Schulze 2011-11-11 13:23:53 PST
Comment on attachment 114593 [details]
Patch

LGTM. r=me.
Comment 9 WebKit Review Bot 2011-11-11 16:30:21 PST
Comment on attachment 114593 [details]
Patch

Clearing flags on attachment: 114593

Committed r100045: <http://trac.webkit.org/changeset/100045>
Comment 10 WebKit Review Bot 2011-11-11 16:30:26 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Erik Arvidsson 2012-01-30 14:26:15 PST
*** Bug 44071 has been marked as a duplicate of this bug. ***