Sort out `WSType`
Categories
(Core :: DOM: Editor, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox76 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
It should be hidden in WSRunObject.h and WSRunObject.cpp since it's hard to understand without reading WSRunScanner
code.
Assignee | ||
Comment 1•5 years ago
|
||
It means why the WSFragment
ends by. I.e., it tells next content type of
the fragment.
Assignee | ||
Comment 2•5 years ago
|
||
Similarly, it indicates the previous content type of the fragment.
Depends on D68673
Assignee | ||
Comment 3•5 years ago
|
||
Surprisingly, each value meaning of WSFragment::mType
is different from
WSFragment::mRightType
and WSFragment::mLeftType
. It uses only 3 bits,
WSType::normalWS
, WSType::leadingWS
and WSType::trailingWS
.
According to the second if
block of WSRunScanner::GetRuns()
, the latter
2 values mean whether the fragment starts from and/or ends by a hard line.
And also, according to there, normalWS
means the run is visible or not.
(However, according to the first if
block, Visible::Yes
might be set to
for empty fragment too, but I have no better idea of its name.)
Therefore, mType & WSType::leadningWS
can call "is start of hard line",
mType & WSType::trailingWS
can call "is end of hard line",
mType == WSType::normalWS
can call "is visible and not edges of hard line"
and mType & WSType::normalWS
can call "is not edges of hard line".
So, 3 bool
members can represent all of their status. Therefore, we should
get rid of this odd use case of WSType
.
Depends on D68674
Assignee | ||
Comment 4•5 years ago
|
||
Now, WSType
is used only by WSRunScanner
, WSRunObject
and WSScanResult
.
We should hide this mysterious enum
from other classes for making other
developers easier to understand. Therefore, this patch moves WSType
into
WSScanResult
and share it with WSRunScanner
with making them friends.
Depends on D68675
Comment 6•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/72e16880bb64
https://hg.mozilla.org/mozilla-central/rev/cadb96d25fbf
https://hg.mozilla.org/mozilla-central/rev/5a4357636b81
https://hg.mozilla.org/mozilla-central/rev/774d32b9641e
Description
•