`vertical-align` style should be removed when `execCommand("superscript")` or `execCommand("subscript")` for making `<sup>` and `<sub>` work cleanly
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox109 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
execCommand("superscript")
and execCommand("subscript")
are handled specially.
<sup>
and <sub>
are exclusive. Therefore, existing element is removed first.
However, they are not mapped to CSS due to bug 394304 comment 2 even though the behavior is different from the other browsers. On the other hand, the other browsers remove (potentially) conflicting vertical-align
styles around selected range. This makes sense and matches with the above special handling. Therefore, we should follow it. Then, we can get better result after applying patches for bug 1792386.
Assignee | ||
Comment 1•2 years ago
|
||
execCommand("superscript")
and execCommand("subscript")
are handled
specially.
<sup>
and <sub>
are exclusive. Therefore, existing element is removed first.
However, they are not mapped to CSS due to bug 394304 comment 2 even though the
behavior is different from the other browsers. Therefore, Gecko does not remove
vertical-align
styles from selected ranges. On the other hand, the other
browsers do it. This makes sense and matches with the handling in HTML mode.
Therefore, we should remove vertical-align
style around the selection ranges.
Note that this updates existing WPTs.
The first block of each command checks how the command work with similar
<span>
having vertical-align
style. The new expectation matches with the
other browsers (i.e., currently they fail in the other browsers).
The second block of each command checks how the command work with similar
situation but there is a sibling which has the applying style (i.e., <sup>
or <sub>
). These tests keep failing in the other browsers since they want
to update vertical-align
style at the selected range in the <span>
having
vertical-align
style.
Anyway, this fix is for avoiding new WPT failures of fixing bug 1792386, and
these commands must not be used so widely especially in the CSS mode.
Therefore, I believe that this change is not so risky.
Depends on D163183
Comment 4•2 years ago
|
||
bugherder |
Description
•