Index: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
index e143f82c3b2cb286e6c726780332bc6684822dee..0c43d08a067f6d4009692e1c4e8881240b2c3f35 100644 |
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
@@ -903,10 +903,9 @@ void WebPluginContainerImpl::computeClipRectsForPlugin( |
LayoutBox* box = toLayoutBox(ownerElement->layoutObject()); |
- // Plugin frameRects are in absolute space within their frame. |
- FloatRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect(frameRect()), UseTransforms).boundingBox(); |
- |
- LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace); |
+ // Note: frameRect() for this plugin is equal to contentBoxRect, mapped to the containing view space, and rounded off. |
+ // See LayoutPart.cpp::updateWidgetGeometryInternal. To remove the lossy effect of rounding off, use contentBoxRect directly. |
+ LayoutRect unclippedAbsoluteRect(box->contentBoxRect()); |
box->mapToVisualRectInAncestorSpace(rootView, unclippedAbsoluteRect); |
// The frameRect is already in absolute space of the local frame to the plugin. |
@@ -923,10 +922,10 @@ void WebPluginContainerImpl::computeClipRectsForPlugin( |
layoutClippedLocalRect.intersect(LayoutRect(rootView->frameView()->visibleContentRect())); |
// TODO(chrishtr): intentionally ignore transform, because the positioning of frameRect() does also. This is probably wrong. |
Xianzhu
2016/07/07 18:49:57
Nit: Remove the TODO.
chrishtr
2016/07/07 20:02:14
Done.
|
- unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedLayoutLocalRect), TraverseDocumentBoundaries).enclosingBoundingBox(); |
+ unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedLayoutLocalRect), TraverseDocumentBoundaries | UseTransforms).enclosingBoundingBox(); |
// As a performance optimization, map the clipped rect separately if is different than the unclipped rect. |
if (layoutClippedLocalRect != unclippedLayoutLocalRect) |
- clippedLocalRect = box->absoluteToLocalQuad(FloatRect(layoutClippedLocalRect), TraverseDocumentBoundaries).enclosingBoundingBox(); |
+ clippedLocalRect = box->absoluteToLocalQuad(FloatRect(layoutClippedLocalRect), TraverseDocumentBoundaries | UseTransforms).enclosingBoundingBox(); |
else |
clippedLocalRect = unclippedIntLocalRect; |
} |