Make `WSRunScanner` create `WSFragment`s only when needed
Categories
(Core :: DOM: Editor, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
(Whiteboard: [h2review-noted])
Attachments
(6 files, 8 obsolete 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 |
In most WSRunScanner
methods, WSFragment
s are not used, but they are initialized when WSRunScanner
is created. For stopping unnecessary things, WSRunScanner
should create part of them or all of them when they are needed.
Assignee | ||
Comment 1•4 years ago
|
||
Part 1-* rewrite WSRunScanner::GetRuns()
with early-return style, but it's
hard to review if changing it with a patch.
This just swaps the if
and else
block because the else
block is
shorter than the if
block.
Depends on D79973
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D80311
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D80312
Assignee | ||
Comment 4•4 years ago
|
||
WSFragment
is created at least one instance, and at most 3 instances per
WSRunScanner
instance. They can be managed with AutoTArray
simpler and
we can avoid heap allocation with this approach.
Depends on D80313
Assignee | ||
Comment 5•4 years ago
|
||
Now, WSFragment
is managed by AutoTArray
so that it does not need to
be double-linked-list.
Depends on D80314
Assignee | ||
Comment 6•4 years ago
|
||
The last fragment which is for trailing white-spaces can be created with
previous fragment and end boundary data. Therefore, we can make WSFragment
create it by itself with taking WSRunScanner::mEnd
.
Depends on D80315
Assignee | ||
Comment 7•4 years ago
|
||
Similarly, it can handle 2nd fragment which is needed for leading white-spaces.
Depends on D80316
Assignee | ||
Comment 8•4 years ago
|
||
Depends on D80317
Assignee | ||
Comment 9•4 years ago
|
||
Depends on D80318
Assignee | ||
Comment 10•4 years ago
|
||
Depends on D80319
Assignee | ||
Comment 11•4 years ago
|
||
Unfortunately, in both CreateFirstOne()
and CreateNextOne()
, a lot of
checks are duplicated for avoiding to create unnecessary fragments. They
will be sorted out in the following patch.
Depends on D80320
Assignee | ||
Comment 12•4 years ago
|
||
Unfortunately, mRightWSType
may be different from end reason. Therefore,
the checker methods need to take end BoundaryData
.
Depends on D80321
Assignee | ||
Comment 13•4 years ago
|
||
In most methods of WSRunScanner
, WSFragment
s are never used. Therefore,
this patch makes them created when they are necessary.
Depends on D80322
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 14•4 years ago
|
||
Assignee | ||
Comment 15•4 years ago
|
||
In most methods of WSRunScanner
, WSFragment
s are never used. Therefore,
this patch makes them created when they are necessary.
Depends on D80315
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
bugherder |
Comment 18•4 years ago
|
||
Comment 19•4 years ago
|
||
Comment 20•4 years ago
|
||
Comment 21•4 years ago
|
||
Comment 22•4 years ago
|
||
bugherder |
Comment 23•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Description
•