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

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

Issue 1457293003: Adjust windowRect of plugins for root frame scrolling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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-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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 rootView = rootView->frame()->ownerLayoutObject()->view(); 980 rootView = rootView->frame()->ownerLayoutObject()->view();
981 981
982 LayoutBox* box = toLayoutBox(ownerElement->layoutObject()); 982 LayoutBox* box = toLayoutBox(ownerElement->layoutObject());
983 983
984 // Plugin frameRects are in absolute screen space. 984 // Plugin frameRects are in absolute screen space.
985 IntRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect(fr ameRect()), UseTransforms).enclosingBoundingBox(); 985 IntRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect(fr ameRect()), UseTransforms).enclosingBoundingBox();
986 986
987 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace); 987 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace);
988 box->mapRectToPaintInvalidationBacking(rootView, unclippedAbsoluteRect, null ptr); 988 box->mapRectToPaintInvalidationBacking(rootView, unclippedAbsoluteRect, null ptr);
989 989
990 // The frameRect is already in absolute space. 990 // The frameRect is already in absolute space, except for scrolling of the r oot frame.
991 windowRect = frameRect(); 991 windowRect = frameRect();
992 windowRect.moveBy(roundedIntPoint(-rootView->viewRect().location()));
992 993
993 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect); 994 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect);
994 unclippedIntLocalRect = clippedLocalRect; 995 unclippedIntLocalRect = clippedLocalRect;
995 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect()); 996 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect());
996 997
997 // TODO(chrishtr): intentionally ignore transform, because the positioning o f frameRect() does also. This is probably wrong. 998 // TODO(chrishtr): intentionally ignore transform, because the positioning o f frameRect() does also. This is probably wrong.
998 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal Rect)).enclosingBoundingBox(); 999 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal Rect)).enclosingBoundingBox();
999 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect)).enc losingBoundingBox(); 1000 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect)).enc losingBoundingBox();
1000 } 1001 }
1001 1002
1002 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) 1003 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects)
1003 { 1004 {
1004 // document().layoutView() can be 0 when we receive messages from the 1005 // document().layoutView() can be null when we receive messages from the
1005 // plugins while we are destroying a frame. 1006 // plugins while we are destroying a frame.
1006 // FIXME: Can we just check m_element->document().isActive() ? 1007 // FIXME: Can we just check m_element->document().isActive() ?
1007 if (m_element->layoutObject()->document().layoutView()) { 1008 if (m_element->layoutObject()->document().layoutView()) {
1008 // Take our element and get the clip rect from the enclosing layer and 1009 // Take our element and get the clip rect from the enclosing layer and
1009 // frame view. 1010 // frame view.
1010 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); 1011 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t);
1011 } 1012 }
1012 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 1013 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
1013 // Convert to the plugin position. 1014 // Convert to the plugin position.
1014 for (size_t i = 0; i < cutOutRects.size(); i++) 1015 for (size_t i = 0; i < cutOutRects.size(); i++)
1015 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 1016 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
1016 } 1017 }
1017 1018
1018 } // namespace blinkf 1019 } // namespace blinkf
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/plugins/webview-plugin-scroll-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698