<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>24129</bug_id>
          
          <creation_ts>2009-02-24 11:22:31 -0800</creation_ts>
          <short_desc>Dropdown list doesn&apos;t open when onmousedown handler returns false</short_desc>
          <delta_ts>2022-09-29 12:53:54 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>UI Events</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc>http://www.emule-island.com/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="jasneet">jasneet</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>barraclough</cc>
    
    <cc>bfulgham</cc>
    
    <cc>ian</cc>
    
    <cc>jasneet</cc>
    
    <cc>rakeshchaitan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>110777</commentid>
    <comment_count>0</comment_count>
    <who name="jasneet">jasneet</who>
    <bug_when>2009-02-24 11:22:31 -0800</bug_when>
    <thetext>I Steps:
Go to http://www.emule-island.com/

II Issue : 
In right column, Dropdown for Films is not working. On clicking dropdown arrow, doesn&apos;t show dropdown list

III Conclusion:
In the javascript, they are setting the &lt;div&gt;s with className &quot;menuItem&quot; with the following: 
     alldiv[i].onmousedown = selectMenuItem;

in which selectMenuItem  is a function defined as: 
function selectMenuItem(e) {
	if(document.all)e = event;
	if (e.target) source = e.target; 
				else if (e.srcElement) source = e.srcElement;
			if (source.nodeType == 3) // defeat Safari bug
				source = source.parentNode;
				
	return false;
}

This is causing the issue in webkit. 

IV Other Browsers:
FF3: OK
IE7: OK 

V Nightly tested: 41018

Bug in Chromium : http://code.google.com/p/chromium/issues/detail?id=6932</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110778</commentid>
    <comment_count>1</comment_count>
      <attachid>27923</attachid>
    <who name="jasneet">jasneet</who>
    <bug_when>2009-02-24 11:22:50 -0800</bug_when>
    <thetext>Created attachment 27923
reduced testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>574485</commentid>
    <comment_count>2</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2012-03-08 18:57:36 -0800</bug_when>
    <thetext>This doesn&apos;t look like an issue in the JSC part of the code, like bindings or events?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>576455</commentid>
    <comment_count>3</comment_count>
    <who name="Rakesh">rakeshchaitan</who>
    <bug_when>2012-03-12 13:24:44 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; This doesn&apos;t look like an issue in the JSC part of the code, like bindings or events?
The event handler &quot;selectMenuItem&quot; in the script mentioned above returns false.
Hence the default action is prevented from JSEventListener::handleEvent() (http://trac.webkit.org/browser/trunk/Source/WebCore/bindings/js/JSEventListener.cpp#L156).

If returning false from event handler is for preventing default action then this is an expected behavior?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>576467</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-12 13:35:36 -0700</bug_when>
    <thetext>If it still works in Firefox and IE, then it may not be expected!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>577540</commentid>
    <comment_count>5</comment_count>
    <who name="Rakesh">rakeshchaitan</who>
    <bug_when>2012-03-13 10:54:59 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; If it still works in Firefox and IE, then it may not be expected!

The specs http://dev.w3.org/html5/spec/Overview.html#event-handler-attributes says &quot;If return value is a boolean with the value false, then cancel the event.&quot; and I think our implementation is as per specs.

Shall we keep it as it is or make it similar to Firefox/IE?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>577594</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-13 11:28:22 -0700</bug_when>
    <thetext>I don&apos;t have a complete answer. If HTML5 is blatantly incompatible with both IE and Firefox, then the spec and WebKit should likely change. But there may be something more subtle in this particular case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>581959</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-03-19 11:14:52 -0700</bug_when>
    <thetext>The event should be canceled, that&apos;s not the problem here.

The difference is that in Firefox, the dropdown drops before the event is fired.

Compare the behaviours on this test:
   http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1412

The HTML spec doesn&apos;t say anything about how the widgets are implemented at that level. It differs from platform to platform, so there&apos;s not much the spec _can_ say. For compatibility, though, it seems that select widgets implemented using dropdowns should drop down before the mousedown event is fired at the DOM.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1902098</commentid>
    <comment_count>8</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-29 10:59:01 -0700</bug_when>
    <thetext>*** Safari 16 ***

log: object &quot;[object HTMLSelectElement]&quot; (311 props: 0=&quot;[object HTMLOptionElement]&quot;, autocomplete=&quot;&quot;, disabled=false, form=&quot;null&quot;...)
log: false
log: object &quot;[object HTMLDivElement]&quot; (288 props: align=&quot;&quot;, title=&quot;&quot;, lang=&quot;&quot;, translate=true...)
log: true

*** Chrome Canary 108 ***

log: object &quot;[object HTMLSelectElement]&quot; (338 props: 0=&quot;[object HTMLOptionElement]&quot;, autocomplete=&quot;&quot;, disabled=false, form=&quot;null&quot;...)
log: false
log: object &quot;[object HTMLDivElement]&quot; (315 props: align=&quot;&quot;, title=&quot;&quot;, lang=&quot;&quot;, translate=true...)
log: true

*** Firefox Nightly 107 ***

log: object &quot;[object HTMLSelectElement]&quot; (285 props: 0=&quot;[object HTMLOptionElement]&quot;, item=function item() {\n    [native code]\n}, namedItem=function namedItem() {\n    [native code]\n}, add=function add() {\n    [native code]\n}...)

log: false

log: object &quot;[object HTMLDivElement]&quot; (261 props: align=&quot;&quot;, click=function click() {\n    [native code]\n}, attachInternals=function attachInternals() {\n    [native code]\n}, focus=function focus() {\n    [native code]\n}...)

log: true

_________

Just wanted to share updated results based on test case from Comment 07. It seems to me that all browsers are showing same. Can someone confirm whether something else is required? Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1902152</commentid>
    <comment_count>9</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-09-29 12:53:54 -0700</bug_when>
    <thetext>Other browsers match Safari now, returning false from mousedown event handler prevents opening the menu.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>27923</attachid>
            <date>2009-02-24 11:22:50 -0800</date>
            <delta_ts>2009-02-24 11:22:50 -0800</delta_ts>
            <desc>reduced testcase</desc>
            <filename>test_standard.html</filename>
            <type>text/html</type>
            <size>1031</size>
            <attacher name="jasneet">jasneet</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEvL0VOIiAiaHR0cDov
L3d3dy53My5vcmcvVFIvaHRtbDQvc3RyaWN0LmR0ZCI+DQo8aHRtbD4NCjxoZWFkPg0KPHNjcmlw
dCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPg0KZnVuY3Rpb24gaW5pdE1lbnVJdGVtcygpIHsNCgl2
YXIgYWxsZGl2ID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCe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