Source/WebCore/ChangeLog

 12012-04-04 Yi Shen <yi.4.shen@nokia.com>
 2
 3 Pressing enter on blank line after bullet deletes entire bulleted line.
 4 https://bugs.webkit.org/show_bug.cgi?id=82690
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 In CompositeEditCommand::breakOutOfEmptyListItem(), it checks the empty list item's renderer's siblings
 9 to decide which empty part of the list should be removed. However, if the empty list item's renderer is
 10 wrapped by an anonymous block, e.g. <ul><li>hello</li><br>^</ul>, we should use the anonymous renderer
 11 instead.
 12
 13 No new tests : added new test case in the existing test (break-out-of-empty-list-item.html)
 14
 15 * editing/CompositeEditCommand.cpp:
 16 (WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
 17
1182012-04-04 Alexis Menard <alexis.menard@openbossa.org>
219
320 Re-add variable names in CSS related headers to help understanding the meaning of them.
113187

Source/WebCore/editing/CompositeEditCommand.cpp

@@bool CompositeEditCommand::breakOutOfEmp
12671267 if (!newBlock)
12681268 newBlock = createDefaultParagraphElement(document());
12691269
1270  if (emptyListItem->renderer()->nextSibling()) {
 1270 RenderObject* emptyListItemRenderer = emptyListItem->renderer();
 1271 // If the emptyListItem's renderer is wrapped by an anonymous block, e.g. <ul><li>hello</li><br>^</ul>, use the anonymous renderer instead.
 1272 while (!emptyListItemRenderer->nextSibling() && !emptyListItemRenderer->previousSibling()
 1273 && emptyListItemRenderer->parent() && emptyListItemRenderer->parent()->isAnonymousBlock())
 1274 emptyListItemRenderer = emptyListItemRenderer->parent();
 1275
 1276 if (emptyListItemRenderer->nextSibling()) {
12711277 // If emptyListItem follows another list item, split the list node.
1272  if (emptyListItem->renderer()->previousSibling())
 1278 if (emptyListItemRenderer->previousSibling())
12731279 splitElement(static_cast<Element*>(listNode), emptyListItem);
12741280
12751281 // If emptyListItem is followed by other list item, then insert newBlock before the list node.

@@bool CompositeEditCommand::breakOutOfEmp
12811287 // When emptyListItem does not follow any list item, insert newBlock after the enclosing list node.
12821288 // Remove the enclosing node if emptyListItem is the only child; otherwise just remove emptyListItem.
12831289 insertNodeAfter(newBlock, listNode);
1284  removeNode(emptyListItem->renderer()->previousSibling() ? emptyListItem : listNode);
 1290 removeNode(emptyListItemRenderer->previousSibling() ? emptyListItem : listNode);
12851291 }
12861292
12871293 appendBlockPlaceholder(newBlock);
113181

LayoutTests/ChangeLog

 12012-04-04 Yi Shen <yi.4.shen@nokia.com>
 2
 3 Pressing enter on blank line after bullet deletes entire bulleted line.
 4 https://bugs.webkit.org/show_bug.cgi?id=82690
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 In CompositeEditCommand::breakOutOfEmptyListItem(), it checks the empty list item's renderer's siblings
 9 to decide which empty part of the list should be removed. However, if the empty list item's renderer is
 10 wrapped by an anonymous block, e.g. <ul><li>hello</li><br>^</ul>, we should use the anonymous renderer
 11 instead.
 12
 13 * editing/execCommand/break-out-of-empty-list-item-expected.txt:
 14 * editing/execCommand/script-tests/break-out-of-empty-list-item.js:
 15
116
217 Unreviewed. Layout Test fast/canvas/canvas-toDataURL-webp.html is crashing
318 https://bugs.webkit.org/show_bug.cgi?id=81735
113187

LayoutTests/editing/execCommand/break-out-of-empty-list-item-expected.txt

@@PASS enterAtTarget('<ul><li>hello<ul><li
1010PASS enterAtTarget('<ul><li>hello<ul><li id="target"><br></li></ul></li></ul>') is '<ul><li>hello</li><li><br></li></ul>'
1111PASS enterAtTarget('<ul><li><ul><li id="target"><br></li></ul>world</li></ul>') is '<ul><li><div><br></div>world</li></ul>'
1212PASS enterAtTarget('<ul><li><ul><li id="target"><br></li></ul></li></ul>') is '<ul><li></li><li><br></li></ul>'
 13PASS enterAtTarget('<ul><li>hello</li><br id="target"></ul>') is '<ul><li>hello</li></ul><div><br></div>'
 14PASS enterAtTarget('<ul><br id="target"></ul>') is '<div><br></div>'
1315PASS successfullyParsed is true
1416
1517TEST COMPLETE
113181

LayoutTests/editing/execCommand/script-tests/break-out-of-empty-list-item.js

@@testBreakOutOfEmptyListItem('<ul><li>hel
4949testBreakOutOfEmptyListItem('<ul><li>hello<ul><li id="target"><br></li></ul></li></ul>', '<ul><li>hello</li><li><br></li></ul>');
5050testBreakOutOfEmptyListItem('<ul><li><ul><li id="target"><br></li></ul>world</li></ul>', '<ul><li><div><br></div>world</li></ul>');
5151testBreakOutOfEmptyListItem('<ul><li><ul><li id="target"><br></li></ul></li></ul>', '<ul><li></li><li><br></li></ul>');
 52testBreakOutOfEmptyListItem('<ul><li>hello</li><br id="target"></ul>', '<ul><li>hello</li></ul><div><br></div>');
 53testBreakOutOfEmptyListItem('<ul><br id="target"></ul>', '<div><br></div>');
5254
5355document.body.removeChild(testContainer);
5456
113181