Summary: | createFragmentFromText should not clone the block surrounding its context parameter to wrap paragraphs | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Justin Garcia <justin.garcia> | ||||
Component: | HTML Editing | Assignee: | Justin Garcia <justin.garcia> | ||||
Status: | ASSIGNED --- | ||||||
Severity: | Normal | CC: | cmarcelo, enrica, rniwa | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Justin Garcia
2010-09-17 18:51:16 PDT
Created attachment 67992 [details]
work in progress
I wrote the current function and the old one in term of a new internal function that takes in a Document* and a block to clone.
Comment on attachment 67992 [details] work in progress View in context: https://bugs.webkit.org/attachment.cgi?id=67992&action=prettypatch > WebCore/editing/markup.cpp:1280 > + // For last line, use the "magic BR" rather than a P. Since we're wrapping with blockToClone instead of a P, we might want to revise this comment. > WebCore/editing/markup.cpp:1350 > + return createFragmentFromText(document, useClonesOfEnclosingBlock ? block : createDefaultParagraphElement(document).get(), text); Since useClonesOfEnclosingBlock is only used once, can we change the block to RefPtr<Element> and then do element = createDefaultParagraphElement(document) instead of doing trinary here? i.e. RefPtr<Element> block = static_cast<Element*>(blockNode); if (blockNode && ...) block = createDefaultParagraphElement(document); Otherwise looks nice. But as you said, we should figure out a way to test this. |