Modernize the enums in WritingMode, and some cleanup nearby
Categories
(Core :: Layout, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox127 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(5 files)
Filed per bug 1610666 comment 5, there are still some enum
s in
https://searchfox.org/mozilla-central/rev/a3d520fca1a1ca29992cb3806245db25e41a8617/layout/generic/WritingModes.h#158-185
Assignee | ||
Comment 1•9 months ago
|
||
Updated•9 months ago
|
Assignee | ||
Comment 2•9 months ago
|
||
Also, rewrite GetInlineDir() and GetBlockDir() to remove bit operations for
computing the InlineDir and BlockDir enum variants.
Assignee | ||
Comment 3•9 months ago
|
||
Existing callers are using IsBidiLTR()
and IsBidiRTL()
to check the inline
flow direction. BidiDir
and GetBidiDir()
do not seem useful, and were only
used internally before this patch.
Assignee | ||
Comment 4•9 months ago
|
||
These assertions verify that the numeric values are consistent with
StyleWritingMode
(aka WritingMode
in servo). They won't change during
runtime, so they can be static_assert
.
Also, the two index
variables can be uint8_t
instead of int
.
Assignee | ||
Comment 5•9 months ago
|
||
During the conversion from enum to enum class for LogicalEdge
in bug 1885695,
we drop the explicit numeric values its variants. After removing the bit
operations in these helpers, it makes the implementation less obscure.
Comment 7•9 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/97be1eff3e3f
https://hg.mozilla.org/mozilla-central/rev/0505eaab18b4
https://hg.mozilla.org/mozilla-central/rev/f9b3829fcfa4
https://hg.mozilla.org/mozilla-central/rev/e1ed82dd66ab
https://hg.mozilla.org/mozilla-central/rev/074d29b6e81d
Description
•