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't show dropdown list III Conclusion: In the javascript, they are setting the <div>s with className "menuItem" 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
Created attachment 27923 [details] reduced testcase
This doesn't look like an issue in the JSC part of the code, like bindings or events?
(In reply to comment #2) > This doesn't look like an issue in the JSC part of the code, like bindings or events? The event handler "selectMenuItem" 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?
If it still works in Firefox and IE, then it may not be expected!
(In reply to comment #4) > 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 "If return value is a boolean with the value false, then cancel the event." and I think our implementation is as per specs. Shall we keep it as it is or make it similar to Firefox/IE?
I don'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.
The event should be canceled, that'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't say anything about how the widgets are implemented at that level. It differs from platform to platform, so there'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.
*** Safari 16 *** log: object "[object HTMLSelectElement]" (311 props: 0="[object HTMLOptionElement]", autocomplete="", disabled=false, form="null"...) log: false log: object "[object HTMLDivElement]" (288 props: align="", title="", lang="", translate=true...) log: true *** Chrome Canary 108 *** log: object "[object HTMLSelectElement]" (338 props: 0="[object HTMLOptionElement]", autocomplete="", disabled=false, form="null"...) log: false log: object "[object HTMLDivElement]" (315 props: align="", title="", lang="", translate=true...) log: true *** Firefox Nightly 107 *** log: object "[object HTMLSelectElement]" (285 props: 0="[object HTMLOptionElement]", 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 "[object HTMLDivElement]" (261 props: align="", 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!
Other browsers match Safari now, returning false from mousedown event handler prevents opening the menu.