Summary: | HTMLInputElement::defaultEventHandler() shouldn't force style updates. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||
Component: | Forms | Assignee: | Andreas Kling <kling> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | kling, koivisto | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Andreas Kling
2014-03-16 03:24:43 PDT
Created attachment 226839 [details]
Patch
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. Committed r165773: <http://trac.webkit.org/changeset/165773> |