Closed Bug 1298942 Opened 8 years ago Closed 8 years ago

onafterprint attribute

Categories

(Firefox :: Untriaged, defect)

48 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1214805

People

(Reporter: abdjh, Unassigned, NeedInfo)

Details

(Whiteboard: [specification][type:bug])

What did you do?
================
I have a page which use onafterprint attribute on body tag, it was working fine a while ago, now its triggered only when I cancel print dialog!!!

What happened?
==============
onafterprint did not trigger when print

What should have happened?
==========================
onafterprint should trigger after print

Is there anything else we should know?
======================================
Severity: normal → critical
Priority: -- → P1
Which application (name and version) are you using on which OS?
Also, can you provide the testcase or the URL of the page the issue happens?
Component: Events → Untriaged
Flags: needinfo?(abdjh)
Product: Mozilla Developer Network → Firefox
It is local application so there is no online page to test on, and I tried it on Windows XP, and Windows 7, same on both, and one more note same code on IE still working (but as you know IE dose not work good with styles), thank you for your response.
OS: Other → Windows 7
Hardware: All → x86_64
Version: unspecified → 48 Branch
Version: 48 Branch → unspecified
Sorry, I meant
  * Which browser or mailer is this bug about?
  * What's the version of it?

About testcase, can you prepare a minimal testcase, or provide the following information?
  * How is print function is executed? with JavaScript (window.print() function) or browser/mailer's menu?
  * How is the onafterprint attribute is set? (in HTML or via JavaScript?)
  * What do you do in onafterpaint attribute?

There's similar issue in bug 1214805, but it's still not clear whether this bug is a duplicate of it or not.
See Also: → 1214805
yes this case just like (bug 1214805), I searched all night about it and then open a new case, my browser info is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:48.0) Gecko/20100101 Firefox/48.0
and two other PCs with Windows XP and Windows 7 (both 32bit and 64bit)
thank you for the information.

Can you also answer this?

> About testcase, can you prepare a minimal testcase, or provide the following
> information?
>   * How is print function is executed? with JavaScript (window.print()
> function) or browser/mailer's menu?
>   * How is the onafterprint attribute is set? (in HTML or via JavaScript?)
>   * What do you do in onafterprint attribute?

or perhaps all of those are *exactly* same as bug 1214805's testcase?
Severity: critical → normal
Priority: P1 → --
Version: unspecified → 48 Branch
print function from javascript window.print() on body tag on onload attribute like this:
<body onload="window.print()" onafterprint="[calling a function]">

and I think this will answer all your questions, and btw it was like that since day 1 and it was working fine, and a while ago stopped!!!
Flags: needinfo?(abdjh)
Thanks.

Unfortunately it doesn't answer the following question.

>   * What do you do in onafterprint attribute?

What does the function called in onafterprint do, and what's the actual difference between expected behavior and actual behavior?
Does the function do page navigation, or modify DOM structure, or something else?
Flags: needinfo?(abdjh)
<body onload="window.print()" onafterprint="document.location='?move=nextpage'">
Thank you for your answer :)

now it's clear that this bug is a duplicate of bug 1214805.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(abdjh)
Resolution: --- → DUPLICATE
See Also: 1214805
So this isn't a regression, I assume?
Or did some older version of Firefox work ok?
Flags: needinfo?(abdjh)
bug 1214805 is a regression in 38.
You need to log in before you can comment on or make changes to this bug.