Index: Source/web/WebPluginContainerImpl.cpp |
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp |
index 14d27e068f4994274304e987336c351fd898f4cd..d9e877ec143f950a01c1323d60b2529ad97a6252 100644 |
--- a/Source/web/WebPluginContainerImpl.cpp |
+++ b/Source/web/WebPluginContainerImpl.cpp |
@@ -407,11 +407,11 @@ void WebPluginContainerImpl::reportGeometry() |
if (!parent() || !m_element->layoutObject()) |
return; |
- IntRect windowRect, clipRect; |
+ IntRect windowRect, clipRect, unobscuredRect; |
Vector<IntRect> cutOutRects; |
- calculateGeometry(frameRect(), windowRect, clipRect, cutOutRects); |
+ calculateGeometry(windowRect, clipRect, unobscuredRect, cutOutRects); |
- m_webPlugin->updateGeometry(windowRect, clipRect, cutOutRects, isVisible()); |
+ m_webPlugin->updateGeometry(windowRect, clipRect, unobscuredRect, cutOutRects, isVisible()); |
if (m_scrollbarGroup) { |
m_scrollbarGroup->scrollAnimator()->contentsResized(); |
@@ -965,27 +965,12 @@ void WebPluginContainerImpl::focusPlugin() |
containingFrame.document()->setFocusedElement(m_element); |
} |
-void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect, |
- IntRect& windowRect, |
- IntRect& clipRect, |
- Vector<IntRect>& cutOutRects) |
+void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& clipRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) |
{ |
- windowRect = toFrameView(parent())->contentsToRootFrame(frameRect); |
+ windowRect = toFrameView(parent())->contentsToRootFrame(frameRect()); |
// Calculate a clip-rect so that we don't overlap the scrollbars, etc. |
- clipRect = windowClipRect(); |
- clipRect.move(-windowRect.x(), -windowRect.y()); |
- |
- getPluginOcclusions(m_element, this->parent(), frameRect, cutOutRects); |
- // Convert to the plugin position. |
- for (size_t i = 0; i < cutOutRects.size(); i++) |
- cutOutRects[i].move(-frameRect.x(), -frameRect.y()); |
-} |
- |
-IntRect WebPluginContainerImpl::windowClipRect() const |
-{ |
- // Start by clipping to our bounds. |
- IntRect clipRect = |
+ IntRect rawClipRect = |
convertToContainingWindow(IntRect(0, 0, width(), height())); |
// document().layoutView() can be 0 when we receive messages from the |
@@ -994,11 +979,17 @@ IntRect WebPluginContainerImpl::windowClipRect() const |
if (m_element->layoutObject()->document().layoutView()) { |
// Take our element and get the clip rect from the enclosing layer and |
// frame view. |
- clipRect.intersect( |
- m_element->document().view()->windowClipRectForFrameOwner(m_element)); |
+ clipRect = intersection(rawClipRect, m_element->document().view()->windowClipRectForFrameOwner(m_element)); |
+ unobscuredRect = intersection(rawClipRect, m_element->document().view()->unobscuredRectForFrameOwner(m_element)); |
} |
piman
2015/03/24 23:59:21
clipRect and unobscuredRect aren't initialized in
tommycli
2015/03/25 20:18:35
Done.
|
- return clipRect; |
+ clipRect.move(-windowRect.x(), -windowRect.y()); |
+ unobscuredRect.move(-windowRect.x(), -windowRect.y()); |
+ |
+ getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
+ // Convert to the plugin position. |
+ for (size_t i = 0; i < cutOutRects.size(); i++) |
+ cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
} |
bool WebPluginContainerImpl::pluginShouldPersist() const |