Closed Bug 613979 Opened 14 years ago Closed 14 years ago

oninput should fire after the validity state update

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b9
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: mounir, Assigned: mounir)

References

()

Details

(Keywords: compat)

Attachments

(1 file)

For the moment, the validity states, when the user is typing, is updated after oninput fires. We can imagine that a lot of scripts will try to use oninput to play with validity.
That would be very bad to ship with this behavior.

Presto and Webkit fires oninput after the validity state update.

Testcase: open url, type in the input field. You should see "true", with current trunk, you will see "false".
Blocks: 613973
Should be blocking. See comment 0.
blocking2.0: --- → ?
So form elements could check the validity in PreHandleEvent when trusted input 
event is dispatched?
(In reply to comment #2)
> So form elements could check the validity in PreHandleEvent when trusted input 
> event is dispatched?

Actually, the fix is simple: we just need to switch FireOnInput and OnValueChanged calls [1]. However, I'm wondering if doing the validity state in PreHandleEvent wouldn't have been better?

[1] http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/nsTextEditorState.cpp#883
Attached patch Patch v1Splinter Review
Assignee: nobody → mounir.lamouri
Status: NEW → ASSIGNED
Attachment #492340 - Flags: review?(Olli.Pettay)
Blocking per Mounir's original comment.
blocking2.0: ? → betaN+
Whiteboard: [passed-try][needs-review]
Attachment #492340 - Flags: review?(Olli.Pettay) → review+
Keywords: compat
Whiteboard: [passed-try][needs-review] → [passed-try][needs-landing]
Pushed:
http://hg.mozilla.org/mozilla-central/rev/14f1f60c6a11
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [passed-try][needs-landing]
Target Milestone: --- → mozilla2.0b9
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: