Closed Bug 335281 Opened 18 years ago Closed 18 years ago

XBL inheritstyle="false" doesn't prevent cascading style rules

Categories

(Core :: XBL, defect)

x86
Other
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: schools_ring, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2

XBL inheritstyle="false" doesn't prevent cascading style rules for anonymous content

Reproducible: Always

Steps to Reproduce:
1. HTML file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 "http://www.w3.org/TR/html401/strict.dtd">
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
 background-color: #FFFFFF;
 color: #000000;
 font-weight: bold;
}
p {
 font-style: italic;
}
/* Binding: */
.test {
 -moz-binding: url(test011.xml#default);
}
</style> 
</head>

<body

 ><div id="div1" class="test"><p>Default content</p></div

></body>
</html>


2. test011.xml file:

<?xml version="1.0"?>

<bindings xmlns="http://www.mozilla.org/xbl">

 <binding id="default" inheritstyle="false">

  <content><children/><p>Anonymous content</p></content>

 </binding>

</bindings>
Actual Results:  
The binding adds new <p> element (with the text "Anonymous content"). 
inheritstyle="false" prevents new element from explicit font-style:italic rule set for <p> elements in the author stylesheet. At the same time it still gets the font-weight:bold rule inherited from the <body> element.

Expected Results:  
inheritstyle="false" blocks any style rules from the author's stylesheet. Unless specified by binding, default styles are used (as if there are no styles provided).

Not even sure if it's a bug or per design (though "Expected Results" would be really more expected - and more convenient).
I think this is invalid. The use of inheritstyle="false" prevents stylesheets from styling anonymous content, but anonymous can choose to inherit the style from non-anonymous parent content.
Assignee: nobody → general
Component: General → XBL
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
Yeah.  The attribute is not as well-named as one could wish, but "allowapplicationofdocumentstylerules" is a little long as an attribute name.  ;)
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.