WebKit does not correctly respect 'r' attribute on radialGradient
It seems as though it's just treated at the wrong scale (pixels instead of percent of bbox)
Created attachment 12023 [details]
it looks like the use of isFraction() is completely bogus. That's the problem.
Created attachment 12024 [details]
Attached is a partial fix. It's only partial because it breaks most patterns (and strangely enough, some gradients?). Our pattern code is actually now "more correct", but as a result allocates needlessly large image buffers for drawing the tile into. We need to add some code to make tile drawing smarter, to scale the tile down to only the size necessary before allocating the ImageBuffer. As a quick hack, we could simply divide by 100 (the previous behavior) or scale it down to just the size of the element-using-the-pattern's bounding box. The best solution is to add a method which calculates the actual size of the pattern tile as it is to be rendered to the screen, and then allocate the ImageBuffer for that resolution. This same sort of "finalRenderedSize()" function would be useful for the filter code as well (which already exhibits this same scaling problem).
Created attachment 12025 [details]
better partial fix
There are still a few test cases which are broken. Also, w/o the added "only make the tile as large as it's going to be rendered" optimization certain tests are slowed down by this change (by allocating way-larger-than-necessary tile ImageBuffers).
Comment on attachment 12025 [details]
better partial fix
It turns out everything is actually OK with this patch.
Here's the fallout from these changes:
Have changed results. The tests were depending on a bug in WebKit which is now fixed. :) (At least I believe that to be the case. When comparing with Opera, our results now match.)
This is a new test case which now actually works on TOT.
This test case now intermittently fails, depending on how much free memory the machine has (I think that's the reason). This will be fixed for real once we are smarter about allocating pattern tile image buffers at their physical rendered size, instead of at some super-large logical size.
Created attachment 12029 [details]
fix (with test case changes)
custom/js-late-gradient-creation still looks a bit screwy until bug 11979 is fixed (bug 11979 was previously masked by this bug)
custom/pattern-in-defs may also intermittently fail still until bug 11980 is resolved.