Bug 139414 - Small rounding error in SVG color transformation
Summary: Small rounding error in SVG color transformation
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2014-12-08 14:51 PST by Said Abou-Hallawa
Modified: 2014-12-08 14:52 PST (History)
2 users (show)

See Also:

Test case (448 bytes, image/svg+xml)
2014-12-08 14:51 PST, Said Abou-Hallawa
no flags Details
Expected file (129 bytes, image/svg+xml)
2014-12-08 14:52 PST, Said Abou-Hallawa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2014-12-08 14:51:38 PST
Created attachment 242848 [details]
Test case

Open the attached test case and compare it with the expected file.

Result: With naked eyes, the two will look very similar. But if a comparison tool is used, the result will be they are different.
Expected: The test case and the expected file should exactly the same.

The test case has the following filter effect:
    <feColorMatrix type="matrix" values="0 1 0 0 0   0 0 1 0 0   1 0 0 0 0   0 0 0 0.5 0" ...>
This filter effect is applied to the following target element:
    <rect x="0" y="0" width="100" height="100" fill="#123456" filter="url(#f1)"/>
The resulting color should be equal to: r=0x34, g=0x56, b=0x12 and alpha=0.5

The expected file has only the following element:
    <rect x="10" y="10" width="80" height="80" fill="#345612" fill-opacity="0.5"/>

With closer look at the test case, one can see a difference of 1/256 in every color component when it is compared with the expected file.

NOTE: We may end up not fixing this bug. But we need to investigate to understand where the rounding happens. And based on this investigation we will decided if it is worthy fixing or not.
NOTE: The attached test case is imported from Mozilla SVG test suite.
Comment 1 Said Abou-Hallawa 2014-12-08 14:52:05 PST
Created attachment 242849 [details]
Expected file
Comment 2 Radar WebKit Bug Importer 2014-12-08 14:52:56 PST