[Webkit-unassigned] [Bug 36430] New: InsertListCommand needs cleanup
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Mar 21 15:53:34 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=36430
Summary: InsertListCommand needs cleanup
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P2
Component: HTML Editing
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: rniwa at webkit.org
Currently, InsertListCommand has three major problems:
1. If the selection contains more than one paragraphs, modifyRange() loops over
each paragraph and calls doApply. This is very misleading because doApply()
and modifyRange() aren't really mutually recursive functions (doApply() calls
modifyRange() at most once when doApply() is called for the first time).
2. doApply() has two parts; the first part removes the child node and the
second part adds list. Although there are cases in which we remove a list
element and add a different type of list element later, two parts are
sufficiently isolated and they should be separate functions.
3. IndentOutdentCommand and InsertListCommand implements very similar features
but do not share much code. IndentOutdentCommand adds and removes list just
like InsertListCommand, and the only difference is that InsertListCommand
sometimes needs to wrap a paragraph with LI whereas IndentOutdentCommand wraps
with a blockquote in such cases. Two classes should share more code.
Proposal: we first divide doApply into two separate functions/methods. We then
move the code inside of modifyRange into doApply. We can then combine code in
IndentOutdentCommand and InsertListCommand.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list