Closed Bug 286736 Opened 19 years ago Closed 19 years ago

floating menu doesn't work with xhtml doctype, works with html doctype

Categories

(Firefox :: General, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: ve3ll, Assigned: bugzilla)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b2) Gecko/20050317 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b2) Gecko/20050317 Firefox/1.0+

this simple pullout menu works ok with html doctype
see http://home.cogeco.ca/jsfloat0.htm  but gives a
javascript parsing error on a css property when the 
doctype is changed to xhtml.  Opera and MSIE continue
to pullout the menu.  Is this a bug or a difference in
interpretation of CSS between implementer groups. 

Reproducible: Always

Steps to Reproduce:
1. view the jsfloat.htm document
2. read the javascript console
3. check jsfloat0.htm which is identical except for doctype

Actual Results:  
menu did not put itself away.
javascript consule gave error on property

Expected Results:  
worked as it does in Opera and MSIE
Your page is 404
sorry chief -- i missed the extra bit needed to
focus on on of several of my sites ;-[ ;-[
the correct url is
http://home.cogeco.ca/~ve3ll/jsfloat0.htm
Which doctype did you try to use?  It validates as XHTML 1.0 Transitional at the
W3 Validator:
http://validator.w3.org/check?uri=http%3A%2F%2Fhome.cogeco.ca%2F~ve3ll%2Fjsfloat0.htm

But not as XHTML 1.0 Strict.
Sorry that URL is actually wrong, you have to change the doctype when you go to
that link so it validates the page as XHTML.
The doctype is xhtml1 transitional...
it is speced in the document itself so most validators
use the one speced....  
the problem is not with validation but that the javascript
interpreter cannot parse the left property of a new object.
opera and msie do but maybe they are finding none and assuming
left:0 by default...  that is why i am questioning 
bug  or different interpretation to css recommendation when
handling default properties ??? 
Summary: floating menu crashes with xhtml doctype, works with html doctype → floating menu doesn't work with xhtml doctype, works with html doctype
This is just a standards vs. quirks mode thing (see Tools/Page info).
In standards mode Firefox doesn't accept CSS lengths without units; that applies
to dynamic as well as static rules.

So, you need to replace foo.left = (some expression)
with foo.left = (some expression) + 'px'
Thank you so much for the analysis and response. Three places to
patch and it now works like a charm. I must put a special marker
on the all measures require units note!!
the gecko engine is more strict than others but that is good as
it forces clearer coding with fewer assumptions. Great work!
I am marking as INVALID as it wsn't a bug but a lack of
compliance to css recommendation. Thanks again
 john@TwinPines.greatwhitenorth
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
(In reply to comment #7)
> Thank you so much for the analysis and response. Three places to
> patch and it now works like a charm. I must put a special marker
> on the all measures require units note!!
> the gecko engine is more strict than others ...

Please see one or more of 
http://www.w3.org/TR/xhtml-media-types/
http://www.workingwith.me.uk/articles/scripting/mimetypes/
http://www.howtocreate.co.uk/wrongWithIE/?chapter=XHTML&withHeader=1 
http://www.juicystudio.com/tutorial/xhtml/mime.asp

Bugzilla is not necessarily the best place to get tuition on CSS, DOCTYPES
et cetera.
You need to log in before you can comment on or make changes to this bug.