Closed Bug 923913 Opened 11 years ago Closed 11 years ago

Make Element.innerHTML [Pure]?

Categories

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

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(3 files, 1 obsolete file)

bz had the idea to make innerHTML (getter) [Pure].
Trying to figure out whether that is actually possible.
Attached patch testSplinter Review
On my machine time goes from ~235ms to ~8ms
hmm, perhaps .innerHTML may throw but .outerHTML doesn't.
Will test and figure out why we have the code paths we have.
Or vice versa, outerHTML may, but innerHTML may not... Anyhow, will try to investigate tomorrow.
So we do serialize for example comment which has -- in the data.
And so does blink.
Attached patch patchSplinter Review
https://tbpl.mozilla.org/?tree=Try&rev=9eb5ac196105
Assignee: nobody → bugs
Attachment #813941 - Attachment is obsolete: true
Attachment #814445 - Flags: review?(bzbarsky)
Comment on attachment 814445 [details] [diff] [review]
patch

Make GetMarkup return void, and r=me
Attachment #814445 - Flags: review?(bzbarsky) → review+
Attached patch v2Splinter Review
https://hg.mozilla.org/mozilla-central/rev/772be3f89d8e
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Depends on: 927262
In order to know if we need to update documentation or not, I have one question:
Does this change the behavior users see? Or is it just adding semantics acknowledging that innerHTML will never throw?
Flags: needinfo?(bugs)
This should not change the semantics. (But the spec may change to say empty string is returned in
case of XML document and non-serializable DOM.)
Flags: needinfo?(bugs)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: