Closed
Bug 282428
Opened 20 years ago
Closed 20 years ago
When a DOCTYPE used external DHTML Javascript menu isn't displayed
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: chowell, Unassigned)
References
()
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Firefox 1.0 does not process external DHTML javascript file when <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html40/strict.dtd"> or Transitional DOCTYPE included in the document. see http://www.pcug.org.au/~chowell/ which works in MSIE and not in Firefox 1.0 When I remove the DOCTYPE statement from the page it all works but then it breaks my Validated HTML. http://validator.w3.org/check?uri=http://www.pcug.org.au/~chowell/index.htm Reproducible: Always Steps to Reproduce: 1. Open http://www.pcug.org.au/~chowell/ in Firefox 1.0 2. Open http://www.pcug.org.au/~chowell/ in MSIE 3. See the different in the DHTML dropdown menu on the top left of page Actual Results: There is no menu in Firefox but is in MSIE. If I remove the DOCTYPE declaration at the start of the page then Firefox displays the menu and it works. Expected Results: I expected that it would use the DOCTYPE correctly as validated by W3C
Comment 1•20 years ago
|
||
Your http://www.pcug.org.au/~chowell/header.js script has the instruction document.write("<SCRIPT TYPE=\"text/javascript\">Go();</SCRIPT>"); Warning: redeclaration of function Go Source File: http://www.pcug.org.au/~chowell/fw_menu.js Line: 164, Column: 9 Source Code: function Go(){ line 1: function Go(){return} line 164: function Go(){ Dummy(); if(Loadd||!PosStrt)return; Just set Edit/Preferences.../Debug/Show strict javascript warning to see more. [on a side note; I wonder why you need to dynamically write the <script> to call the Go function.]
Comment 2•20 years ago
|
||
> Just set Edit/Preferences.../Debug/Show strict javascript warning to see more.
or in about:config, set the property
javascript.options.strict
to true.
I have cleaned up the javascript after going through the console and checking it all. There are now no errors, warning or messages generated by the page. The problem remains. When I specify a DOCTYPE - the menu is not displayed, when I don't specify DOCTYPE it is displayed. I have added another page http://www.pcug.org.au/~chowell/nodoctype.htm which has the DOCTYPE line removed otherwise it is the same as http://www.pcug.org.au/~chowell/index.htm
Comment 4•20 years ago
|
||
"The CSS error handling rules require erroneous parts to be ignored rather than fixed by guessing. * Lengths other than zero should be followed by a proper unit without a space between the number and the unit (eg. 1.2em). (...) * In Mozilla 1.8a4 and later (not in Firefox 1.0) CSS parsing errors are reported to the JavaScript console." http://www.mozilla.org/docs/web-developer/faq.html#stylenotworking No error report on http://www.pcug.org.au/~chowell/cha.css but the javascript console reports numerous errors for inline style. E.g.: Error: Error in parsing value for property 'background-color'. Declaration dropped. Source File: http://www.pcug.org.au/~chowell/index.htm Line: 0 Error: Error in parsing value for property 'width'. Declaration dropped. Source File: http://www.pcug.org.au/~chowell/index.htm Line: 0 Error: Error in parsing value for property 'top'. Declaration dropped. Source File: http://www.pcug.org.au/~chowell/index.htm Line: 0 Error: Error in parsing value for property 'left'. Declaration dropped. Source File: http://www.pcug.org.au/~chowell/index.htm Line: 0 etc.. Line 0 is because of the loaded script functions. Everywhere in the js file fw_menu.js the functions assign values to css properties _withOUT units_, then you get an error in parsing value for property message because there is no unit. This is why the javascript console reports css parsing errors) regarding the code around assignment instructions like: var BorderWidth=1; // Border width which must be, should be rather var BorderWidth = "1px"; if you want browsers in web standards compliant mode (like MSIE 6, Opera 7+, Mozilla) to render such border. This is already explained at both http://www.mozilla.org/docs/web-developer/upgrade_2.html#dom_manip and http://www.mozilla.org/docs/web-developer/faq.html#stylenotworking and also at MSDN for MSIE 6. Note the paragraph and links to W3C parsing errors correction: "CSS1 and CSS 2.x specifications require that non-zero values must be specified with a length unit; otherwise, the css declaration will be ignored. Mozilla-based browsers, MSIE 6, Opera 7+ and other W3C standards-compliant browsers enforce such handling of parsing error. CSS1 Forward-compatible parsing CSS2.1 Rules for handling parsing errors" "properties are ignored when the !DOCTYPE declaration switches on standards-compliant mode. The first property is ignored because there is no unit type identifier present." CSS Enhancements in Internet Explorer 6 Stricter Style Sheet Parsing Missing Unit Type Identifiers Treated as Pixel Values http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/IE60_ta_landing.asp Also in the fw_menu.js functions: var FontSize=10; strictly speaking, this could be 10px, 10ex, 10mm; that's why specifying explicitly the unit is not only required by CSS conforming agents but even for an human, in the absolute, 10 refers to nothing exactly, to nothin per se. var StartLeft=10; // Menu offset y coordinate var StartTop=50; // Menu offset x coordinate var TopPaddng=2; // Top padding Resolving as INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•