Summary: | [CSS Regions] renderer is attached improperly when undo affects a node inside a flow thread | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Pravin D <pravind.2k4> | ||||||
Component: | Layout and Rendering | Assignee: | Pravin D <pravind.2k4> | ||||||
Status: | RESOLVED DUPLICATE | ||||||||
Severity: | Normal | CC: | abucur, jchaffraix, rniwa, WebkitBugTracker | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | 103501 | ||||||||
Bug Blocks: | 57312 | ||||||||
Attachments: |
|
Description
Pravin D
2012-11-23 10:49:47 PST
Created attachment 175828 [details]
TestCase
The issue is due to the fact that in case of text nodes which get inserted into anonymous block, insertbefore does not work properly. When Indent button is pressed, the nodes from <div class="artical" contenteditable="true"> are removed in the order "Non-Workingcase1", <br>, "Non-Workingcase2" and placed inside htmlQuote elem. When Undo button is pressed, the reverse should happen. The content from htmlquote is removed and inserted into the original div, in the reverse order. (Skipping the node removals) "Non-Workingcase 2" is first inserted to div. As its a text node, an Anonymous Block is created. Then an attempt to insert <br > before "Non-Workingcase 2 " is made. While doing so "Non-Workingcase 2 " 's renderer is queried to check if its part of same flow thread as <div class="artical" contenteditable="true"> . However as the parent of "Non-Workingcase2 " is an Anonymous Block , flow thread info is not set and results in a mismatch. So the renderer before which <br> must be inserted comes null. Which results in <br> being appended to the Anonymous Block .... {"Non-Workingcase 2 " , <br> } . When an attemp to insert "Non-Workingcase 1" before <br> is made, it succeeds as <br> does not have any flowthread info, n proper renderer is returmed resulting in {"Non-Workingcase 2 " , "Non-Workingcase 1", <br> } . Will try n upload a better testcase. (In reply to comment #2) > Then an attempt to insert <br > before "Non-Workingcase 2 " is made. While doing so "Non-Workingcase 2 " 's renderer is queried to check if its part of same flow thread as <div class="artical" contenteditable="true">. Who does this check? (In reply to comment #3) > (In reply to comment #2) > > Then an attempt to insert <br > before "Non-Workingcase 2 " is made. While doing so "Non-Workingcase 2 " 's renderer is queried to check if its part of same flow thread as <div class="artical" contenteditable="true">. > > Who does this check? > The check is done in nextRenderer() in NodeRenderingContext.cpp . if (renderer->style() && !renderer->style()->flowThread().isEmpty()) continue; However the fix need not be here. I think I'll submit a sample patch, so that we'll have more context to discuss the issue. Thank you Rniwa Created attachment 176328 [details]
Same issue different repro?
I don't understand this bug. Undo/redo code should not be accessing renderer at all other than to check its editability. If you're saying that attach/detach doesn't work properly, then that's a layout bug, not an editing bug. (In reply to comment #6) > I don't understand this bug. Undo/redo code should not be accessing renderer at all other than to check its editability. If you're saying that attach/detach doesn't work properly, then that's a layout bug, not an editing bug. > Yes its an layout and rendering bug only. The component is also set to the same. *** This bug has been marked as a duplicate of bug 103501 *** |