Bug 1916026 Part 2 - Revise outdated comments in WritingModes.h. r=layout-reviewers,jfkthame

Many classes contain a `WritingMode` member variable that may not be initialized
immediately upon construction but rather during later computations. Therefore,
having a default constructor providing a default writing mode remains necessary.

`WritingMode::SetDirectionFromBidiLevel()`'s input argument was changed from
uint8_t to a helper class in
https://hg.mozilla.org/mozilla-central/rev/20965e0af9b3f8cc2689be5ba6ae323cb9af4436

Differential Revision: https://phabricator.services.mozilla.com/D220756
This commit is contained in:
Ting-Yu Lin 2024-08-31 22:47:26 +00:00
parent 381d33f7cc
commit fde94289eb

View File

@ -461,9 +461,8 @@ class WritingMode {
}
/**
* Default constructor gives us a horizontal, LTR writing mode.
* XXX We will probably eliminate this and require explicit initialization
* in all cases once transition is complete.
* Construct a default WritingMode, equivalent to specifying
* 'writing-mode: horizontal-tb' and 'direction: ltr' in CSS.
*/
WritingMode() : mWritingMode{0} {}
@ -490,8 +489,6 @@ class WritingMode {
* the rtl-ness doesn't match), then we correct the direction by flipping the
* same bits that get flipped in the constructor's CSS 'direction'-based
* chunk.
*
* XXX change uint8_t to UBiDiLevel after bug 924851
*/
void SetDirectionFromBidiLevel(mozilla::intl::BidiEmbeddingLevel level) {
if (level.IsRTL() == IsBidiLTR()) {
@ -572,8 +569,9 @@ class WritingMode {
}
/**
* Constructing a WritingMode with an arbitrary value is a private operation
* currently only used by the Unknown() and IgnoreSideways() methods.
* Constructing a WritingMode with an arbitrary value is a private operation.
* This is currently only used by the Unknown() and IgnoreSideways() methods,
* and a friend struct IMENotification.
*/
explicit WritingMode(uint8_t aValue) : mWritingMode{aValue} {}