Closed Bug 315575 Opened 19 years ago Closed 19 years ago

Marquee Element: incrementing or decrementing the scrollAmount or scrollDelay attributes dynamically via JavaScript produces unexpected results.

Categories

(Firefox :: General, defect)

x86
Windows 2000
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: d.jones, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)
Build Identifier: Mozilla/5.0

Incrementing or decrementing the scrollAmount or scrollDelay attributes of a Marquee element via JavaScript produces an incorrect value.

Reproducible: Always

Steps to Reproduce:
1. Create a webpage with the following html markup:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
  <title>marquee test</title>
 </head>
 <body>
 
  <marquee id="marqueeTest" scrollamount="6" scrolldelay="6">FireFox is the best webbrowser.</marquee>
  
<input type="button" 
   onclick="document.getElementById('marqueeTest').scrollAmount+=1;alert(document.getElementById('marqueeTest').scrollAmount);"
   value="Increment scrollAmount">
   
<input type="button" 
   onclick="document.getElementById('marqueeTest').scrollDelay+=1;alert(document.getElementById('marqueeTest').scrollDelay);"
   value="Increment scrollDelay"><br />
  
 <input type="button" 
   onclick="document.getElementById('marqueeTest').scrollAmount-=1;alert(document.getElementById('marqueeTest').scrollAmount);"
   value="Decrement scrollAmount">
   
<input type="button" 
   onclick="document.getElementById('marqueeTest').scrollDelay-=1;alert(document.getElementById('marqueeTest').scrollDelay);"
   value="Decrement scrollDelay">
   
 </body>
</html>

2. Browse to that page using FireFox and click on the various buttons.



Actual Results:  
FireFox doesn't increment or decrement the scrollAmount or scrollDelay attributes instead it treats the values as strings.

With the exception of decrementing the scrollAmount attribute, which produces the expected result.

Expected Results:  
FireFox should be consistent in the way it handles incrementing and decrementing the scrollAmount/scrollDelay attributes either treat them as a string or as a integer.

parseInt fixes this issue:
  <marquee id="marqueeTest" scrollamount="6" scrolldelay="6">FireFox is the best webbrowser.</marquee>
  <input type="button" 
   onclick="document.getElementById('marqueeTest').scrollAmount=parseInt(document.getElementById('marqueeTest').scrollAmount)+1;alert(document.getElementById('marqueeTest').scrollAmount);"
   value="Increment scrollAmount">
Attached file Reporters testcase (obsolete) —
document.getElementById('marqueeTest').scrollAmount += 1 

As mentioned, Firefox returns scrollAmount as a string, and IE return it as a number
Attached file Reporters testcase
Attachment #202269 - Attachment is obsolete: true
Keywords: testcase
Depends on: 160162
Fixed by the patch in bug 160162.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: