Closed Bug 783601 Opened 8 years ago Closed 8 years ago

Remove extra textContent reference from getInnerText()

Categories

(Firefox for Android :: Reader View, defect)

ARM
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 17
Tracking Status
firefox16 --- fixed

People

(Reporter: bnicholson, Assigned: bnicholson)

Details

Attachments

(1 file)

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.
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+
https://hg.mozilla.org/mozilla-central/rev/8200500fbee5
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 17
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?
Attachment #652817 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.