Closed Bug 214939 Opened 22 years ago Closed 22 years ago

Error in handling the DOM with Javascript (or the recursive Javascript function call is suppressed by Mozilla?)

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: thomas.lehmann, Assigned: dbaron)

References

()

Details

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6 The following code do neither work - in Mozilla 1.4 - Gecko20030625 (and all Mozilla versions I had before) nor - in Firebird 0.6 - Gecko20030516. It _does_ work with - Netscape 7.02 (and NS 6.1 I had formerly available), - Opera 7.11, - Konqueror 3.0.0 - MSIE, however. Its function is to have the string "Willkommen in der" slowly fade and reappear (maybe not sooo meaningful on the page). Snippets: ************************* HTML file: <html> (...) <body onLoad="fadetimer()"> (...) <span id="willkommen" style="font-family:Arial,sans-serif; font-size:20pt; font-weight:normal; border-bottom-width:10; border-bottom-color:#c9bdc4; border-bottom-style:groove"> Willkommen in der</span> (...) </body> </html> ************************ ************************ Javascript file: var r=221, g=208, b=216, flag; // dd, d0, d8 var summand =1.01, auf1ab0=0; function fadetimer() { if (document.getElementById) { fade(); } } function fade() { if (r>221) { auf1ab0=0; } if (g<=10) { auf1ab0=1; } if (auf1ab0==1) { r*=summand ; g*=summand ; b*=summand ; } else { r/=summand ; g/=summand ; b/=summand ; } document.getElementById("willkommen").style.color="rgb("+r+","+g+","+b+")"; // (...) window.setTimeout("fade()", 10); }; *************************** Reproducible: Always Steps to Reproduce: Visit the page using various browsers. Actual Results: The string "Willkommen in der" does not fade and reappear. Expected Results: The string "Willkommen in der" shall slowly fade and reappear. No additional information
When the following line is reached, document.getElementById("willkommen").style.color="rgb("+r+","+g+","+b+")"; the r,g,b variables contain double values while rgb() should have integer or percentage parameters. I guess it doesn't work because of that. Using integer values make the effect works as expected. -> style
Component: General → Style System
Product: Firebird → Browser
Version: unspecified → Trunk
reassign to default QA/owner
Assignee: blake → dbaron
QA Contact: asa → ian
As comment 1 says, rgb() expressions require either *integers* or percentages. The CSS parser is treating the rgb() colors given as parse errors, and is thus ignoring them, as required by the CSS specification. ->invalid
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
The script really works after insertion of Math.round(...) statements, even in Mozilla & Firebird. Thank you for your efforts. Thomas
You need to log in before you can comment on or make changes to this bug.