Closed
Bug 333063
Opened 19 years ago
Closed 19 years ago
Fix the relationship between nsHTMLEditor::InsertHTMLWithContext and nsHTMLEditor::CreateDOMFragmentFromPaste
Categories
(Core :: DOM: Editor, defect, P2)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha1
People
(Reporter: mrbkap, Assigned: mrbkap)
References
Details
(Whiteboard: [patch])
Attachments
(1 file)
13.81 KB,
patch
|
neil
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
Currently, the path to paste an HTML fragment in the editor goes through a little maze of functions. Two of those functions are InsertHTMLWithContext and CreateDOMFragmentFromPaste. These functions are currently in a weird incestuous relationship where one CreateDOMFragmentFromPaste does parsing and passes "hints" back to InsertHTMLWithContext, basically meaning that we end up calculating the same things twice.
I want to clean up the relationship between the two functions so that we only calculate things once. This is a spinoff of bug 228920. Note that I don't want to nuke CreateDOMFragmentFromPaste altogether, since InsertHTMLWithContext is a large enough function as-is.
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [patch]
Target Milestone: --- → mozilla1.9alpha
Assignee | ||
Comment 1•19 years ago
|
||
I tried to keep the behavior the same between the old and new code. I'm not really happy with the nsCOMPtr usage, suggestions are welcome.
Attachment #219573 -
Flags: review?(neil)
Comment 2•19 years ago
|
||
Comment on attachment 219573 [details] [diff] [review]
Pass 1
>+ *outStartNode = contextLeaf;
>+ *outStartOffset = 0;
>+
>+ *outEndNode = *outStartNode;
Chained assignment?
>+ *outStartNode = tmp;
->swap?
>+ GetLengthOfDOMNode(*outEndNode, (PRUint32&)*outEndOffset);
> }
> else
> {
>+ GetLengthOfDOMNode(*outEndNode, (PRUint32&)*outEndOffset);
> }
I suppose any decent compiler will optimise this, but it looks silly.
Attachment #219573 -
Flags: review?(neil) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #219573 -
Flags: superreview?(jst)
Comment 3•19 years ago
|
||
Comment on attachment 219573 [details] [diff] [review]
Pass 1
sr=jst
Attachment #219573 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 4•19 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•