Closed Bug 302027 Opened 19 years ago Closed 19 years ago

input element doesn't dispatch DOMActivate event

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stpride, Assigned: jhpedemonte)

Details

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b4) Gecko/20050725 Firefox/1.0+
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b4) Gecko/20050725 Firefox/1.0+

Implementing the example in the spec (9.2.1: The switch Element) fails.

Reproducible: Always
Attached file testcase
Actually, the problem here is that the <xforms:input> doesn't fire a DOMActivate
event.  Changing summary accordingly.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Summary: DOMActivate not working for switch/case → input element doesn't dispatch DOMActivate event
Assignee: aaronr → jhpedemonte
Status: ASSIGNED → NEW
Attached patch patchSplinter Review
The <xforms:input> element sits on top of the <html:input> element.  But it
seems that the <html:input> element won't fire a DOMActivate event on the
'Enter' keypress unless it is inside of <html:form> element.  This patch adds
code to xforms.xml in order to dispatch the event.  I also made it so
"xformswidget-input-boolean" ignores the 'Enter' keypress.
Attachment #190479 - Flags: review?(aaronr)
Comment on attachment 190479 [details] [diff] [review]
patch

>+                  onkeypress="if (event.keyCode == 13) this.parentNode.dispatchDOMActivate();"

I'd prefer "if (event.keyCode == event.DOM_VK_RETURN) .... "
Comment on attachment 190479 [details] [diff] [review]
patch

Quite right, smaug.  Since you already took a look, do you mind giving me an
'official' review?
Attachment #190479 - Flags: review?(smaug)
Comment on attachment 190479 [details] [diff] [review]
patch

like smaug mentioned, replace that hard coded 13 with the appropriate define. 
Otherwise looks good.  r=me
Attachment #190479 - Flags: review?(aaronr) → review+
Comment on attachment 190479 [details] [diff] [review]
patch

change the '13' and r=me
Attachment #190479 - Flags: review?(smaug) → review+
Checked in to trunk. ->FIXED
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Huh. Now we have two identical dispatchDOMActivate() functions in xforms.xml,
one for xforms-trigger-base and xforms-input. Couldn't this be a function on
xformswidget-base?
Attached patch use common method (obsolete) — Splinter Review
Quite right.  Don't know how I missed it.  So this patch just moves the
|dispatchDOMActivate| method to xformswidget-base, and removes the other
references.
Attachment #190765 - Flags: review?(allan)
Comment on attachment 190765 [details] [diff] [review]
use common method

kill trigger-base too, it's not needed anymore
Attachment #190765 - Flags: review?(allan) → review-
Cool, I didn't know what to do with |xformswidget-trigger-base|, if it was
needed for another reason or if it could just be removed.  So this patch
removes it entirely, and make |xformswidget-trigger-minimal| extend
|xformswidget-base| instead.
Attachment #190765 - Attachment is obsolete: true
Attachment #190957 - Flags: review?(allan)
Comment on attachment 190957 [details] [diff] [review]
use common method v2

(In reply to comment #12)
> Cool, I didn't know what to do with |xformswidget-trigger-base|, if it was
> needed for another reason or if it could just be removed.  So this patch
> removes it entirely, and make |xformswidget-trigger-minimal| extend
> |xformswidget-base| instead.

That's the trick. r=me
Attachment #190957 - Flags: review?(allan) → review+
Attachment #190957 - Flags: review?(doronr)
Attachment #190957 - Flags: review?(doronr) → review+
Actually, the original problem still exists (i.e., doesn't switch case when
focus out of input box - see testcase).  Should this bug be reopened, or a new
bug be opened?
Stephen, that behavior relies on the DOMFocusOut event, which is discussed in
bug 299379.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: