Bug 203961
| Summary: | [GTK] Style toggling using editing commands produces incorrect output | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Milan Crha <mcrha> |
| Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bugs-noreply |
| Priority: | P2 | ||
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=271820 | ||
Milan Crha
What I want to achieve:
Write "000" in normal font, then
write "111" in B+I+U+S, then
write "222" in B+U, by turning off I+S
I do this in WebKit Inspector with:
document.body.contentEditable = true;
document.body.innerHTML = "";
document.execCommand("insertText", false, "000");
document.execCommand("Bold", false, "");
document.execCommand("Italic", false, "");
document.execCommand("Underline", false, "");
document.execCommand("StrikeThrough", false, "");
document.execCommand("insertText", false, "111");
document.execCommand("Italic", false, "");
document.execCommand("StrikeThrough", false, "");
document.execCommand("insertText", false, "222");
Webkit produces HTML, which:
draws "000" in normal font, then
draws "111" in B+I+U, the 'S' is missing, then
draws "222" in B, the 'U' is missing.
The HTML code looks like:
000<b><strike style="font-style: italic; text-decoration: underline;">111</strike>222</b>
---------------------------------------------------------------
When I execute the same code in Firefox (67.0), it works as expected and generates this HTML code:
000<strike><u><i><b>111</b></i></u></strike><u><b>222</b></u>
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |