Bug 7904

Summary: Avoid a layout after test insertion and remove isProbablyBlock
Product: WebKit Reporter: Justin Garcia <justin.garcia>
Component: HTML EditingAssignee: Justin Garcia <justin.garcia>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
patch harrison: review+

Description Justin Garcia 2006-03-21 23:50:06 PST
In a plain text paste, we do 3 layouts, one for the test insertion, a second after the test insertion to remove the fragment from the document, and another after the paste is complete.
Leaving the fragment in the document after the test insertion avoids the second layout.  It also lets us get rid of isProbablyBlock.
Comment 1 Justin Garcia 2006-03-22 01:14:38 PST
Created attachment 7226 [details]
patch

I want the ReplacementFragment to be destroyed and the holder removed when the paste is complete, so I made it a local variable inside doApply().  It was previously a member variable of ReplaceSelectionCommand, so it wasn't destroyed until the undo stack was cleared.
Added a layout test that demonstrates why it is important to get rid of isProbablyBlock.  The test does a copy/paste of a selection that starts and ends inside spans with style="display:block".
Comment 2 Justin Garcia 2006-03-22 01:19:44 PST
This patch breaks a layout test: editing/pasteboard/paste-empty-startcontainer.html, but only because it exposes a bug in FrameTree:uniqueChildName, which I filed (7899).  I'll disable that test.
Comment 3 David Harrison 2006-03-22 07:17:40 PST
Comment on attachment 7226 [details]
patch

r=me