Add rounding to Plugin creation in SubframeLoader
authorleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 10:47:36 +0000 (10:47 +0000)
committerleviw@chromium.org <leviw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 10:47:36 +0000 (10:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82221

Reviewed by Eric Seidel.

Adding rounding to the LayoutSize used to construct Plugins in SubframeLoader. Plugins, which
are widgets, are always placed on integer boundaries, which means their sizes can be rounded
without considering their location. See https://trac.webkit.org/wiki/LayoutUnit for details.

No new tests. No change in behavior.

* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadMediaPlayerProxyPlugin):
(WebCore::SubframeLoader::createJavaAppletWidget):
(WebCore::SubframeLoader::loadPlugin):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112852 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/loader/SubframeLoader.cpp

index 715d68d..88f20ba 100644 (file)
@@ -1,3 +1,21 @@
+2012-04-02  Levi Weintraub  <leviw@chromium.org>
+
+        Add rounding to Plugin creation in SubframeLoader
+        https://bugs.webkit.org/show_bug.cgi?id=82221
+
+        Reviewed by Eric Seidel.
+
+        Adding rounding to the LayoutSize used to construct Plugins in SubframeLoader. Plugins, which
+        are widgets, are always placed on integer boundaries, which means their sizes can be rounded
+        without considering their location. See https://trac.webkit.org/wiki/LayoutUnit for details.
+
+        No new tests. No change in behavior.
+
+        * loader/SubframeLoader.cpp:
+        (WebCore::SubframeLoader::loadMediaPlayerProxyPlugin):
+        (WebCore::SubframeLoader::createJavaAppletWidget):
+        (WebCore::SubframeLoader::loadPlugin):
+
 2012-04-02  Mario Sanchez Prada  <msanchez@igalia.com>
 
         in page anchor and keyboard navigation
index 3d7f5c5..4576c94 100644 (file)
@@ -171,7 +171,7 @@ PassRefPtr<Widget> SubframeLoader::loadMediaPlayerProxyPlugin(Node* node, const
     IntSize size;
 
     if (renderer)
-        size = IntSize(renderer->contentWidth(), renderer->contentHeight());
+        size = roundedIntSize(LayoutSize(renderer->contentWidth(), renderer->contentHeight()));
     else if (mediaElement->isVideo())
         size = RenderVideo::defaultSize();
 
@@ -224,7 +224,7 @@ PassRefPtr<Widget> SubframeLoader::createJavaAppletWidget(const LayoutSize& size
 
     RefPtr<Widget> widget;
     if (allowPlugins(AboutToInstantiatePlugin))
-        widget = m_frame->loader()->client()->createJavaAppletWidget(size, element, baseURL, paramNames, paramValues);
+        widget = m_frame->loader()->client()->createJavaAppletWidget(roundedIntSize(size), element, baseURL, paramNames, paramValues);
     if (!widget)
         return 0;
 
@@ -360,7 +360,7 @@ bool SubframeLoader::loadPlugin(HTMLPlugInImageElement* pluginElement, const KUR
     if (!frameLoader->checkIfRunInsecureContent(document()->securityOrigin(), url))
         return false;
 
-    IntSize contentSize(renderer->contentWidth(), renderer->contentHeight());
+    IntSize contentSize = roundedIntSize(LayoutSize(renderer->contentWidth(), renderer->contentHeight()));
     bool loadManually = document()->isPluginDocument() && !m_containsPlugins && toPluginDocument(document())->shouldLoadPluginManually();
     RefPtr<Widget> widget = frameLoader->client()->createPlugin(contentSize,
         pluginElement, url, paramNames, paramValues, mimeType, loadManually);