Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Unified Diff: third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp

Issue 2127213002: Avoid lossy effects of rounding by using contentBoxRect directly for plugin bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
index f5d7cb7453dcaee2c073f696237c3056e3424ae8..97d1884b7c7f6b9b43e8f492f542d4b55f356b93 100644
--- a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
@@ -505,14 +505,13 @@ TEST_F(WebPluginContainerTest, ClippedRectsForIframedElement)
WebPluginContainerImpl* pluginContainerImpl = toWebPluginContainerImpl(pluginElement.pluginContainer());
DCHECK(pluginContainerImpl);
- pluginContainerImpl->setFrameRect(IntRect(0, 0, 300, 300));
IntRect windowRect, clipRect, unobscuredRect;
Vector<IntRect> cutOutRects;
calculateGeometry(pluginContainerImpl, windowRect, clipRect, unobscuredRect, cutOutRects);
- EXPECT_RECT_EQ(IntRect(10, 210, 300, 300), windowRect);
- EXPECT_RECT_EQ(IntRect(0, 0, 240, 90), clipRect);
- EXPECT_RECT_EQ(IntRect(0, 0, 240, 160), unobscuredRect);
+ EXPECT_RECT_EQ(IntRect(20, 220, 40, 40), windowRect);
+ EXPECT_RECT_EQ(IntRect(0, 0, 40, 40), clipRect);
+ EXPECT_RECT_EQ(IntRect(0, 0, 40, 40), unobscuredRect);
// Cause the plugin's frame to be detached.
webViewHelper.reset();
@@ -540,11 +539,9 @@ TEST_F(WebPluginContainerTest, ClippedRectsForSubpixelPositionedPlugin)
Vector<IntRect> cutOutRects;
calculateGeometry(pluginContainerImpl, windowRect, clipRect, unobscuredRect, cutOutRects);
- // TODO(chrishtr): these values should not be -1, they should be 0. They are -1 because WebPluginContainerImpl currently uses an IntRect for
- // frameRect() to determine the position of the plugin, which results in a loss of precision if it is actually subpixel positioned.
EXPECT_RECT_EQ(IntRect(0, 0, 40, 40), windowRect);
- EXPECT_RECT_EQ(IntRect(-1, -1, 41, 41), clipRect);
- EXPECT_RECT_EQ(IntRect(-1, -1, 41, 41), unobscuredRect);
+ EXPECT_RECT_EQ(IntRect(0, 0, 40, 40), clipRect);
+ EXPECT_RECT_EQ(IntRect(0, 0, 40, 40), unobscuredRect);
// Cause the plugin's frame to be detached.
webViewHelper.reset();

Powered by Google App Engine
This is Rietveld 408576698