Bug 10457 - Disabling of default action in mouseup handler disables mousemove event
Summary: Disabling of default action in mouseup handler disables mousemove event
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 420+
Hardware: Macintosh PowerPC OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2006-08-17 04:45 PDT by Miroslav Juhos
Modified: 2009-02-09 08:23 PST (History)
1 user (show)

See Also:


Attachments
Testcase (579 bytes, text/html)
2006-08-17 04:47 PDT, Miroslav Juhos
no flags Details
Testcase2 (555 bytes, text/html)
2006-08-18 04:10 PDT, Miroslav Juhos
no flags Details
Testcase3 (628 bytes, text/html)
2006-08-18 04:12 PDT, Miroslav Juhos
no flags Details
Testcase2 (560 bytes, text/html)
2006-08-18 04:15 PDT, Miroslav Juhos
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miroslav Juhos 2006-08-17 04:45:24 PDT
Overview Description: 
Problem is caused by disabling of default browser action in "onmouseup" handler. There are two ways how do that:
1) Set return value of "onmouseup" handler to "false" (see Test case)
2) Call method event.preventDefault() (see Test case modification)

Disabling of default action is affecting behavior of other events - but they couldn't be affected (try test case in Firefox). So that after mouseup isn't triggered "mousemove" event in this case.

Steps to Reproduce:
  1) Open test case in Safari (WebKit)
  2) Move mouse up and down over text
  3) Click on some text in testcase
  4) Move mouse up and down over text

Actual Results:
  When I moved mouse, items are not highlited.

Expected Results: 
  When I moved mouse, items will be highlited.

Build Date & Platform: 
  Build 2002-008-17 on Mac OS 10.4.7

Test case:
<html>
  <script>
    function highlight(item) {
     item.style.backgroundColor = (item.style.backgroundColor == "red") ? '' : 'red';
    }
    onmouseup = function() {
      return false;
    }
  </script>
  <body>
    <div onmouseover="highlight(this)" onmouseout="highlight(this)">Item1</div>
    <div onmouseover="highlight(this)" onmouseout="highlight(this)">Item2</div>
    <div onmouseover="highlight(this)" onmouseout="highlight(this)">Item3</div>
    <div onmouseover="highlight(this)" onmouseout="highlight(this)">Item4</div>
  </body>
</html>

Test case modification:
    onmouseup = function(event) {
      event.preventDefault();
    }
Comment 1 Miroslav Juhos 2006-08-17 04:47:21 PDT
Created attachment 10088 [details]
Testcase
Comment 2 Miroslav Juhos 2006-08-17 07:06:35 PDT
Build Date & Platform should be: 
  Build 2006-08-17 on Mac OS 10.4.7
Comment 3 Miroslav Juhos 2006-08-18 04:10:37 PDT
Created attachment 10119 [details]
Testcase2
Comment 4 Miroslav Juhos 2006-08-18 04:12:25 PDT
Created attachment 10120 [details]
Testcase3

Try set return value to "false" in omousedown handler - when is set to "false", it will work correct.
Comment 5 Miroslav Juhos 2006-08-18 04:15:11 PDT
Created attachment 10121 [details]
Testcase2

Fix of bug in Textcase2 (missing variable event)
Comment 6 Alexey Proskuryakov 2007-07-02 06:32:02 PDT
I cannot reproduce this issue with any of the attached tests (r23841).
Comment 7 Frank Y 2008-12-03 09:44:58 PST
Cannot reproduce issue.  Webkit-r38386, Computer-G4 Powerbook, OS-OSX 10.5.5
Comment 8 Alexey Proskuryakov 2009-02-09 08:23:58 PST
Closing, because this was not reproducible.