Last Comment Bug 773774 - Don't clone document for reader mode check
: Don't clone document for reader mode check
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)
:
: Sebastian Kaspari (:sebastian)
Mentors:
Depends on:
Blocks: reader
  Show dependency treegraph
 
Reported: 2012-07-13 12:57 PDT by Brian Nicholson (:bnicholson)
Modified: 2012-08-20 21:23 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed


Attachments
patch (1.09 KB, patch)
2012-07-13 12:57 PDT, Brian Nicholson (:bnicholson)
no flags Details | Diff | Splinter Review
patch v2 (1.15 KB, patch)
2012-07-13 12:59 PDT, Brian Nicholson (:bnicholson)
mark.finkle: review+
lukasblakk+bugs: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Brian Nicholson (:bnicholson) 2012-07-13 12:57:22 PDT
Created attachment 642012 [details] [diff] [review]
patch

We now avoid any DOM manipulations when checking readability, so there's no need to clone the document.
Comment 1 Brian Nicholson (:bnicholson) 2012-07-13 12:59:34 PDT
Created attachment 642013 [details] [diff] [review]
patch v2

forgot to qref
Comment 2 Mark Finkle (:mfinkle) (use needinfo?) 2012-07-13 18:51:35 PDT
Comment on attachment 642013 [details] [diff] [review]
patch v2

># HG changeset patch
># Parent 7c1e2b2a718357bf9d045aa59ede37dd97251cb5
># User Brian Nicholson <bnicholson@mozilla.com>
>
>diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js
>--- a/mobile/android/chrome/content/browser.js
>+++ b/mobile/android/chrome/content/browser.js
>@@ -6353,20 +6353,18 @@ let Reader = {
>       // First, try to find a cached parsed article in the DB
>       this.getArticleFromCache(url, function(article) {
>         if (article) {
>           this.log("Page found in cache, page is definitely readable");
>           callback(true);
>           return;
>         }
> 
>-        // FIXME: Make the readability check not require a separate copy
>-        // of the document by making the operation fully non-destructive.
>-        let doc = tab.browser.contentWindow.document.cloneNode(true);
>         let uri = Services.io.newURI(url, null, null);
>+        let doc = tab.browser.contentWindow.document;
> 
>         let readability = new Readability(uri, doc);
>         callback(readability.check());
>       }.bind(this));
>     } catch (e) {
>       this.log("Error checking tab readability: " + e);
>       callback(false);
>     }
Comment 3 Brian Nicholson (:bnicholson) 2012-07-17 11:51:03 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/a5b74af104b8
Comment 4 Ed Morley [:emorley] 2012-07-18 05:55:02 PDT
https://hg.mozilla.org/mozilla-central/rev/a5b74af104b8
Comment 5 Brian Nicholson (:bnicholson) 2012-08-20 09:18:16 PDT
Comment on attachment 642013 [details] [diff] [review]
patch v2

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 
User impact if declined: Reader parse will be slower
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:23:49 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/10de8a7d727b

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