Closed Bug 1514464 Opened 8 months ago Closed 8 months ago
Clamp selection color value between 0 and 255 in ns
Look And Feel .mm
47 bytes, text/x-phabricator-request
|Details | Review|
(In reply to Markus Stange [:mstange] from bug 1513401 comment #12) > > + value = 255 - (255 - value) * factor; > > I realized a problem in the math: if value is less that 128, this will be > 255 - [something larger than 255], which will be negative and then > wraparound into a large uint16_t value when assigned to "value". So I think > the "(255 - value) * factor" part should be wrapped in a > mozilla::clamped(..., 0, 255). > > This is not that urgent to fix because macOS does not, as far as I know, > have gray highlighting colors that are darker than 128. But it should still > be fixed.
Might as well take this on Beta as well since bug 1514464 is being uplifted there.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/655c49c71be0 Clamp selection color value between 0 and 255 in nsLookAndFeel.mm. r=mstange
Comment on attachment 9031670 [details] Bug 1514464 - Clamp selection color value between 0 and 255 in nsLookAndFeel.mm. r=mstange [Beta/Release Uplift Approval Request] Feature/Bug causing the regression: Bug 1513401 User impact if declined: None, just makes the code more sane in case the OS changes the provided selection color Is this code covered by automated tests?: No Has the fix been verified in Nightly?: No Needs manual test from QE?: No If yes, steps to reproduce: List of other uplifts needed: None Risk to taking this patch: Low Why is the change risky/not risky? (and alternatives if risky): low risk, one line cocoa change String changes made/needed:
Attachment #9031670 - Flags: approval-mozilla-beta?
Comment on attachment 9031670 [details] Bug 1514464 - Clamp selection color value between 0 and 255 in nsLookAndFeel.mm. r=mstange [Triage Comment] Adds a bit of sanity checking to the selection color code in case the OS gives bogus values. Approved for 65.0b5.
Attachment #9031670 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.