Closed Bug 602151 Opened 14 years ago Closed 14 years ago

Too many calls to OnValueChanged

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b7

People

(Reporter: bzbarsky, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

See bug 190147 comment 30, this part:

  We call nsHTMLTextAreaElement::OnValueChanged from both 
  nsTextInputListener::EditAction _and_ from nsTextEditorState::SetValue 
  directly.

The upshot is that we do 2x the notification we really need to do.  Can we avoid this?
I doubt it; I don't recall it showing up in my profile.
Those calls are coming from <http://hg.mozilla.org/mozilla-central/diff/751da00c7b53/content/html/content/src/nsTextEditorState.cpp> landed in bug 558788.

But unless I'm missing something, only one of these should be called per editing operation, right?
Keywords: perf
This bug is about multiple calls to the function when .value is set on the input or textarea.  One call from EditAction, and one call from the value setter itself.
(In reply to comment #4)
> This bug is about multiple calls to the function when .value is set on the
> input or textarea.  One call from EditAction, and one call from the value
> setter itself.

Ah, right...  I'll have a patch shortly.
Attached patch Patch (v1)Splinter Review
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #481314 - Flags: review?(bzbarsky)
Attachment #481314 - Flags: approval2.0?
Comment on attachment 481314 [details] [diff] [review]
Patch (v1)

Ah, excellent.
Attachment #481314 - Flags: review?(bzbarsky)
Attachment #481314 - Flags: review+
Attachment #481314 - Flags: approval2.0?
Attachment #481314 - Flags: approval2.0+
Whiteboard: [needs landing]
OS: Mac OS X → All
Hardware: x86 → All
http://hg.mozilla.org/mozilla-central/rev/7abc5a320109
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Target Milestone: --- → mozilla2.0b8
Target Milestone: mozilla2.0b8 → mozilla2.0b7
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: