WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
106146
Show label automatically for plugins of significant size
https://bugs.webkit.org/show_bug.cgi?id=106146
Summary
Show label automatically for plugins of significant size
Jon Lee
Reported
2013-01-04 16:21:50 PST
Snapshotted plugins that dominate a page should automatically show the label.
Attachments
Patch
(15.05 KB, patch)
2013-01-04 19:10 PST
,
Jon Lee
simon.fraser
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jon Lee
Comment 1
2013-01-04 16:22:22 PST
<
rdar://problem/12783010
>
Jon Lee
Comment 2
2013-01-04 19:10:47 PST
Created
attachment 181421
[details]
Patch
Simon Fraser (smfr)
Comment 3
2013-01-04 19:40:50 PST
Comment on
attachment 181421
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=181421&action=review
> Source/WebCore/html/HTMLPlugInImageElement.cpp:293 > + LayoutRect plugInClipRect = node->renderer()->absoluteClippedOverflowRect();
Is node->renderer() always non-null?
> Source/WebCore/html/HTMLPlugInImageElement.cpp:352 > + if (shouldPlugInShowLabelAutomatically(document()->page()->mainFrame()->view()->contentsSize(), this))
Is everything in this chain always non-null?
> Source/WebCore/platform/Timer.h:143 > + void setDelay(double delay) { m_delay = delay; }
Not sure you need this (see later comment).
> Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp:276 > + m_showLabelDelayTimer.setDelay(reason == UserMousedOver ? showLabelAfterMouseOverDelay : showLabelAutomaticallyDelay); > + m_showLabelDelayTimer.restart();
Can't you just call startOneShot() and avoid touching Timer.h? I don't think you even need to call stop() beforehand.
Jon Lee
Comment 4
2013-01-06 23:12:03 PST
Comment on
attachment 181421
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=181421&action=review
>> Source/WebCore/html/HTMLPlugInImageElement.cpp:293 >> + LayoutRect plugInClipRect = node->renderer()->absoluteClippedOverflowRect(); > > Is node->renderer() always non-null?
I believe so. The renderer is already accessed earlier in subframeLoaderWillCreatePlugIn(), which is the caller of this function.
>> Source/WebCore/html/HTMLPlugInImageElement.cpp:352 >> + if (shouldPlugInShowLabelAutomatically(document()->page()->mainFrame()->view()->contentsSize(), this)) > > Is everything in this chain always non-null?
I cannot guarantee it is. I will add checks for mainFrame() and view(). page() is already checked earlier in this function.
>> Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp:276 >> + m_showLabelDelayTimer.restart(); > > Can't you just call startOneShot() and avoid touching Timer.h? I don't think you even need to call stop() beforehand.
Yes, you're right. Amended.
Jon Lee
Comment 5
2013-01-06 23:30:12 PST
Committed
r138927
: <
http://trac.webkit.org/changeset/138927
>
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