Closed Bug 1849440 Opened 2 years ago Closed 2 years ago

Fix float-to-nscoord conversion in LengthPercentage::Resolve

Categories

(Core :: CSS Parsing and Computation, task)

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/78af6dbe0591376d9d5d678adaf21aa69dcc3506/layout/style/ServoStyleConstsInlines.h#711,720

nscoord LengthPercentage::Resolve(T aPercentageGetter, U aRounder) const {
...
    return 0.0f;

This ^ 0.0f should just be 0, to match the return type (nscoord which is a typedef for int32_t) and avoid an implicit conversion.

This doesn't change behavior; this just avoids an implicit float-to-nscoord
conversion that we were inadvertently triggering for no reason.

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/981402028450 Return 0 instead of 0.0f from a nscoord-returning function. r=emilio
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: