[Midas] execCommand(indent) should place the ul inside li, not ul inside ul
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
thunderbird_esr68 | --- | affected |
People
(Reporter: JoWie, Unassigned)
References
Details
Attachments
(2 files)
564 bytes,
text/html
|
Details | |
11.91 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2b1) Gecko/20091029 Firefox/3.6b1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2b1) Gecko/20091029 Firefox/3.6b1 When using execCommand(indent) on a list, an ul/ol is placed directly under the parent ul/ol. This is invalid HTML 4 strict: http://www.w3.org/TR/html4/struct/lists.html#edef-UL Related to bug 485466 Reproducible: Always Steps to Reproduce: 1. Goto http://www.mozilla.org/editor/midasdemo/ 2. Create a list with 2 items 3. Indent the second item 4. View the source Actual Results: <ul> <li>First</li> <ul> <li>Second</li> </ul> </ul> Expected Results: <ul> <li>First <ul> <li>Second</li> </ul> </li> </ul>
Comment 1•14 years ago
|
||
All major browsers have this behaviour.
Comment 2•12 years ago
|
||
And the editing spec requires it. The markup is invalid, though: <https://www.w3.org/Bugs/Public/show_bug.cgi?id=12609>
Comment 3•5 years ago
|
||
This came up in bug 1548753. The invalid markup has the effect that we get unexpected list numbers because we're now using the CSS built-in 'list-item' counter for HTML lists (which means an <ol> affects any sibling <li>s after it).
Comment 4•5 years ago
|
||
The HTML spec is quite clear that only <li>
s (and <script>
) are valid inside <ol>
:
https://html.spec.whatwg.org/multipage/grouping-content.html#the-ol-element
(ditto for <ul>
and <menu>
)
So we should fix this...
Comment 5•5 years ago
|
||
Wrapping the child <ol>
we're currently inserting in a <li style="display:block">
might be a solution?
I guess we'd need to account for this in the "outdent" command though?
Feel free to take it from here...
(BTW, there's an amazing amount of copy-pasted code between IndentAroundSelectionWithHTML and IndentAroundSelectionWithCSS which we probably should share...)
Comment 6•5 years ago
|
||
Currently, we cannot fix this bug at least for now since the other browsers also behave so. Therefore, fixing this bug may cause web-compat issue. If we need to fix this, you need to ask Google and Apple about this issue first.
Comment 7•5 years ago
|
||
Fair enough, do we have any contacts there that are working on execCommand/editor code?
Given the state of the execCommand spec is effectively "abandoned" we should probably try to remove these commands from the web platform. Again, this requires vendor coordination of course.
Updated•4 years ago
|
Updated•4 years ago
|
Description
•