Remove unnecessary `InsertPaddingBRElementIfNeeded` callers if it's inserted only for making the trailing white-space visible
Categories
(Core :: DOM: Editor, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox142 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(2 files)
It's also used for making empty block has one-line-height. Therefore, we may not be able to delete the callers a lot, but at least the inserting content handlers don't need it, I guess.
| Assignee | ||
Comment 1•1 year ago
|
||
It seems that the method callers keep calling it for putting a <br> for making an empty block visible. However, we can make the helper methods of it stop handling collapsible white-spaces.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
The new white-space normalizer always makes the last white-space as
an NBSP if it should be visible but white-spaces are collapsible.
Therefore, the method won't be used for putting a padding <br> to
make the preceding collapsible white-space visible. So, it does not
need to check the case anymore.
| Assignee | ||
Comment 3•1 year ago
|
||
HTMLEditUtils::GetElementOfImmediateBlockBoundary() refers
CharacterData::TextIsOnlyWhitespace(), but it may return false if
the text node is marked as "may have non-ASCII character" [1].
Therefore, it should scan the text data correctly. This patch adds
nsTextFragment methods for faster scan. The behavior is based on
FindChar() and RFindChar() of the XPCOM string classes especially
about the start offset.
We should make HTMLEditor code use the new methods more in a follow
up bug.
Comment 5•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/9b04407fbce0
https://hg.mozilla.org/mozilla-central/rev/9bd068fe45e0
Updated•1 year ago
|
Description
•