Closed Bug 1883600 Opened 3 months ago Closed 3 months ago

Lack of a public method in servo/stylo::LengthPercentage converting to a certain percentage with given basis

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: rushliu, Assigned: rushliu)

Details

Attachments

(2 files)

Steps to reproduce:

Developing a native renderer with servo/stylo as css engine.

Actual results:

Lack of a public method in servo/stylo::LengthPercentage converting to a certain percentage with given basis.

Expected results:

The crate lacks the method mentioned above.

Added a new public method resolve_percentage to the LengthPercentage struct in the length_percentage.rs file. This method takes a Length type argument named basis and returns an Option<Percentage>.

The purpose of this method is to resolve the current LengthPercentage instance to a percentage based on the given basis. This is particularly useful when integrating Stylo with other renderers, as it allows for the conversion of LengthPercentage to a ratio.

This addition enhances the LengthPercentage struct's functionality, making it more versatile for different rendering contexts.

Assignee: nobody → rushliu
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → CSS Parsing and Computation
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5c95b92fa6d2
Added a new public method `resolve_percentage` to the `LengthPercentage` struct in the `length_percentage.rs` file. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: