Created attachment 41004 [details] Gradient in userspaceOnUse and percentage values On using gradientSpace="userSpaceOnUse" we can't handle x,y,width,height values in percentage correct. The percentage should use the Userspace as refernce. The example in the attachement shows the problem. The above 3 rects schould look like the 3 rects on the bottom.
Created attachment 41033 [details] linearGradient userSpaceOnUse with percentage Some clean up. The problem was, that we transformed the values x1, ... y2 to doubles, saved them in LinearGradientAttributes and didn't differ between objectBoundingBox and userSpaceOnUse later. I removed LinearGradientAttributes and take the values of SVGLinearGradientElement directly. We needed LinearGradientAttributes to draw the gradients on the old platform dependent code of SVGPaintServer. We don't need it anymore and calculate the box in the element itself. The same has to be done on radialGradient too. I'll work on it once this code is landed. I'll create the test results at home.
Comment on attachment 41033 [details] linearGradient userSpaceOnUse with percentage This needs a ChangeLog and a test. Otherwise I think this is a good change, but can't really tell.
Hm, on first sight the change looks wrong to me. The whole idea behind LinearGradientAttributes is to correctly handle deep-nested gradients (aka. gradient referencing another gradient using xlink:href). We need to be careful to take the _right_ x1/y1/.. values from the correct origin. Are you sure this doesn't break existing tests? If it doesn't, something is wrong :-)
Created attachment 41064 [details] gradient userSpaceOnUse with values in percentage This patch fixes both radial as well as linear gradients. It gives GradientAttributes SVGLength values instead of double. This makes it possible to calculate the correct result on userSpaceOnUse mode with values in percentage.
Comment on attachment 41064 [details] gradient userSpaceOnUse with values in percentage Excellent job, r=me.
Comment on attachment 41064 [details] gradient userSpaceOnUse with values in percentage Clearing flags on attachment: 41064 Committed r49481: <http://trac.webkit.org/changeset/49481>
All reviewed patches have been landed. Closing bug.