ondblclick() can't be called from js until it has been triggered by an actual double click.




18 years ago
13 years ago


(Reporter: galfandary, Assigned: joki)



Firefox Tracking Flags

(Not tracked)




(2 attachments)



18 years ago
<title>Double Click Bug</title>
function dbg(s) { document.form1.events.value+=s+'\n'; }
<h1 id=text1 onclick="dbg('Text 1 clicked')" ondblclick="dbg('Text 1 double-
clicked')">Text 1</h1>
<h1 id=text2 onclick="dbg('Text 2 clicked')" ondblclick="dbg('Text 2 double-
clicked')">Text 2</h1>
<form name=form1>
<input type=text name=click1 value=text1>
<input type=button value="Click By ID"
<input type=text name=click2 value=text1>
<input type=button value="Double-Click By ID"
<textarea name=events rows=20 cols=30>

If you click the "Double-Click By ID" button in the page above
nothing happens. If you double-click the text itself then the
corresponding ondblclick() function call begins to work.
Assignee: rogerl → joki
Severity: critical → normal
Component: Javascript Engine → Event Handling
QA Contact: pschwartau → madhur
Lowering severity to normal and moving over to Event Handling
Created attachment 43983 [details]
reporter's html
Created attachment 43984 [details]
reporter's html with linefeed inside the quotes of ondblclick="dbg('Text 2 double-clicked')" removed
the second attachment works for me. w98 2001072808 trunk

Comment 5

18 years ago
See also bug 47078, Newlines are not converted to whitespace in attributes.

By the way, the testcase doesn't work in IE either.  Does it work in any 

-> Parser
Assignee: joki → harishd
Component: Event Handling → Parser
QA Contact: madhur → bsharma
Summary: ondblclick() is inaccessible. → newline in ondblclick attribute is sent to JS engine

Comment 6

18 years ago
Please ignore the newline it was entered by the textarea in the bug form.
Use the URL above.
Severity: normal → critical
Component: Parser → Javascript Engine
Summary: newline in ondblclick attribute is sent to JS engine → ondblclick() is inaccessible.

Comment 7

18 years ago
BTW, it DOES work with IE5.

Comment 8

18 years ago
I don't believe this bug is platform specific but, just in case,
it was reproducible on the SUN nightly 20010730.

Comment 9

18 years ago
Also reproducible on:
Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.2) Gecko/20010704


18 years ago
Assignee: harishd → joki
Severity: critical → normal
Component: Javascript Engine → DOM Events
Ever confirmed: true
QA Contact: bsharma → vladimire
Summary: ondblclick() is inaccessible. → ondblclick() can't be called from js until it has been triggered by an actual double click.

Comment 10

18 years ago
Ok, I see what you're saying now.  Sorry for misunderstanding the bug report.

Sounds like this is a DOM issue rather than a JavaScript language issue, so ->
DOM Events and confirming.


17 years ago
Target Milestone: --- → mozilla1.1


16 years ago
Priority: -- → P4

Comment 11

14 years ago
The original bug reported here seems to be gone: the (second) testcase works for
me using Firefox 1.0 on the Mac.  (The "double click by ID" button works fine
from the start.)

However, it looks like the bug that was inadvertently revealed because of the
extra linefeed in the first testcase is still present: the newlines in the
ondblclick attributes are being sent to the Javascript processor (on an actual
double-click, the console gives an "unterminated string literal" error, while
the "by ID" button gives an "uncaught exception").  This seems to be related to
a number of other bugs caused by line breaks in the HTML not being properly
replaced with spaces (bug 67127, for example; also see bug 47078).

At any rate, it seems clear that this bug report should be changed somehow:
either the status should be "worksforme" (and a second bug report filed for the
newline problem, if that's not already duplicated somewhere), or the bug should
be morphed to cover the new topic (probably with a change of components).  I
don't have the authority (or the knowledge, really) to do either, but it would
be good if someone eventually did.

Comment 12

13 years ago
For the record, I have just filed bug 322270 to address the issue of line breaks in javascript attributes that was revealed by the first attachment here.  This bug should probably be resolved as WORKSFORME at this point, since the originally stated bug no longer seems to be present (but I haven't tested carefully on multiple platforms, so I'd appreciate comments before making that change).  The secondary issue should hopefully be covered by the new bug.

Comment 13

13 years ago
WFM Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060102 Firefox/1.6a1

with the second testcase.
Last Resolved: 13 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.