Bug 193039

Summary: Standardize rounding of percentage rgb() alpha values
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, ap, simon.fraser, zalan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=192321
https://bugs.webkit.org/show_bug.cgi?id=193038

Description Simon Fraser (smfr) 2018-12-26 12:08:59 PST
We have:
        alphaComponent = static_cast<int>(clampTo<double>(alpha, 0.0, 1.0) * nextafter(256.0, 0.0));

Blink has:

    // W3 standard stipulates a 2.55 alpha value multiplication factor.
    int alpha_component = static_cast<int>(lround(clampTo<double>(alpha, 0.0, 1.0) * 255.0));
Comment 1 Ahmad Saleem 2022-09-30 15:31:03 PDT
@Simon - I am only able to find four references to "alphaComponent" in Webkit GitHub, while noticed that these clean-up patches landed in Webkit in 2020:

https://github.com/WebKit/WebKit/commit/1a972b5062db8b61e5217bd35986f8dbdd36b75e

https://github.com/WebKit/WebKit/commit/65cd1e76a0bd628e1cd2109a0dd8bb7d9000b86c

https://github.com/WebKit/WebKit/commit/76dea7243010f7a3aada8d7f42ad336d6ca153ba

https://github.com/WebKit/WebKit/commit/1cf4a24fb0220174c7db4d6e5e3b245cc86e8f07

Do we need to do something more here?

If it has been resolved, can we mark this and "See Also" related bug as "RESOLVED CONFIGURATION CHANGED"? Thanks!
Comment 2 Simon Fraser (smfr) 2022-10-03 12:08:12 PDT
I believe this has been resolved.