Closed Bug 304728 Opened 19 years ago Closed 19 years ago

Stylesheet properties are not applied to toplevel XUL window elements

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: andrew, Assigned: jag+mozilla)

Details

User-Agent:       Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.0 (like Gecko)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20050814 Firefox/1.0+

I am developing an extension that creates a new window.  If I specify width, 
height and persist as attributes of the window element in the xul source, then 
they work and are persisted in the rdf db.  However, if I specify them in the 
associated stylesheet then they are not applied or persisted.  Other values in 
the stylesheet function as expected (eg changing a label background colour). 
 
Note - I'm new to XUL development, so this may be a feature or me doing 
something stupid.  However, I can't find anything that suggests it's known 
behaviour. 

Reproducible: Always

Steps to Reproduce:
1. Generate a file with these contents: 
<?xml version="1.0"?> 
<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 
<?xml-stylesheet href="chrome://zim/skin/zim.css" type="text/css"?> 
<?xml-stylesheet href="flowWindow.css" type="text/css"?> 
<!DOCTYPE window> 
<window id="zimFlowWindow" 
 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 
<!-- 
 width="1000" 
 height="600" 
 screenX="10" 
 screenY="10" 
 persist="width height screenX screenY"> --> 
 <label id="poo" value="hfuidshfuids"/> 
 <label value="hfui"/> 
</window> 
 
2. Use this style sheet: 
 
label { 
  background: green; 
} 
 
#poo { 
  background: red; 
} 
 
#zimFlowWindow { 
  width: 500; 
  height: 400; 
  screenX: 20; 
  screenY: 20; 
  persist: "width height screenX screenY"; 
} 
 
3. Comment/uncomment to try different combinations; check localstore.rdf 
 
Actual Results:  
When applied as direct attributes, the window responds as expected.  When 
applied via stylesheet, they have no effect. 

Expected Results:  
Should work the same in both cases (I think!). 

Also, screenX and screenY don't seem to be persisted properly (window always   
appears in bottom left corner).   
  
Feel free to email me for more info.  I'm around most days.  AIM:acookeorg may 
also work.
In the example given the whole end of the window start tag is commented out,
including the persist attribute, so nothing should be persisted, and also the
closing > of the tag which could cause other quirky behaviour.
Assignee: nobody → jag
Component: General → XP Toolkit/Widgets
Product: Firefox → Core
QA Contact: general → jrgmorrison
Version: unspecified → Trunk
the same occurs with 
<?xml version="1.0"?> 
<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 
<?xml-stylesheet href="chrome://zim/skin/zim.css" type="text/css"?> 
<?xml-stylesheet href="flowWindow.css" type="text/css"?> 
<!DOCTYPE window> 
<window id="zimFlowWindow" 
 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 
 <label id="poo" value="hfuidshfuids"/> 
 <label value="hfui"/> 
</window> 
 
and 
label { 
  background: green; 
} 
 
#poo { 
  background: red; 
} 
 
#zimFlowWindow { 
  width: 1000; 
  height: 400; 
  persist: "width height"; 
} 
 
- the labels show as two different colours, but the screen is of the minimum 
size possible (ie shrunk to fit the labels) and is not persisted. 
persist, screenX and screenY are attributes of the window. They are not css
properties and so cannot be specified in a stylesheet. The widht and height
specified in a stylesheet must have units specified like px or em.
thanks, that fixed things (thought i'd replied to this 30 mins ago, so sorry if
this is a repeat - seems to not be one of my better days).  sorry for wasting time.

thanks again,
andrew
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Just FYI, the fixed resolution is for bugs that have had code checked in to fix
things. Changing this to invalid since the issue was not actually a bug.
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.