Closed Bug 1648938 Opened 1 year ago Closed 1 year ago

Convert writing-modes #defines to an enum class.


(Core :: CSS Parsing and Computation, task)




Tracking Status
firefox80 --- fixed


(Reporter:, Assigned:



(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 →
Pushed by
Convert writing-modes #defines to an enum class. r=emilio
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.