[Webkit-unassigned] [Bug 133667] Don't snapshot offscreen plugins that would normally be considered primary plugins after they are moved in view
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 10 15:06:04 PDT 2014
https://bugs.webkit.org/show_bug.cgi?id=133667
Tim Horton <thorton at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #232752|review? |review+
Flag| |
--- Comment #2 from Tim Horton <thorton at apple.com> 2014-06-10 15:06:28 PST ---
(From update of attachment 232752)
View in context: https://bugs.webkit.org/attachment.cgi?id=232752&action=review
> Source/WebKit2/WebProcess/Plugins/PluginView.cpp:1687
> + WebCore::HTMLPlugInImageElement* plugInImageElement = toHTMLPlugInImageElement(m_pluginElement.get());
I think there's no need for the WebCore:: here. Is this always safe or should you check the type?
> Source/WebKit2/WebProcess/Plugins/PluginView.cpp:1706
> + snapshotFound = snapshotImage && !isAlmostSolidColor(toBitmapImage(snapshotImage.get()));
>
> #if PLATFORM(COCOA)
> unsigned maximumSnapshotRetries = frame() ? frame()->settings().maximumPlugInSnapshotAttempts() : 0;
> - if (snapshotImage && isAlmostSolidColor(toBitmapImage(snapshotImage.get())) && m_countSnapshotRetries < maximumSnapshotRetries) {
> + if (snapshotImage && isAlmostSolidColor(toBitmapImage(snapshotImage.get())) && m_countSnapshotRetries < maximumSnapshotRetries && !plugInCameOnScreen) {
why are we checking isAlmostSolidColor twice in quick succession here? can the if() use snapshotFound?
> Source/WebKit2/WebProcess/Plugins/PluginView.h:278
> + bool m_didPlugInStartOffScreen;
maybe pack this better, next to other bools? I dunno.
> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:4466
> +bool WebPage::plugInIntersectsSearchRect(HTMLPlugInImageElement* plugInImageElement)
should this (and plugInIsPrimarySize) take references?
> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:4485
> + if (plugInRectRelativeToTopDocument.intersects(searchRect))
> + return true;
> + return false;
Maybe just "return plugInRectRelativeToTopDocument.intersects(searchRect);"?
> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:4488
> +bool WebPage::plugInIsPrimarySize(WebCore::HTMLPlugInImageElement *plugInImageElement, unsigned &candidatePlugInArea)
star on the wrong side.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list