Bug 12221 - Webkit ToT fails to render this pattern example
Summary: Webkit ToT fails to render this pattern example
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nikolas Zimmermann
URL: http://www.w3.org/TR/SVG11/images/pse...
Keywords: HasReduction
Depends on: 12207
Blocks:
  Show dependency treegraph
 
Reported: 2007-01-12 01:38 PST by Rob Buis
Modified: 2007-09-09 16:02 PDT (History)
2 users (show)

See Also:


Attachments
even simpler example (340 bytes, image/svg+xml)
2007-01-12 01:57 PST, Eric Seidel (no email)
no flags Details
Layout test results (720.28 KB, patch)
2007-09-09 05:59 PDT, Nikolas Zimmermann
oliver: review+
Details | Formatted Diff | Diff
Initial pattern rework patch (17.47 KB, patch)
2007-09-09 06:00 PDT, Nikolas Zimmermann
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2007-01-12 01:38:51 PST
The svg doesnt show the pattern correctly, the tiles seem to small.
Comment 1 Eric Seidel (no email) 2007-01-12 01:57:08 PST
Created attachment 12380 [details]
even simpler example

It looks like we simply don't apply the viewbox transform when drawing.  Rob is in the middle of splitting RenderSVGContainer into two classes (one which establishes viewports and one which can have transforms applied).  Pattern should definitely use the viewport one.
Comment 2 reid 2007-02-20 02:05:11 PST
Not to sound like a broken record, but as far as I can tell, patterns are broken pretty fundamentally when it comes to multiple viewports and any coordinate remapping which is how they would typically be used IMHO.  I have lots of examples of things that don't work, though perhaps they all boil down to what is illustrated in the attached example already.

In some cases, the rendered results seem totally bizarre and I really cannot make any sense of what is being rendered, i.e. it seems to bear little relationship to the specified SVG.

I'd be happy to try out some example and post results once the fundamentals are working, but I'm not sure if its useful for me to attach more broken examples at this point.  In addition, Grand Paradiso is not exactly doing a spectacular job either, so it is difficult to know with any certainty the correct result.
Comment 3 Eric Seidel (no email) 2007-06-12 10:22:16 PDT
We'll look at this after bug 12207 is solved.
Comment 4 Nikolas Zimmermann 2007-09-04 07:17:58 PDT
Heya!

Just added "reid" to the list of CC. I'm just in the process of fixing patterns and would love to see more "broken examples". I'm hoping "reid" can mail me some examples in private: zimmermann@kde.org.

Looking forward to get this fixed very soon.
Greetings,
Niko
Comment 5 Nikolas Zimmermann 2007-09-09 05:59:26 PDT
Created attachment 16231 [details]
Layout test results
Comment 6 Nikolas Zimmermann 2007-09-09 06:00:42 PDT
Created attachment 16232 [details]
Initial pattern rework patch

Add viewBox support to patterns, support all combinations of patternUnits/patternContentUnits. Properly support overflow="visible" & take into account stroke-width for patterns.
Comment 7 Oliver Hunt 2007-09-09 12:08:10 PDT
Comment on attachment 16232 [details]
Initial pattern rework patch

Is this safe?
         if (!attributes.hasX() && current->hasAttribute(SVGNames::xAttr))

This seems really bad to me:

+    CGContextSetPatternPhase(contextRef, CGSizeMake(0.0, -0.01));
What happens under heavy scaling?



-            attributes.setX(current->x().valueAsPercentage());
+            attributes.setX(current->x());
Comment 8 Oliver Hunt 2007-09-09 12:22:43 PDT
is
-            attributes.setX(current->x().valueAsPercentage());
+            attributes.setX(current->x());
safe?
Comment 9 Nikolas Zimmermann 2007-09-09 13:34:33 PDT
Yo Olier,

> Is this safe?
>          if (!attributes.hasX() && current->hasAttribute(SVGNames::xAttr))
... 
> 
> -            attributes.setX(current->x().valueAsPercentage());
> +            attributes.setX(current->x());
> 

All of this happens in a while (current) loop, so all is safe.

> +    CGContextSetPatternPhase(contextRef, CGSizeMake(0.0, -0.01));
> What happens under heavy scaling?

This is passed in user-space, and not influenced by scaling.
The comment says it's a crude hack, but it tried some three days to workaround that, though it boils down to a little user-space offset to be applied - the pattern phase - to make it work, as expected.

Greetings,
Niko
Comment 10 Oliver Hunt 2007-09-09 15:51:16 PDT
Comment on attachment 16231 [details]
Layout test results

rs=me for layout test-fu
Comment 11 Nikolas Zimmermann 2007-09-09 16:02:40 PDT
Landed in r25460.