InsertOrderedList command applied to table cells inserts an extra BR before the table
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jul 2017 09:48:37 +0000 (09:48 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jul 2017 09:48:37 +0000 (09:48 +0000)
commit4af41c6a93454f256d39de192b67d30a575ed1de
tree6bd96d12783c6299059784653eb0e7fcb15d7d81
parentfee4e829474bbe6abb936177ef5fade51549e614
InsertOrderedList command applied to table cells inserts an extra BR before the table
https://bugs.webkit.org/show_bug.cgi?id=174593

Reviewed by Darin Adler.

Source/WebCore:

Don't add BR when pruning empty blocks if it's the start of a paragraph.

The function MoveParagraph is used for several operations and editing
commands, like 'insertOrderedList'. When moving paragraphs we check out
whether we should add a 'br' element to avoid undesired block collapse.

However, we shouldn't do this when destination is the start of a
paragraph.

Tests: editing/inserting/insert-list-in-table-cell-01.html
       editing/inserting/insert-list-in-table-cell-02.html
       editing/inserting/insert-list-in-table-cell-03.html
       editing/inserting/insert-list-in-table-cell-04.html
       editing/inserting/insert-list-in-table-cell-05.html
       editing/inserting/insert-list-in-table-cell-06.html
       editing/inserting/insert-list-in-table-cell-07.html
       editing/inserting/insert-list-in-table-cell-08.html

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):

LayoutTests:

Tests to verify that the insertOrderedList command works as expected when applied
in table cells.

* editing/inserting/insert-list-in-table-cell-01.html: Added.
* editing/inserting/insert-list-in-table-cell-01-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-02.html: Added.
* editing/inserting/insert-list-in-table-cell-02-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-03.html: Added.
* editing/inserting/insert-list-in-table-cell-03-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-04.html: Added.
* editing/inserting/insert-list-in-table-cell-04-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-05.html: Added.
* editing/inserting/insert-list-in-table-cell-05-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-06.html: Added.
* editing/inserting/insert-list-in-table-cell-06-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-07.html: Added.
* editing/inserting/insert-list-in-table-cell-07-expected.txt: Added.
* editing/inserting/insert-list-in-table-cell-08.html: Added.
* editing/inserting/insert-list-in-table-cell-08-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/inserting/insert-list-in-table-cell-01-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-01.html [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-02-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-02.html [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-03-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-03.html [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-04-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-04.html [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-05-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-05.html [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-06-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-06.html [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-07-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-07.html [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-08-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-list-in-table-cell-08.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/editing/CompositeEditCommand.cpp