Last Comment Bug 783601 - Remove extra textContent reference from getInnerText()
: Remove extra textContent reference from getInnerText()
Status: RESOLVED FIXED
:
Product: Firefox for Android
Classification: Client Software
Component: Reader View (show other bugs)
: unspecified
: ARM Android
: -- normal (vote)
: Firefox 17
Assigned To: Brian Nicholson (:bnicholson)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-17 10:23 PDT by Brian Nicholson (:bnicholson)
Modified: 2012-08-20 21:27 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed


Attachments
Remove extra textContent reference from getInnerText() (1.16 KB, patch)
2012-08-17 10:24 PDT, Brian Nicholson (:bnicholson)
lucasr.at.mozilla: review+
lukasblakk+bugs: approval‑mozilla‑aurora+
Details | Diff | Review

Description Brian Nicholson (:bnicholson) 2012-08-17 10:23:15 PDT
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 1 Brian Nicholson (:bnicholson) 2012-08-17 10:24:07 PDT
Created attachment 652817 [details] [diff] [review]
Remove extra textContent reference from getInnerText()
Comment 2 Lucas Rocha (:lucasr) 2012-08-17 11:02:28 PDT
Comment on attachment 652817 [details] [diff] [review]
Remove extra textContent reference from getInnerText()

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

Nice catch.
Comment 3 Brian Nicholson (:bnicholson) 2012-08-17 11:43:24 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/8200500fbee5
Comment 4 Ryan VanderMeulen [:RyanVM] 2012-08-17 19:22:32 PDT
https://hg.mozilla.org/mozilla-central/rev/8200500fbee5
Comment 5 Brian Nicholson (:bnicholson) 2012-08-20 10:27:58 PDT
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
Comment 6 Brian Nicholson (:bnicholson) 2012-08-20 21:27:01 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/9615809c0dbc

Note You need to log in before you can comment on or make changes to this bug.