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

Issue 104783005: Fix for an issue while breaking out of an empty list item in case of nested lists (Closed)

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

Description

Fix for an issue while breaking out of an empty list item in case of nested lists In case of nested lists, if we break out of the inner list in such a way that it is split into two inner lists, then break out of the first inner list (which lands us in outer list) and then try to break out of the outer list, it fails. Currently, in such scenario we cannot break out of the outer list. This is caused by appendedSublist() called from enclosingEmptyListItem(). In appendedSublist() we check if the next sibling of the list item(of outer list) from which we are trying to break out is a list(second inner list), in this case we will not consider this list item as an empty one. Thus, we cannot break out. Extending the check in appendedSublist() so as to additionally check if the list which is the next sibling of list item from which we are trying to break out is not a descendant of the outer list(to which list item belongs), fixes the issue. i.e. Change the following check in appendedSubList() if (isListElement(n)) return toHTMLElement(n); to if (isListElement(n) && !n->isDescendantOf(enclosingList(listItem))) return toHTMLElement(n); But further analysis seemed to show that the check if (embeddedSublist(listChildNode) || appendedSublist(listChildNode)) return 0; which we do in enclosingEmptyListItem() is not needed. Because in the cases where the list item from which we are trying to break out has an embeddedSublist or appendedSublist we would still want to break out of the list. Getting rid of this check and hence these functions(which are not used anywhere else), fixes the issue. BUG=328037 TEST=LayoutTests/editing/inserting/break-out-of-nested-lists.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164049

Patch Set 1 #

Patch Set 2 : Resubmitting as base file was missing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -27 lines) Patch
A LayoutTests/editing/inserting/break-out-of-nested-lists.html View 1 chunk +29 lines, -0 lines 0 comments Download
A LayoutTests/editing/inserting/break-out-of-nested-lists-expected.txt View 1 chunk +34 lines, -0 lines 0 comments Download
M Source/core/editing/htmlediting.cpp View 2 chunks +0 lines, -27 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
vanihegde
I could not think of any scenario where in we would need the check, if ...
7 years ago (2013-12-12 13:47:57 UTC) #1
yosin_UTC9
Could you upload this patch again? Base file for htmlediting.cpp is missing.
7 years ago (2013-12-13 01:12:07 UTC) #2
vanihegde
On 2013/12/13 01:12:07, Yoshi wrote: > Could you upload this patch again? Base file for ...
7 years ago (2013-12-13 02:59:34 UTC) #3
ojan
lgtm
7 years ago (2013-12-18 01:10:37 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vani.hegde@samsung.com/104783005/20001
7 years ago (2013-12-18 01:10:50 UTC) #5
commit-bot: I haz the power
7 years ago (2013-12-18 04:07:17 UTC) #6
Message was sent while issue was closed.
Change committed as 164049

Powered by Google App Engine
This is Rietveld 408576698