RESOLVED FIXED 130303
HTMLInputElement::defaultEventHandler() shouldn't force style updates.
https://bugs.webkit.org/show_bug.cgi?id=130303
Summary HTMLInputElement::defaultEventHandler() shouldn't force style updates.
Andreas Kling
Reported 2014-03-16 03:24:43 PDT
HTMLInputElement::defaultEventHandler() shouldn't force style updates.
Attachments
Patch (2.22 KB, patch)
2014-03-16 03:25 PDT, Andreas Kling
andersca: review+
Andreas Kling
Comment 1 2014-03-16 03:25:59 PDT
Darin Adler
Comment 2 2014-03-16 08:42:28 PDT
Comment on attachment 226839 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=226839&action=review > Source/WebCore/ChangeLog:10 > + There might be a better way to do this; we only want to know if the > + element has/gets a renderer at all, but this is an easy hack to avoid > + a lot of unnecessary work. This comment made me see a little bit of opportunity for additional optimization. We don’t in fact just want to know if the element has a renderer in all cases. We use the renderer for blur and focus. And in the other cases we want to know if there’s a renderer. But in still-other cases we don’t need to check the renderer for null at all! > Source/WebCore/html/TextFieldInputType.cpp:180 > + element().document().updateStyleIfNeededForNode(element()); > if (element().renderer() && (event->isMouseEvent() || event->isDragEvent() || event->eventInterface() == WheelEventInterfaceType || event->type() == eventNames().blurEvent || event->type() == eventNames().focusEvent)) { Should rearrange this to only do the updateStyleIfNeededForNode after the second half of the if statement returns true. No reason to do this style update for other types of events.
Andreas Kling
Comment 3 2014-03-17 16:14:00 PDT
Note You need to log in before you can comment on or make changes to this bug.