Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(753)

Issue 242733004: canMergeLists() should make sure that the list items do not belong to the same list (Closed)

Created:
6 years, 8 months ago by vanihegde
Modified:
6 years, 7 months ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

canMergeLists() should make sure that the list items do not belong to the same list This issue is reproduced only when list is the only visible element present. In this case, visible positions after & before the list's parent node would be NULL and hence are treated as equal. Because of this, isVisiblyAdjacent() and therefore canMergeLists() would return true. This results in invoking mergeIdenticalElements where things go wrong as we try to delete the second list and add its content to first list, while we actually have only one list and should be merging the list items of the same list. In canMergeLists(), calling isVisiblyAdjacent(positionInParentAfterNode(*firstList), positionInParentBeforeNode(*secondList) makes sense only if firstList & secondList are different lists. Hence, before invoking isVisiblyAdjacent() we need to check if the lists are identical in which case return false from canMergeLists(). BUG=362463 TEST=LayoutTests/editing/deleting/merge-list-items-in-same-list.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=172941

Patch Set 1 #

Total comments: 4

Patch Set 2 : Review comments incorporated #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -0 lines) Patch
A LayoutTests/editing/deleting/merge-list-items-in-same-list.html View 1 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/editing/deleting/merge-list-items-in-same-list-expected.txt View 1 1 chunk +11 lines, -0 lines 0 comments Download
M Source/core/editing/DeleteSelectionCommand.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
vanihegde
Please note that I have intentionally omitted <p id="description">....</p> in the test case, as this ...
6 years, 8 months ago (2014-04-21 11:31:25 UTC) #1
yosin_UTC9
https://codereview.chromium.org/242733004/diff/1/LayoutTests/editing/deleting/merge-list-items-in-same-list.html File LayoutTests/editing/deleting/merge-list-items-in-same-list.html (right): https://codereview.chromium.org/242733004/diff/1/LayoutTests/editing/deleting/merge-list-items-in-same-list.html#newcode1 LayoutTests/editing/deleting/merge-list-items-in-same-list.html:1: <!DOCTYPE> nit: Please use "<!DOCTYPE html>" https://codereview.chromium.org/242733004/diff/1/LayoutTests/editing/deleting/merge-list-items-in-same-list.html#newcode9 LayoutTests/editing/deleting/merge-list-items-in-same-list.html:9: var ...
6 years, 8 months ago (2014-04-22 04:42:52 UTC) #2
vanihegde
On 2014/04/22 04:42:52, Yoshi wrote: > https://codereview.chromium.org/242733004/diff/1/LayoutTests/editing/deleting/merge-list-items-in-same-list.html > File LayoutTests/editing/deleting/merge-list-items-in-same-list.html (right): > > https://codereview.chromium.org/242733004/diff/1/LayoutTests/editing/deleting/merge-list-items-in-same-list.html#newcode1 > ...
6 years, 8 months ago (2014-04-22 04:57:51 UTC) #3
yosin_UTC9
On 2014/04/22 04:57:51, vanihegde wrote: > https://codereview.chromium.org/242733004/diff/1/LayoutTests/editing/deleting/merge-list-items-in-same-list.html#newcode9 > > LayoutTests/editing/deleting/merge-list-items-in-same-list.html:9: var li = > > ...
6 years, 8 months ago (2014-04-22 05:34:19 UTC) #4
vani
Sorry for the delay, I have made changes as per above comments. PTAL.
6 years, 7 months ago (2014-04-28 10:49:00 UTC) #5
yosin_UTC9
ACK +yutak@ as OWNER
6 years, 7 months ago (2014-04-30 01:46:25 UTC) #6
ojan
lgtm https://codereview.chromium.org/242733004/diff/1/LayoutTests/editing/deleting/merge-list-items-in-same-list.html File LayoutTests/editing/deleting/merge-list-items-in-same-list.html (right): https://codereview.chromium.org/242733004/diff/1/LayoutTests/editing/deleting/merge-list-items-in-same-list.html#newcode9 LayoutTests/editing/deleting/merge-list-items-in-same-list.html:9: var li = document.getElementById("li"); On 2014/04/22 04:42:52, Yoshi ...
6 years, 7 months ago (2014-04-30 01:59:59 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vani.hegde@samsung.com/242733004/10001
6 years, 7 months ago (2014-04-30 02:01:38 UTC) #8
commit-bot: I haz the power
6 years, 7 months ago (2014-04-30 05:13:29 UTC) #9
Message was sent while issue was closed.
Change committed as 172941

Powered by Google App Engine
This is Rietveld 408576698