Bug 783601 - Remove extra textContent reference from getInnerText(). r=lucasr
authorBrian Nicholson <bnicholson@mozilla.com>
Fri, 17 Aug 2012 14:42:48 -0400
changeset 108132 8200500fbee52eea0fc23f2e5ffed11dfb0f968b
parent 108131 ea2ad8970f3e50e2ef2685ef568316448aae719a
child 108133 9556e43af1be27538b7e0cbbae704736aa799204
push id1490
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 18:29:50 +0000
treeherdermozilla-beta@f335e7dacdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs783601
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 783601 - Remove extra textContent reference from getInnerText(). r=lucasr
mobile/android/chrome/content/Readability.js
--- a/mobile/android/chrome/content/Readability.js
+++ b/mobile/android/chrome/content/Readability.js
@@ -753,23 +753,18 @@ Readability.prototype = {
   /**
    * Get the inner text of a node - cross browser compatibly.
    * This also strips out any excess whitespace to be found.
    *
    * @param Element
    * @return string
   **/
   _getInnerText: function(e, normalizeSpaces) {
-    let textContent = "";
-
-    if (typeof(e.textContent) === "undefined" && typeof(e.innerText) === "undefined")
-      return "";
-
+    let textContent = e.textContent.replace(this.REGEXPS.trim, "");
     normalizeSpaces = (typeof normalizeSpaces === 'undefined') ? true : normalizeSpaces;
-    textContent = e.textContent.replace(this.REGEXPS.trim, "");
 
     if (normalizeSpaces) {
       return textContent.replace(this.REGEXPS.normalize, " ");
     } else {
       return textContent;
     }
   },