Closed Bug 283329 Opened 20 years ago Closed 19 years ago

Javascript modifications to style sheets override print media stylesheets; supporting window.onbeforeprint recommended

Categories

(Firefox :: General, defect)

defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 307258

People

(Reporter: nolan, Assigned: bugzilla)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

I was working on my resume, "http://www.semanticgap.com/resume.html", and I want
it to display everything when it prints. I have a stylesheet setup for
media="print". The problem is that I use JavaScript to modify the visibility of
the DOM elements using the ".style" property. These modifications take
precedence over the print stylesheet, and there's no way to make DIVs visible
only for printing.

Internet Explorer has the JavaScript methods for windows called onBeforePrint
and onAfterPrint which are called before and after printing. These are not
supported by Firefox, and would be able to fix my problem perfectly unless this
is a bug with the style sheet handling. Either means of fixing this would be
great, though the before and after print methods would probably be ideal.

Reproducible: Always

Steps to Reproduce:
1a. Goto my resumé
2a. Goto print [preview]

1b. Create a page that has a style sheet for media="print" that sets an
element's visibility to 'visible'
2b. Create a JavaScript that modifies the above element's visiblitiy to hidden
3b. Goto print [preview]
Actual Results:  
The element remained invisible even though the print style sheet specified that
it is visible.

Expected Results:  
Either the print stylesheet should have made the element visible, or
onBeforePrint and onAfterPrint window methods needs to be supported to undo what
the script does.

The documentation on IE's onBeforePrint and onAfterPrint would be helpful, since
I think that's the best way to fix this.
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
Note bug 307258.  (Take THAT, auto-resolve!)

*** This bug has been marked as a duplicate of 307258 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.