Incorrect processing of CSS "@media print" when JSView addon is installed

UNCONFIRMED
Unassigned

Status

()

Core
CSS Parsing and Computation
--
major
UNCONFIRMED
8 years ago
7 years ago

People

(Reporter: Sergey Spatar, Unassigned)

Tracking

1.9.1 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1) Gecko/20090616 Firefox/3.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1) Gecko/20090616 Firefox/3.5

An element which have a CSS rule "display: hidden" for media=print hid when adding a new non-empty <style> element into document's <head> element.

Reproducible: Always

Steps to Reproduce:
1. Open your http://bugzilla.mozilla.org/
2. Paste the following JavaScript code in address bar and press Enter:

javascript:var style = document.createElement("style"); style.type = "text/css"; style.appendChild(document.createTextNode("#there_is_no_such_id {}")); document.getElementsByTagName("head")[0].appendChild(style); void(0);

Actual Results:  
1. Page opened
2. Page header (div#header) hid

Expected Results:  
1. Page should open
2. Nothing should change

You can get the same error when using Firebug and moving your cursor above `<div id="header">' element in Firebug's HTML tab.

The error is somehow connected with the following CSS declaration in https://bugzilla.mozilla.org/skins/standard/global.css:

/* Rules specific for printing */
@media print {
    #header, #footer {
        display: none;
    }

    body {
        background-image: none;
        background-color: #fff;
    }
}
(Reporter)

Updated

8 years ago
Version: unspecified → 3.5 Branch

Comment 1

8 years ago
I can't reproduce this with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1pre) Gecko/20090622 Shiretoko/3.5pre.
(Reporter)

Comment 2

8 years ago
Probably, it is an add-on bug. It is reproducible only with JSView 2.0.5 add-on installed and enabled (https://addons.mozilla.org/en-US/firefox/addon/2076).
Have you contacted the author of the JSView addon about the problem?
Component: General → Style System (CSS)
Product: Firefox → Core
QA Contact: general → style-system
Summary: Incorrect processing of CSS "@media print" → Incorrect processing of CSS "@media print" when JSView addon is installed
Version: 3.5 Branch → 1.9.1 Branch
You need to log in before you can comment on or make changes to this bug.