Bug 7904 - Avoid a layout after test insertion and remove isProbablyBlock
Summary: Avoid a layout after test insertion and remove isProbablyBlock
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Justin Garcia
Depends on:
Reported: 2006-03-21 23:50 PST by Justin Garcia
Modified: 2006-03-22 16:56 PST (History)
0 users

See Also:

patch (24.68 KB, patch)
2006-03-22 01:14 PST, Justin Garcia
harrison: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]

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]