Bug 88772 - Viewbox Scaling Exposes Incorrect Transformations on Text Gradient Fills
Summary: Viewbox Scaling Exposes Incorrect Transformations on Text Gradient Fills
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-11 03:03 PDT by Dominik Röttsches (drott)
Modified: 2023-01-21 06:44 PST (History)
4 users (show)

See Also:


Attachments
RefTests (2.41 KB, patch)
2012-06-11 04:11 PDT, Dominik Röttsches (drott)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Röttsches (drott) 2012-06-11 03:03:11 PDT
When using a viewbox attribute that results in upscaling, text gradient fills are rendered incorrectly.
Comment 1 Dominik Röttsches (drott) 2012-06-11 04:11:02 PDT
Created attachment 146825 [details]
RefTests
Comment 2 Dominik Röttsches (drott) 2012-06-11 04:14:12 PDT
Comment on attachment 146825 [details]
RefTests

This reftest shows the issue. The gradient should scale from red over green to blue over the size of the text, same in both cases - with viewbox and without.
Comment 3 Dominik Röttsches (drott) 2012-06-18 07:51:39 PDT
The issue seems to be with identifying the bounding box of small-scale text. Origin of bounding box for the text in LayoutTests/svg/transforms/viewbox-text-fill-gradient.html is 0,0 - extents are 1,1 - while these should be precise float  values.
Comment 4 Dominik Röttsches (drott) 2012-06-18 09:07:07 PDT
In my understanding, the rounding happens in void SVGRootInlineBox::layoutRootBox(). Using LayoutUnits here, would only improve the results but not fix the issue completely - we need higher precision for the text bounding boxes.
Comment 5 Dominik Röttsches (drott) 2012-06-18 09:11:03 PDT
Probably same root cause as bug 75781.
Comment 6 Dominik Röttsches (drott) 2013-01-25 05:31:37 PST
This issue persists even after landing patch from bug 107771.
Comment 7 Ahmad Saleem 2023-01-21 06:44:24 PST
I took the test case from the attached patch and turned into JSFiddle and also added missing </rect>:

JSFiddle - https://jsfiddle.net/9z4Ljr7y/show

Safari 16.2, Safari Technology Preview 161, Chrome Canary 111 and Firefox Nightly 111 are matching other, do we need to track anything else? Thanks!