Bug 784683 - Don't create temporary H1 element for title (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Wed, 22 Aug 2012 18:17:45 +0100
changeset 103043 e97800e74b636eb088edd68ee219a8a30c7dc9b3
parent 103042 fcb1cb11935f91aa0778837f98235123e5422ca0
child 103044 b87b0846c9137de02fdf9a0e8e1db19231cf3098
push id23326
push useremorley@mozilla.com
push dateThu, 23 Aug 2012 10:36:26 +0000
treeherdermozilla-central@198ca6edd0ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs784683
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 784683 - Don't create temporary H1 element for title (r=mfinkle)
mobile/android/chrome/content/Readability.js
--- a/mobile/android/chrome/content/Readability.js
+++ b/mobile/android/chrome/content/Readability.js
@@ -174,20 +174,17 @@ Readability.prototype = {
         curTitle = this._getInnerText(hOnes[0]);
     }
 
     curTitle = curTitle.replace(this.REGEXPS.trim, "");
 
     if (curTitle.split(' ').length <= 4)
       curTitle = origTitle;
 
-    let articleTitle = doc.createElement("H1");
-    articleTitle.innerHTML = curTitle;
-
-    return articleTitle;
+    return curTitle;
   },
 
   /**
    * Prepare the HTML document for readability to scrape it.
    * This includes things like stripping javascript, CSS, and handling terrible markup.
    *
    * @return void
    **/
@@ -1350,13 +1347,13 @@ Readability.prototype = {
     // if (nextPageLink) {
     //   // Append any additional pages after a small timeout so that people
     //   // can start reading without having to wait for this to finish processing.
     //   setTimeout((function() {
     //     this._appendNextPage(nextPageLink);
     //   }).bind(this), 500);
     // }
 
-    return { title: this._getInnerText(articleTitle),
+    return { title: articleTitle,
              byline: this._articleByline,
              content: articleContent.innerHTML };
   }
 };