Make `WSRunScanner` and `WSRunObject` stop taking DOM points at construction
Categories
(Core :: DOM: Editor, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(22 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
WSRunScanner
and WSRunObject
take one or two EditorDOMPoint
s and initialize its members for the point. However, all users of the storing data uses new stack only class TextFragmentData
to know what fragments there are. So, every such user should take the range instead of using stored range.
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
As coming patches, I believe that WSRunObject
's job is, it keeps visible of white-spaces before and after modifying the DOM tree. E.g., if invisible leading/trailing white-spaces in block element may become visible, it deletes them. If visible white-space sequence is being split, it may replace collapsible ASCII white-space at the split point with NBSP if needed. So, perhaps, it should be renamed to WhiteSpaceVisibilityKeeper
, but the name is too long and it becomes a class whose all methods are static. Therefore, the class names will be in HTMLEditor
a lot...
I still don't have better name idea of WSRunScanner
, though.
Assignee | ||
Comment 2•4 years ago
|
||
For making WSRunScanner::BoundaryData
independent from WSRunScanner
,
its initializer should be in the class itself as static factory methods.
Depends on D82295
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D82693
Assignee | ||
Comment 4•4 years ago
|
||
This patch makes WSRunScanner
have TextFragmentData const mTextFragmentData
instead of 2 BoundaryData
s, a NoBreakingSpaceData
and a bool
storing
whether it's preformatted or not.
Depends on D82694
Assignee | ||
Comment 5•4 years ago
|
||
They work with a TextFragmentData
instance, and the following patches
require to run it without WSRunScanner
/WSRunObject
instances.
Therefore, this patch moves them into TextFragmentData
.
Depends on D82695
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D82697
Assignee | ||
Comment 7•4 years ago
|
||
It's called by WSRunObject::InsertText()
and WSRunObject::InsertBreak()
and
it has 2 parts. One is, considering whether previous char is an NBSP or not
and whether it should be replaced with an ASCII white-space if it's followed
by visible character. The other is, doing the replacement. The latter code
is enough simple. Therefore, we can copy them into the callers. Then,
we can move the check logic into TextFragmentData
.
Depends on D82698
Assignee | ||
Comment 8•4 years ago
|
||
Same as the previous patch, it can be split to computation part and
modifying the DOM tree part. Then, the former can be in TextFragmentData
and the latter can be done by the caller which is only
WSRunObject::InsertText()
.
Depends on D82699
Assignee | ||
Comment 9•4 years ago
|
||
CreateVisibleWhiteSpacesData()
is now called multiple times and maybe called
after the DOM tree is modified even though it's a bug. Therefore, we should
make it store first result and return its reference instead.
Depends on D82700
Assignee | ||
Comment 10•4 years ago
|
||
It's simpler to make WSRunScanner::InsertText()
take insertion point.
Then, it can do its jobs with TextFragmentData
instance(s).
Depends on D82701
Assignee | ||
Comment 11•4 years ago
|
||
Now, mScanEndPoint
is not used. This patch removes it and clean up the
constructors of WSRunScanner
and WSRunObject
.
Depends on D82702
Assignee | ||
Comment 12•4 years ago
|
||
Depends on D82703
Assignee | ||
Comment 13•4 years ago
|
||
It's now can work with static helper methods and a TextFragmentData
instance.
Therefore, this patch makes it a static method.
Note that it's always called with nsIEditor::eNone
so that we can get rid of
the argument.
Depends on D82704
Assignee | ||
Comment 14•4 years ago
|
||
Depends on D82705
Assignee | ||
Comment 15•4 years ago
|
||
Depends on D82706
Assignee | ||
Comment 16•4 years ago
|
||
Depends on D82707
Assignee | ||
Comment 17•4 years ago
|
||
Depends on D82708
Assignee | ||
Comment 18•4 years ago
|
||
Now, it does not need to be a WSRunObject
instance so that its wrapper to
create WSRunObject
instance is not necessary.
Depends on D82709
Assignee | ||
Comment 19•4 years ago
|
||
Similar to the previous patch, WSRunObject::NormalizeWhiteSpacesAround()
is
a wrapper to create WSRunObject
instance for calling
NormalizeWhiteSpacesAtEndOf()
, but it does not need to be WSRunObject
's
instance. Therefore, we can merge them.
Note that this renames the merged method to NormalizeVisibleWhiteSpacesAt
.
Depends on D82710
Assignee | ||
Comment 20•4 years ago
|
||
Now, all member methods of WSRunObject
are static. So, it shouldn't
be able to instantiated.
Depends on D82711
Assignee | ||
Comment 21•4 years ago
|
||
Although the new name is long, but I have no better idea. The class's purpose
is to keep white-space visibility around modifying DOM position. Therefore,
I use "keeper" for the name.
Depends on D82712
Assignee | ||
Comment 22•4 years ago
|
||
Now, these classes are used only by TextFragmentData
and they can be not
exposed. Therefore, we should hide them with making them private nested
classes of TextFragmentData
.
Depends on D82713
Assignee | ||
Comment 23•4 years ago
|
||
Depends on D82714
Assignee | ||
Updated•4 years ago
|
Comment 24•4 years ago
|
||
Comment 25•4 years ago
|
||
Comment 26•4 years ago
|
||
bugherder |
Comment 27•4 years ago
|
||
Comment 28•4 years ago
|
||
Comment 29•4 years ago
|
||
Comment 30•4 years ago
|
||
Comment 31•4 years ago
|
||
Comment 32•4 years ago
|
||
bugherder |
Comment 33•4 years ago
|
||
Comment 34•4 years ago
|
||
bugherder |
Comment 35•4 years ago
|
||
bugherder |
Comment 36•4 years ago
|
||
Comment 37•4 years ago
|
||
Comment 38•4 years ago
|
||
Comment 39•4 years ago
|
||
bugherder |
Comment 40•4 years ago
|
||
Comment 41•4 years ago
|
||
bugherder |
Comment 42•4 years ago
|
||
Comment 43•4 years ago
|
||
Comment 44•4 years ago
|
||
Comment 45•4 years ago
|
||
Comment 46•4 years ago
|
||
bugherder |
Comment 47•4 years ago
|
||
bugherder |
Comment 48•4 years ago
|
||
Comment 49•4 years ago
|
||
bugherder |
Comment 50•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 51•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2845e156ce45
https://hg.mozilla.org/mozilla-central/rev/bcef72851157
https://hg.mozilla.org/mozilla-central/rev/977da8bc0c21
https://hg.mozilla.org/mozilla-central/rev/e3bfcfb8feb3
Description
•