Open
Bug 502156
Opened 15 years ago
Updated 3 years ago
nsHTMLEditor::CreateDOMFragmentFromPaste should use CreateContextualFragment
Categories
(Core :: DOM: Editor, defect, P5)
Core
DOM: Editor
Tracking
()
NEW
People
(Reporter: roc, Unassigned)
Details
Attachments
(1 file)
9.47 KB,
patch
|
peterv
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
Currently it instantiates an nsIParser directly. It can just use nsContentUtils::CreateContextualFragment. This saves code and means that if the HTML5 parser is enabled, we'll use it. This lets us do cool stuff like copy/paste and drag/drop SVG-in-HTML.
Attachment #386682 -
Flags: superreview?(peterv)
Attachment #386682 -
Flags: review?(peterv)
Reporter | ||
Comment 1•15 years ago
|
||
Ignore the media test junk at the start of the patch.
Reporter | ||
Comment 2•15 years ago
|
||
Ignore the stray nsHTML5Module include as well.
Updated•15 years ago
|
Attachment #386682 -
Flags: superreview?(peterv)
Attachment #386682 -
Flags: superreview+
Attachment #386682 -
Flags: review?(peterv)
Attachment #386682 -
Flags: review+
Comment 3•15 years ago
|
||
Comment on attachment 386682 [details] [diff] [review] fix >diff --git a/editor/libeditor/html/nsHTMLDataTransfer.cpp b/editor/libeditor/html/nsHTMLDataTransfer.cpp >@@ -2540,54 +2541,55 @@ nsresult nsHTMLEditor::CreateDOMFragment > nsCOMPtr<nsIDOMDocument> domDoc; > GetDocument(getter_AddRefs(domDoc)); > > nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc); > NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE); I think you can now also remove these. > nsCOMPtr<nsIDOMDocumentFragment> contextfrag; contextfrag looks unused too.
Reporter | ||
Comment 4•15 years ago
|
||
I checked this in: http://hg.mozilla.org/mozilla-central/rev/4c139bbb4895 but it seemed to cause test failure: http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1247199195.1247205665.8856.gz#err0 so I backed it out.
Reporter | ||
Comment 5•15 years ago
|
||
It seems test_bug478725.html fails because the current parser, when called via CreateContextualFragment, parses "<dl><dd>Hello Kitty</dd></dl>" into a document fragment that starts with a text node containing a single space. Similar for test_bug480972.html. The tests pass using the HTML5 parser. I also noticed that although it's not picked up in the tests, copying and pasting plain text not including a node does not work with this patch and the old parser. It does work with the HTML5 parser. I'm not sure how to proceed.
Reporter | ||
Updated•14 years ago
|
Assignee: roc → nobody
Comment 6•3 years ago
|
||
Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.
If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.
Severity: normal → S4
Priority: -- → P5
You need to log in
before you can comment on or make changes to this bug.
Description
•