Closed Bug 388422 Opened 13 years ago Closed 11 years ago
Avoid checks for editability in Bind
UpdateEditableState shows up in the profile for bug 388108. Should find a way to avoid it unless we're sure it is needed or make it cheap (avoid checking for the contentEditable attribute for example).
To be exact, of the 14482 hits under nsGenericElement::BindToTree, 5609 are under nsGenericHTMLElement::UpdateEditableState. That said, there are 26671 hits under nsGenericHTMLElement::BindToTree. Of those, for example, 5776 are under nsAttrAndChildArray::SetMappedAttrStyleSheet. So the UpdateEditableState cost is not any more than that. Then again, maybe we can fix that too... Also for comparison, the total number of hits under nsGenericElement::doInsertChildAt is 72343; 14547 of those are under nsAttrAndChildArray::InsertChildAt.
When profiling artificial testcase https://bugzilla.mozilla.org/attachment.cgi?id=350841, checking contentEditable attribute takes more than 5%. We could easily fix that by using some flag to check if the attribute is there.
This is similar to ID, class and style attribute optimizations.
The patch does still apply cleanly to trunk.
Would it make sense to have a non-virtual UpdateEditableState in nsIContent and move GetContentEditableValue to nsIContent?
Comment on attachment 368226 [details] [diff] [review] up-to-date I forgot about form controls and UpdateEditableFormControlState :-(.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.