Setting overflow:auto|hidden on DIV is canceling events

RESOLVED DUPLICATE of bug 552707

Status

()

Core
Event Handling
--
major
RESOLVED DUPLICATE of bug 552707
11 years ago
7 years ago

People

(Reporter: Mitch Torgerson, Assigned: masayuki)

Tracking

({testcase})

Trunk
mozilla9
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

When overflow:auto|hidden is set on a DIV element, the event.target never changes.  I included test code in additional information.  When you mousedown on the DIV, and drag the mouse outside of the DIV element, the mousemove event.target (displayed in the document.title) never changes.  If overflow is removed from the DIV element, this works just fine.

Reproducible: Always

Steps to Reproduce:
USING THE TEST I ADDED IN ADDITIONAL INFORMATION:

1. Set overflow:auto|hidden on DIV element inside of the body.
2. Mouse down inside of DIV.
3. With the mouse down, move outside of the DIV.
4. The document title shows that the mousemove event.target never changes from the DIV element, no matter where you are on the page.

5. Remove overflow from the DIV element.
6. Repeat steps 2,3.
7. The document title shows that the mousemove event.target changes as you mousemove across the page.  That's how it should work.

Actual Results:  
With overflow:auto|hidden on the div element, when you mouse down inside of the DIV, and move your mouse around the page, the mousemove event.target does not change.

Expected Results:  
With overflow:auto|hidden on the div element, when you mouse down inside of the DIV, and move your mouse around the page, the mousemove event.target should change accordingly.  It works if overflow is not set on the DIV.  The mousemove event.target should work if overflow is set on the div or not.

This is the sample code:

<html>
<head>
<title>Test Page</title>
<script>
var drag_obj;
document.onmousedown = handle_mouseDown;
document.onmousemove = handle_mouseMove;
document.onmouseup = handle_mouseUp;
function handle_mouseDown(e)
{
  drag_obj = e.target;
}
function handle_mouseMove(e)
{
  if (drag_obj)
  {
    document.title = e.target;
  }
}
function handle_mouseUp(e)
{
  drag_obj = undefined;
}
</script>
</head>
<body>

<div style="overflow:hidden; width:300px; height:200px; border:#333333 1px solid;">Test Text</div>

</body>
</html>

Updated

11 years ago
Keywords: testcase

Updated

11 years ago
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → 1.8 Branch
I think this is basically the same as bug 294844.
Assignee: nobody → events
Component: Layout → Event Handling
Depends on: 294844
QA Contact: layout → ian
Version: 1.8 Branch → Trunk

Comment 3

11 years ago
check out bug 378106, I noticed the same bug in a different way (hadn't found this bug, so maybe my bug is a duplicate), and posted a simple test case with the onmouseout event (it will not fire if mouse is held inside an element with overflow hidden|auto|scroll.).
Assignee: events → nobody
QA Contact: ian → events

Updated

8 years ago
Blocks: 557512
No longer blocks: 557512
Assignee: nobody → masayuki
Status: UNCONFIRMED → ASSIGNED
Depends on: 552707
No longer depends on: 294844
Ever confirmed: true
Fixed by bug 552707 but you can see same issue if you mousedown in <input> or <textarea>. If you think it's still problem, please file a new bug.
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
And also <iframe>.
Temporarily, backed out for risk management of mozilla8, see bug 675865.

For simpler management, I mark this bug as dup of bug 552707.
No longer depends on: 552707
Resolution: FIXED → DUPLICATE
Target Milestone: mozilla8 → mozilla9
Duplicate of bug: 552707
You need to log in before you can comment on or make changes to this bug.