RESOLVED FIXED Bug 12221
Webkit ToT fails to render this pattern example
https://bugs.webkit.org/show_bug.cgi?id=12221
Summary Webkit ToT fails to render this pattern example
Rob Buis
Reported 2007-01-12 01:38:51 PST
The svg doesnt show the pattern correctly, the tiles seem to small.
Attachments
even simpler example (340 bytes, image/svg+xml)
2007-01-12 01:57 PST, Eric Seidel (no email)
no flags
Layout test results (720.28 KB, patch)
2007-09-09 05:59 PDT, Nikolas Zimmermann
oliver: review+
Initial pattern rework patch (17.47 KB, patch)
2007-09-09 06:00 PDT, Nikolas Zimmermann
oliver: review+
Eric Seidel (no email)
Comment 1 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.
reid
Comment 2 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.
Eric Seidel (no email)
Comment 3 2007-06-12 10:22:16 PDT
We'll look at this after bug 12207 is solved.
Nikolas Zimmermann
Comment 4 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
Nikolas Zimmermann
Comment 5 2007-09-09 05:59:26 PDT
Created attachment 16231 [details] Layout test results
Nikolas Zimmermann
Comment 6 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.
Oliver Hunt
Comment 7 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());
Oliver Hunt
Comment 8 2007-09-09 12:22:43 PDT
is - attributes.setX(current->x().valueAsPercentage()); + attributes.setX(current->x()); safe?
Nikolas Zimmermann
Comment 9 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
Oliver Hunt
Comment 10 2007-09-09 15:51:16 PDT
Comment on attachment 16231 [details] Layout test results rs=me for layout test-fu
Nikolas Zimmermann
Comment 11 2007-09-09 16:02:40 PDT
Landed in r25460.
Note You need to log in before you can comment on or make changes to this bug.