Closed Bug 1648938 Opened 4 years ago Closed 4 years ago

Convert writing-modes #defines to an enum class.

Categories

(Core :: CSS Parsing and Computation, task)

task

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: zech.ph, Assigned: zech.ph)

Details

Attachments

(1 file)

No description provided.

I started converting the existing NS_STYLE_WRITING_MODE_* defines to an enum calling it StyleWritingMode but upon compilation realized that there already exists a struct in the same namespace (mozilla) with the same name in ServoStyleConsts.h. Are they somehow related? Is this enum even necessary, or shall the struct in general take over the former #defines' jobs?

Flags: needinfo?(emilio)

Yeah, this one is a bit weird, because there are two "writing-mode" things:

  • The writing-mode property (which is what these constants are about).
  • The WritingMode class + StyleWritingMode, which is really a bitfield with various information computed from writing-mode, direction, text-orientation... As these affect each other.

So I think the right thing to do here is calling the new enum StyleWritingModeProperty or something like this, so that it properly differentiates from one from the other.

Flags: needinfo?(emilio)

Alternatively we could rename StyleWritingMode / WritingMode, but those are much more widely used, and it's not clear what the right name for that would be otherwise, so it seems better / more straight-forward to rename the (not-yet-existing) enum :)

Ok, thx!

Assignee: nobody → zech.ph
Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ee4a5d3b193f
Convert writing-modes #defines to an enum class. r=emilio
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: