Closed Bug 561221 Opened 14 years ago Closed 14 years ago

nsDocumentEncoder should not use nsIDOM* interfaces internally

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

Using nsIDOM* is just slow. It shows up for example when doing .innerHTML +=
Taking this at least for now.
Assignee: nobody → Olli.Pettay
Depends on: 562321
Attached patch wip (obsolete) — Splinter Review
Need to still run tests on this.
nsHTMLCopyEncoder could be still de-nsIDOM'ed some more,
and when fixing bug 562321 QIing to DOM interfaces can be reduced quite a lot.
Attached file a testcase
Comment on attachment 442086 [details] [diff] [review]
wip

When reviewing, please be careful with IsNodeOfType checks.
Attachment #442086 - Flags: review?(jonas)
The patch passed tests on tryserver.
Ah, we have nsINode::ChildIterator. I'll use that and not
GetChildAt
Comment on attachment 442086 [details] [diff] [review]
wip

better patch coming
Attachment #442086 - Flags: review?(jonas)
Attached patch patch, v2Splinter Review
Attachment #442086 - Attachment is obsolete: true
Attachment #442395 - Flags: review?(jonas)
If this lands after bz' IsElement, then I'd need to change one
IsNodeOfType to IsElement()
Comment on attachment 442395 [details] [diff] [review]
patch, v2

Looks great. Possibly remove the IsTag and just inline at the call sites.

Though really I suspect we'll want to do bigger surgery on this code. It's always looked old and verbose to me and is bound to contain lots of inefficiencies.

And the HTML5 spec defines how to serialize which we're bound to be following right now.

Anyhow, lets land this as it definitely improves things.

r=me
Attachment #442395 - Flags: review?(jonas) → review+
(In reply to comment #10)
> Though really I suspect we'll want to do bigger surgery on this code. It's
> always looked old and verbose to me and is bound to contain lots of
> inefficiencies.
Sure. This is the first step. Next one might be to change string handling.
We want to build the result some how efficiently.

> And the HTML5 spec defines how to serialize which we're bound to be following
> right now.
Aha. Time to review the draft, and find the bugs there first, before 
implementing "html5 serializer".
http://hg.mozilla.org/mozilla-central/rev/72b603db756b
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: