Remove extra textContent reference from getInnerText()

RESOLVED FIXED in Firefox 16

Status

()

Firefox for Android
Reader View
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bnicholson, Assigned: bnicholson)

Tracking

unspecified
Firefox 17
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox16 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
textContent is a relatively expensive getter - all child nodes for the element are walked to build the text string - and getInnerText() is called frequently.

Since we know the environment we're running in, we don't need this browser compatibility check. If we do want to keep the compatibility check for some reason, though, we should at least factor out textContent into a variable to prevent the getter from being called twice.
(Assignee)

Comment 1

5 years ago
Created attachment 652817 [details] [diff] [review]
Remove extra textContent reference from getInnerText()
Attachment #652817 - Flags: review?(lucasr.at.mozilla)
Comment on attachment 652817 [details] [diff] [review]
Remove extra textContent reference from getInnerText()

Review of attachment 652817 [details] [diff] [review]:
-----------------------------------------------------------------

Nice catch.
Attachment #652817 - Flags: review?(lucasr.at.mozilla) → review+
(Assignee)

Comment 3

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/8200500fbee5
https://hg.mozilla.org/mozilla-central/rev/8200500fbee5
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 17
(Assignee)

Comment 5

5 years ago
Comment on attachment 652817 [details] [diff] [review]
Remove extra textContent reference from getInnerText()

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: reader mode parse may take longer
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): low risk
String or UUID changes made by this patch: none
Attachment #652817 - Flags: approval-mozilla-aurora?
(Assignee)

Updated

5 years ago
status-firefox16: --- → affected
Attachment #652817 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Assignee)

Comment 6

5 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/9615809c0dbc
status-firefox16: affected → fixed
You need to log in before you can comment on or make changes to this bug.