Closed
Bug 108035
Opened 23 years ago
Closed 22 years ago
Content out of order when making list of Divs and Table elements
Categories
(Core :: DOM: Editor, defect, P3)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
mozilla1.0
People
(Reporter: kinmoz, Assigned: mozeditor)
References
Details
(Whiteboard: EDITORBASE+ 1 day [adt2 RTM]; fixinhand)
Attachments
(2 files)
80 bytes,
text/html
|
Details | |
2.74 KB,
patch
|
glazou
:
review+
kinmoz
:
superreview+
|
Details | Diff | Splinter Review |
So if I have the following content in composer: This<div>Is</div><div>Some</div><div>List</div>Fun! it appears on screen like this: This Is Some List Fun! If I select all of the content and hit the list button, I get one list item that looks like this: * ThisFun!ListSomeIs Some peculiar things about this: 1. Why are we not treating divs as blocks and giving them their own list item? It looks like we are pulling out the div and table element contents and putting them directly in the list of nodes we are operating on in WillMakeList(). 2. It seems that GetListActionNodes() can actually cause the reordering of content in the array of nodes when they are divs or table elements, because it always appends them to the end of the array after they've stripped off the div/table element container.
Whoops I didn't mean to put empty lines between each of the words above in the section "it appears on screen like this:" it should look like this: This Is Some List Fun!
Status: NEW → ASSIGNED
Priority: -- → P3
Whiteboard: EDITORBASE 1 day
Target Milestone: --- → mozilla0.9.6
--> mozilla0.9.7
Target Milestone: mozilla0.9.6 → mozilla0.9.7
--> mozilla0.9.8
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Comment 8•22 years ago
|
||
Reassigning to Daniel, since Kin is overloaded with EDITORBASE+ bugs.
Assignee: kin → glazman
Status: ASSIGNED → NEW
Looks like the ordering problem is fixed .. we're still putting everything in a single list item though.
accepting bug
Status: NEW → ASSIGNED
strange... i never received the bugmails relative to this bug, including reassignment.
Ok I see. The root of the problem is in http://lxr.mozilla.org/seamonkey/source/editor/libeditor/html/nsHTMLEditRules.cpp#5286 We just cannot remove the nsHTMLEditUtils::IsDiv(testNode) test because of the following example : <div>a first line of text <ul> <li>first item</li> <li>second item</li> </ul> </div> select all and click on ordered list button. You want the whole thing to become a single ordered list. If I remove the test above, the whole DIV will be inserted into the first item of an ordered list. This issue is trickier than we thought, I am afraid.
I think I found the cleanest way to solve the bug... If the last node of a div we trying to put into a list is a text node, append a br after it. It should solve all problems.
Assignee | ||
Comment 14•22 years ago
|
||
why am i not surprised. hmmm. One possibility is to change the loop that daniel indicates to append a null element to the list everytime we call GetInnerContent(). Then we could change WillMakeList(), etc, to interpret null elements in the list as a signal to create a new block {list item, etc} for further content. Hackish, yes, but fairly simple.
Comment 15•22 years ago
|
||
adt2 for the partial fix
Whiteboard: EDITORBASE+ 1 day → EDITORBASE+ 1 day [adt2]
Assignee | ||
Comment 16•22 years ago
|
||
assigning to me at daniels request
Assignee: glazman → jfrancis
Status: ASSIGNED → NEW
Assignee | ||
Comment 17•22 years ago
|
||
This should fix it.
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Whiteboard: EDITORBASE+ 1 day [adt2] → EDITORBASE+ 1 day [adt2]; fixinhand; need r=sr=
Reporter | ||
Comment 18•22 years ago
|
||
Comment on attachment 82424 [details] [diff] [review] patch to nsHTMLEditRules.cpp sr=kin@netscape.com
Attachment #82424 -
Flags: superreview+
Whiteboard: EDITORBASE+ 1 day [adt2]; fixinhand; need r=sr= → EDITORBASE+ 1 day [adt2]; fixinhand; need r=
Assignee | ||
Comment 19•22 years ago
|
||
fixed on trunk
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 22•22 years ago
|
||
sorry, its late, and i am tired. but, did i miss something here. who r= this bug before it went into the trunk? Removing adt1.0.0, for now, until there is a r=.
Assignee | ||
Comment 23•22 years ago
|
||
I can't remember who r'd. Daniel, can you r= this?
I confirm that I told r=glazman *before* this fix was checked in during an IRC conversation with Joe.
Comment on attachment 82424 [details] [diff] [review] patch to nsHTMLEditRules.cpp r=glazman, as said a month ago during an IRC discussion with Joe
Attachment #82424 -
Flags: review+
Updated•22 years ago
|
Whiteboard: EDITORBASE+ 1 day [adt2 RTM]; fixinhand; need r= → EDITORBASE+ 1 day [adt2 RTM]; fixinhand
Comment 26•22 years ago
|
||
nsbeta1-. The fix is too risky for the 1.0 branch.
You need to log in
before you can comment on or make changes to this bug.
Description
•