If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

css is not applied to element with namespace other than xhtml namespace

RESOLVED DUPLICATE of bug 429298

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 429298
8 years ago
8 years ago

People

(Reporter: hle.ogr, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.12) Gecko/2009070818 Ubuntu/8.10 (intrepid) Firefox/3.0.12
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.12) Gecko/2009070818 Ubuntu/8.10 (intrepid) Firefox/3.0.12

It seems css from external file is not applied to individual elements with new defined namespace - if document is modified via DOM. 

But: css is applied if css information is defined for all elements in the new namespace. Also save and reload with linked css stylesheet will show applied style.

Reproducible: Always

Steps to Reproduce:
1. Create a xhtml web page. Within the body set a new element with new namespace

<body>
  <div>
    <new:test xmlns:new="new-test">testing</new:testing>
  </div>
</body>

2. Create a external stylesheet with
@namespace new "new-test";

@namespace html "http://www.w3.org/1999/xhtml";

new|test {
    color:red;
}

3. Apply a new stylesheet via DOM, for example this methode:
https://developer.mozilla.org/en/Using_the_Stylesheet_Service


4. You will see the css is not applied, but if you modify the css style to set color: red for all elements with new namespace than it works. For example change the css to:
new|* {
    color:red;
}

This information is applied as expected.
Actual Results:  
css for new namespace is only applied if document has already css information included but not if it is added via DOM manipulation. 

Expected Results:  
css should be applied as defined

Tested with Firefox 3 and 3.5. Also if the stylesheet is added via <link/> it only works after reload.
(Reporter)

Comment 1

8 years ago
As addition, it seems to be only for elements with uppercase letter. for example:

<new:testForm/>

and css

new|testForm {
 color: red;
}

but working with 
<new:testform/> 


new|testform {
 color: red;
}

will work with
If the problem was something that happened only if the tags had an uppercase letter in them, then it was probably fixed by bug 507762, which is fixed on trunk.  Could you retest in mozilla-central nightlies or in one of the Mozilla Developer Previews: http://www.mozilla.org/projects/devpreview/ ?
Component: General → Style System (CSS)
Depends on: 507762
Product: Firefox → Core
QA Contact: general → style-system
Also, I'd note that using a relative URL for the namespace isn't going to work if the document and style sheet are in different directories (because then it resolves to different URLs).  Using relative URLs for namespaces is a bad idea.  But it doesn't seem like that's the actual problem you were hitting.

Comment 4

8 years ago
Works here: http://yo-lobo.eu/xslt/semana.xml
used namespace: 
@namespace table "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
css: http://yo-lobo.eu/xslt/table.css
__
Identificador de build: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-AR; rv:1.9.1.9) Gecko/20100317 SeaMonkey/2.0.4
Please let us know if this isn't fixed in 3.7a4 or 3.7a5pre builds.

(And sorry it sat in Firefox::General so long before getting moved to the correct place.)
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 429298
You need to log in before you can comment on or make changes to this bug.