Save as PDF saves content from the wrong tab

VERIFIED FIXED in Firefox 11

Status

()

defect
P2
normal
VERIFIED FIXED
8 years ago
3 years ago

People

(Reporter: aryx, Assigned: Margaret)

Tracking

Trunk
Firefox 12
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox11 verified, firefox12 verified, fennec11+)

Details

Attachments

(2 attachments)

Posted file logcat
Fennec Native nightly 2012-01-16, Android 4.0.3 stock, Google Nexus S

The 'Save as PDF' function from the menu does not work if only one tab has is open, no notification will be shown, a file with the file size 0 byte will be created.

Steps to reproduce:
1. Open http://tagesschau.de
2. Wait for the page finishing to load.
3. Open the menu and choose 'Save as PDF'.

Open a second tab and try again (independent if first/old or second tab used), it will work.
I am wrong, saving the first tab as PDF saves the second tab with the file name from the first page's title.
Looks like a regression.

I noticed in console after tapping "Save as PDF" -> E/GeckoConsole( 3863): [JavaScript Error: "this.browser is null" {file: "chrome://browser/content/browser.js" line: 1983}]
I find that it always saves the last tab, no matter what tab you're on when you initiate "Save as PDF." I would expect it to save the _current_ tab.
Assignee: nobody → margaret.leibovic
tracking-fennec: --- → 11+
Priority: -- → P2
Posted patch patchSplinter Review
I couldn't reproduce the error Aaron was seeing, but this fixes the issue Madhava was talking about - we were getting the content from the wrong browser.

It looks like the root problem causing this issue is that we're dynamically setting browser type to content-primary [1], but you can't actually set that property after the browser has been inserted into the DOM [2]. I don't know what we should do to fix this, but we should be careful about other problems that might pop up because of this.

[1] http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js#1425
[2] https://developer.mozilla.org/en/XUL/Attribute/browser.type
Attachment #589605 - Flags: review?(mark.finkle)
(In reply to Archaeopteryx [:aryx] from comment #0)
 
> The 'Save as PDF' function from the menu does not work if only one tab has
> is open, no notification will be shown, a file with the file size 0 byte
> will be created.

Archaeopteryx, do you still see this? We kinda hijacked this bug to fix your issue from comment 1, so I'm updating the bug summary, but I want to fix this original issue if it still exists.
Summary: Save as PDF does not work if only one tab open → Save as PDF saves content from the wrong tab
I don't think this is a regression - just something we never noticed.
Comment on attachment 589605 [details] [diff] [review]
patch

O_o

Can't believe we missed that :)
Attachment #589605 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/1d3e470a4709
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12
Comment on attachment 589605 [details] [diff] [review]
patch

[Approval Request Comment]
Mobile-only. Save as PDF is busted without it.
Attachment #589605 - Flags: approval-mozilla-aurora?
Comment on attachment 589605 [details] [diff] [review]
patch

[Triage Comment]
Mobile only - approved for Aurora.
Attachment #589605 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified on M-A & M-C
Galaxy Nexus (Android 4.0.3)

20120126053754
http://hg.mozilla.org/releases/mozilla-aurora/rev/9d5ede8cb11a

20120126031113
http://hg.mozilla.org/mozilla-central/rev/402b394b6623
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.