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

Side by Side Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 1510083002: Fix window rect for plugins to map up to the root frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/plugins/webview-plugin-nested-iframe-scroll-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 LayoutBox* box = toLayoutBox(ownerElement->layoutObject()); 946 LayoutBox* box = toLayoutBox(ownerElement->layoutObject());
947 947
948 // Plugin frameRects are in absolute screen space. 948 // Plugin frameRects are in absolute screen space.
949 IntRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect(fr ameRect()), UseTransforms).enclosingBoundingBox(); 949 IntRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect(fr ameRect()), UseTransforms).enclosingBoundingBox();
950 950
951 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace); 951 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace);
952 box->mapRectToPaintInvalidationBacking(rootView, unclippedAbsoluteRect, null ptr); 952 box->mapRectToPaintInvalidationBacking(rootView, unclippedAbsoluteRect, null ptr);
953 953
954 // The frameRect is already in absolute space, except for scrolling of the r oot frame. 954 // The frameRect is already in absolute space, except for scrolling of the r oot frame.
955 windowRect = frameRect(); 955 windowRect = frameRect();
956 windowRect.moveBy(roundedIntPoint(-rootView->viewRect().location())); 956 windowRect = enclosingIntRect(m_element->document().view()->layoutView()->lo calToAbsoluteQuad(FloatQuad(FloatRect(frameRect())), TraverseDocumentBoundaries) .boundingBox());
957 957
958 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect); 958 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect);
959 unclippedIntLocalRect = clippedLocalRect; 959 unclippedIntLocalRect = clippedLocalRect;
960 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect()); 960 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect());
961 961
962 // TODO(chrishtr): intentionally ignore transform, because the positioning o f frameRect() does also. This is probably wrong. 962 // TODO(chrishtr): intentionally ignore transform, because the positioning o f frameRect() does also. This is probably wrong.
963 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal Rect)).enclosingBoundingBox(); 963 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal Rect)).enclosingBoundingBox();
964 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect)).enc losingBoundingBox(); 964 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect)).enc losingBoundingBox();
965 } 965 }
966 966
967 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) 967 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects)
968 { 968 {
969 // document().layoutView() can be null when we receive messages from the 969 // document().layoutView() can be null when we receive messages from the
970 // plugins while we are destroying a frame. 970 // plugins while we are destroying a frame.
971 // FIXME: Can we just check m_element->document().isActive() ? 971 // FIXME: Can we just check m_element->document().isActive() ?
972 if (m_element->layoutObject()->document().layoutView()) { 972 if (m_element->layoutObject()->document().layoutView()) {
973 // Take our element and get the clip rect from the enclosing layer and 973 // Take our element and get the clip rect from the enclosing layer and
974 // frame view. 974 // frame view.
975 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); 975 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t);
976 } 976 }
977 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 977 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
978 // Convert to the plugin position. 978 // Convert to the plugin position.
979 for (size_t i = 0; i < cutOutRects.size(); i++) 979 for (size_t i = 0; i < cutOutRects.size(); i++)
980 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 980 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
981 } 981 }
982 982
983 } // namespace blinkf 983 } // namespace blinkf
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/plugins/webview-plugin-nested-iframe-scroll-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698