Bug 106146

Summary: Show label automatically for plugins of significant size
Product: WebKit Reporter: Jon Lee <jonlee>
Component: WebKit Misc.Assignee: Jon Lee <jonlee>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, eric, mjs, ojan.autocc, simon.fraser, webkit-bug-importer, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.8   
Attachments:
Description Flags
Patch simon.fraser: review+

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+
Jon Lee
Comment 1 2013-01-04 16:22:22 PST
Jon Lee
Comment 2 2013-01-04 19:10:47 PST
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
Note You need to log in before you can comment on or make changes to this bug.