Don't clone document for reader mode check

RESOLVED FIXED in Firefox 16

Status

()

Firefox for Android
Reader View
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bnicholson, Assigned: bnicholson)

Tracking

unspecified
Firefox 17
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox16 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
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.
Attachment #642012 - Flags: review?(mark.finkle)
(Assignee)

Comment 1

5 years ago
Created attachment 642013 [details] [diff] [review]
patch v2

forgot to qref
Attachment #642012 - Attachment is obsolete: true
Attachment #642012 - Flags: review?(mark.finkle)
Attachment #642013 - Flags: review?(mark.finkle)
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);
>     }
Attachment #642013 - Flags: review?(mark.finkle) → review+
(Assignee)

Comment 3

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/a5b74af104b8

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/a5b74af104b8
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 17
(Assignee)

Updated

5 years ago
Target Milestone: Firefox 17 → Firefox 16
(Assignee)

Updated

5 years ago
Target Milestone: Firefox 16 → Firefox 17
(Assignee)

Comment 5

5 years ago
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
Attachment #642013 - Flags: approval-mozilla-aurora?
(Assignee)

Updated

5 years ago
status-firefox16: --- → affected
Attachment #642013 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Assignee)

Comment 6

5 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/10de8a7d727b
status-firefox16: affected → fixed
You need to log in before you can comment on or make changes to this bug.