WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
137156
HTMLPlugInElement::isUserObservable() is causing layout
https://bugs.webkit.org/show_bug.cgi?id=137156
Summary
HTMLPlugInElement::isUserObservable() is causing layout
Chris Dumez
Reported
2014-09-26 13:54:14 PDT
While profiling the page load of nytimes.com, I noticed that we were spending ~4-5% of cpu time in HTMLPlugInElement::isUserObservable(), the reason being that the function calls pluginWidget(), which causes a layout update in HTMLObjectElement::renderWidgetForJSBindings(). HTMLPlugInElement::isUserObservable() shouldn't need to do a layout.
Attachments
Patch
(11.71 KB, patch)
2014-09-26 14:34 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(11.02 KB, patch)
2014-09-26 15:49 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(10.91 KB, patch)
2014-09-27 21:58 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Patch
(10.91 KB, patch)
2014-09-27 22:04 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2014-09-26 14:34:36 PDT
Created
attachment 238738
[details]
Patch
Ryosuke Niwa
Comment 2
2014-09-26 14:42:20 PDT
Comment on
attachment 238738
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=238738&action=review
> Source/WebCore/html/HTMLAppletElement.cpp:86 > -RenderWidget* HTMLAppletElement::renderWidgetForJSBindings() const > +RenderWidget* HTMLAppletElement::renderWidgetForJSBindings(LayoutPolicy shouldUpdateLayout) const
I don't think shouldUpdateLayout is a good argument name in that it doesn't tell us why we would like to update the layout in the first place. What's misleading is that this function is called renderWidgetForJSBindings. If we're obtaining the render widget for JS bindings, we definitely need to update the layout per comment below.
> Source/WebCore/html/HTMLPlugInElement.cpp:169 > - RenderWidget* renderWidget = renderWidgetForJSBindings(); > + RenderWidget* renderWidget = renderWidgetForJSBindings(shouldUpdateLayout);
It's weird that this function always calls renderWidgetForJSBindings even if it's not for JS bindings. We should either rename the function or add a new function that's used for other purposes than JS bindings.
> Source/WebCore/html/HTMLPlugInElement.h:55 > + enum LayoutPolicy { LayoutPolicyDoNotUpdate, LayoutPolicyUpdate }; > + WEBCORE_EXPORT Widget* pluginWidget(LayoutPolicy = LayoutPolicyUpdate) const;
It's not clear to someone reading this code why anyone would like to update the layout in order to get Widget* The enum value names should signify _why_.
Chris Dumez
Comment 3
2014-09-26 15:49:05 PDT
Created
attachment 238743
[details]
Patch
Ryosuke Niwa
Comment 4
2014-09-27 13:24:03 PDT
Comment on
attachment 238743
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=238743&action=review
> Source/WebCore/html/HTMLPlugInElement.h:54 > + enum PluginLoadingPolicy { PluginLoadingPolicyDoNotLoad, PluginLoadingPolicyLoad };
I don't think there is a value in prefixing the enum value with PluginLoadingPolicy. If anything, use enum class instead.
> Source/WebCore/html/HTMLPlugInElement.h:55 > + WEBCORE_EXPORT Widget* pluginWidget(PluginLoadingPolicy = PluginLoadingPolicyLoad) const;
Nit: Two spaces before =.
Chris Dumez
Comment 5
2014-09-27 21:58:49 PDT
Created
attachment 238802
[details]
Patch
Chris Dumez
Comment 6
2014-09-27 22:04:51 PDT
Created
attachment 238803
[details]
Patch
WebKit Commit Bot
Comment 7
2014-09-27 22:57:54 PDT
Comment on
attachment 238803
[details]
Patch Clearing flags on attachment: 238803 Committed
r174040
: <
http://trac.webkit.org/changeset/174040
>
WebKit Commit Bot
Comment 8
2014-09-27 22:58:00 PDT
All reviewed patches have been landed. Closing bug.
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