Closed Bug 848695 Opened 13 years ago Closed 8 years ago

Image only used in "@media print" (via :before / content:url(...)) not visible on first print/print-preview

Categories

(Core :: Printing: Output, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 133465

People

(Reporter: firefox, Unassigned)

References

()

Details

Attachments

(4 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0 Build ID: 20130215130331 Steps to reproduce: Trying to insert a print friendly logo, regardless of users background images settings when printing. Example code taken from site : @media print { #ja-header:before { content: url("/templates/ja_university/themes/srsl/images/logo-print.png"); } } Actual results: The inserted image does not print. The following made me suspect a bug. If you go to print preview, the inserted image does not appear. If you choose to print background images in the print settings, the inserted image then appears in the preview along with all background images. If you then turn off background images again, the background images disappear but the inserted image remains. Once this process has been completed the page can then be printed repeatedly with the inserted image in place. However, if you then load a different page in the site and print preview, the inserted image has disappeared again. Expected results: The image should appear immediately in print preview or printed pages.
On Page Setup have you enabled the Print Background Colours and Images checkbox?
Can you attach a testcase or a link to one please?
I have demonstrated the issue in print preview, but printing is also affected. Sequence: 1. In print preview, logo is missing 2. Enable printing of background images and logo appears 3. Disable printing of background images and logo remains 4. Cancel and go back into print preview and logo remains 5. Cancel and load a new page, then go into print preview and logo has disappeared again URL does not show in video but can be found at http://websculpture.net/
(In reply to Robert Longson from comment #2) > Can you attach a testcase or a link to one please? Thanks for the quick reply. I was just uploading a video to show the issue on my PC. Let me know if you can recreate the problem.
Attachment #722118 - Attachment mime type: application/octet-stream → video/vnd.avi
Component: Untriaged → Printing: Output
Product: Firefox → Core
Attached file testcase 1
I can reproduce this. Here's a testcase. STR: 1. Load this testcase. 2. Print-preview. 3. In the print preview UI, change the zoom-level or the print options, or anything else that forces us to relayout. ACTUAL RESULTS: Green block isn't visible in initial print-preview rendering (after step 2), but it becomes visible after step 3. It remains visible in subsequent print-previews, too, until I shift+reload to force us to skip the image cache. Basically, it looks like the first time we re-render print-preview, the image is still loading, so we don't render it (and unlike a normally-viewed web page, we won't update the rendering when the image *does* become ready). (Side note: For authors hitting this in the real world, you may be able to work around this [if you like] by using the image somewhere (offscreen maybe) in the non-print version of your website, to force the image to be in our image cache by the time the user goes to print-preview. Hacky, but it should work.)
Attachment #722118 - Attachment is obsolete: true
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 7 → All
Hardware: x86_64 → All
Version: 19 Branch → Trunk
Summary: Image not printing unless previewed first using @media print and :content :before → Image only used in "@media print" (via :before / content:url(...)) not visible on first print/print-preview
The issue also occurs when data URI images are used: url("data:image/gif;base64,R0l...A7");
Is this essentially a dup of bug 133465, dholbert?
Flags: needinfo?(dholbert)
Probably, per bug 133465 comment 7 especially.
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(dholbert)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: