Clean up `HTMLEditor::TryToJoinBlocksWithTransaction()`
Categories
(Core :: DOM: Editor, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(7 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 |
It's made from 4 block, one is preparation, the others join 2 blocks, one of them is for the case when left block is a descendant of right block, next one is for the case when right block is a descendant of left block, the last one is for the case when they are siblings or similar. The last 3 blocks extend deletion range to delete invisible white-spaces. For understanding them deeper, I wrote patches to split these blocks.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
And the name is wrong. It depends on aPoint
whether the <br>
element is
visible or invisible because it just scans preceding <br>
element but
stop doing it when it meets a visible content. Therefore, this patch renames
it to explain what it does.
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D85528
Assignee | ||
Comment 3•4 years ago
|
||
Now, the new method,
WhiteSpaceVisibilityKeeper::MergeFirstLineOfRightBlockElementIntoLeftBlockElement()
is the only user of the method so that we can get rid of it since it does enough
simple thing.
Depends on D85529
Assignee | ||
Comment 4•4 years ago
|
||
rightListElement
is not used, so, we can put it into smaller scope.
leftListElement
is used for storing original leftBlockElement
when
newListElementTagNameOfRightListElement
is some. Therefore, we can
stop using it with caching the original leftBlockElement
before
maybe modified its value.
Depends on D85530
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D85531
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D85532
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D85533
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/e6609ce56edc part 1-1: Move `HTMLEditor::GetInvisibleBRElementAt()` to `WSRunScanner` r=m_kato https://hg.mozilla.org/integration/autoland/rev/578e7eee6309 part 1-2: Move last part of `HTMLEditor::TryToJoinBlocksWithTransaction()` to `WhiteSpaceVisibilityKeeper` r=m_kato https://hg.mozilla.org/integration/autoland/rev/aca4cf510bef part 1-3: Get rid of `WhiteSpaceVisibilityKeeper::PrepareToJoinNodes()` r=m_kato https://hg.mozilla.org/integration/autoland/rev/d7da635ceb47 part 2-1: Make `HTMLEditor::TryToJoinBlocksWithTransaction()` stop using `leftListElement` and `rightListElement` after initializing `newListElementTagNameOfRightListElement` r=m_kato https://hg.mozilla.org/integration/autoland/rev/c46442c200e9 part 2-2: Move 2nd block of `HTMLEditor::TryToJoinBlocksWithTransaction()` into `WhiteSpaceVisibilityKeeper` r=m_kato https://hg.mozilla.org/integration/autoland/rev/7118f540a471 part 3-1: Move the last block of `HTMLEditor::TryToJoinBlocksWithTransaction()` into `WhiteSpaceVisibilityKeeper` r=m_kato https://hg.mozilla.org/integration/autoland/rev/7dd2d86abbe3 part 3-2: Move `AutoTransactionsConserveSelection` in `HTMLEditor::TryToJoinBlocksWithTransaction()` into each `WhiteSpaceVisibilityKeeper` method r=m_kato
Comment 9•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e6609ce56edc
https://hg.mozilla.org/mozilla-central/rev/578e7eee6309
https://hg.mozilla.org/mozilla-central/rev/aca4cf510bef
https://hg.mozilla.org/mozilla-central/rev/d7da635ceb47
https://hg.mozilla.org/mozilla-central/rev/c46442c200e9
https://hg.mozilla.org/mozilla-central/rev/7118f540a471
https://hg.mozilla.org/mozilla-central/rev/7dd2d86abbe3
Description
•