Closed
Bug 130800
Opened 23 years ago
Closed 21 years ago
HTML button 'forgets' its js set position when clicked
Categories
(Core :: Layout: Form Controls, defect, P2)
Tracking
()
RESOLVED
WORKSFORME
Future
People
(Reporter: bugzilla.t.jvance, Assigned: john)
References
()
Details
(Keywords: testcase)
Attachments
(1 file)
659 bytes,
text/html
|
Details |
Paste the following html/javascript into a web page. Clicking on the button moves the button to the right two or three times, and then stops. Sometimes after several minutes, an additional click will move the button one more time. When the onclick fails to fire, pressing and holding the mouse button down makes the button appear depressed, and in a previous position (50 or 100 pixels to the left.) Releasing the mouse button returns the button to its current position. Pressing the enter key consistently steps the button to the right. This is particularly embarrassing because the demo code was found in a Netscape 6 tutorial! <!-- begin sample code --> <FORM> <INPUT ID="counter1" STYLE="position:relative; left:0px" TYPE="button" VALUE="Move Button" onclick="handleClick()"> </FORM> <SCRIPT LANGUAGE="JavaScript"> <!-- var obj = document.getElementById('counter1'); var xlocation = parseInt(obj.style.left); alert(xlocation); function handleClick() { xlocation += 50; document.getElementById('counter1').style.left = xlocation + "px"; } // --> </SCRIPT> <!-- end sample code --> Expected behavior: Mouse click should march the button in 50 pixel steps to the right indefinitely. Works in IE 5.5 Platforms/builds tested: 0.9.9 Win 95 20020217 Sparc Solaris
Comment 1•23 years ago
|
||
Over to DOM Events.
Assignee: jst → joki
Component: DOM Level 0 → DOM Events
QA Contact: desale → vladimire
Comment 2•23 years ago
|
||
Confirming bug, but there is nothing wrong with the click event. The problem seems to be that when the HTML button is depressed it temporarily moves back to its original location. If this location moves it out from under the cursor then the mouseup event doesn't happen on the HTML button, and hence the _click_ event naturally doesn't either. Also attaching reporters example.
Comment 3•23 years ago
|
||
Confirming and changing Summary.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Mouse left-click does not appear to fire button's onclick event consistently → HTML button 'forgets' its js set position when clicked
Reporter | ||
Comment 4•23 years ago
|
||
Confirming button behavior Click and hold mouse button down, and the HTML button jumps to the left. If the HTML button jumps out from underneath the mouse cursor, the onClick does not fire. If, while holding the mouse button down, you move the mouse, the button jumps back. Releasing the mouse button over the HTML button fires the event. Is this still DOM Event or is it something else?
Updated•22 years ago
|
Priority: -- → P2
Assignee | ||
Updated•22 years ago
|
Component: DOM Events → Layout: Form Controls
Reporter | ||
Comment 6•22 years ago
|
||
Still broken on Mozilla 1.3a, Linux. More strangeness: on depressing the mouse button, the form button at position b jumps to its original position a. Move the mouse one pixel, and the button jumps back to b. Move the mouse one more pixel, it jumps to a. Make little circles with the mouse cursor while the mouse button is depressed, and the form button flickers back and forth between position a and b.
Assignee | ||
Comment 7•22 years ago
|
||
Boris might be interested to see this. It's a relatively positioned button, almost certainly an incremental reflow problem.
Comment 8•22 years ago
|
||
This almost smells like some cached data is not being cleared out of the ruletree...
Comment 9•22 years ago
|
||
Boy, the behavior of the button in the testcase was correct in the 6/11/02 trunk build, but I can reproduce the bug in the 1/08/03 Trunk build in Windows.
Keywords: testcase
Updated•22 years ago
|
Target Milestone: --- → Future
Comment 10•21 years ago
|
||
This worksforme in current builds; probably fixed by bug 171830
You need to log in
before you can comment on or make changes to this bug.
Description
•