Bug 748308 - Support insertParagraph and insertLineBreak per spec/Blink/WebKit; r=masayuki

Previously we supported insertParagraph as a synonym for formatBlock
"p", which is both useless and incompatible with all other browsers.
Edge's behavior doesn't look useful and looks redundant with insertHTML
(although it matches the name nicely, probably because they invented
the command).  Blink/WebKit treat it the same as hitting Enter, which is
useful for cross-browser testing until we get synthesizeKey() in wpt.

At the same time, I added insertLineBreak, which Blink/WebKit support
with the same functionality as pressing Shift-Enter.

The new event.html failures are spurious -- we used to pass by mistake
because we didn't support insertlinebreak at all.  insertlinebreak.html
has only new passes, no new failures, although it's not clear on the
diff.

MozReview-Commit-ID: 16oPcxXwGcj
This commit is contained in:
Aryeh Gregor
2016-08-21 16:33:07 +03:00
parent 0e511f9848
commit 289f7ddcac
9 changed files with 132 additions and 2932 deletions

View File

@@ -2938,7 +2938,8 @@ static const struct MidasCommand gMidasCommandTable[] = {
{ "unlink", "cmd_removeLinks", "", true, false },
{ "insertorderedlist", "cmd_ol", "", true, false },
{ "insertunorderedlist", "cmd_ul", "", true, false },
{ "insertparagraph", "cmd_paragraphState", "p", true, false },
{ "insertparagraph", "cmd_insertParagraph", "", true, false },
{ "insertlinebreak", "cmd_insertLineBreak", "", true, false },
{ "formatblock", "cmd_paragraphState", "", false, false },
{ "heading", "cmd_paragraphState", "", false, false },
{ "styleWithCSS", "cmd_setDocumentUseCSS", "", false, true },