WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2014-03-16 03:25:59 PDT
Created
attachment 226839
[details]
Patch
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
Committed
r165773
: <
http://trac.webkit.org/changeset/165773
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug