OLD | NEW |
---|---|
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 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
937 windowRect = frameRect(); | 937 windowRect = frameRect(); |
938 // Map up to the root frame. | 938 // Map up to the root frame. |
939 windowRect = enclosingIntRect(m_element->document().view()->layoutView()->lo calToAbsoluteQuad(FloatQuad(FloatRect(frameRect())), TraverseDocumentBoundaries) .boundingBox()); | 939 windowRect = enclosingIntRect(m_element->document().view()->layoutView()->lo calToAbsoluteQuad(FloatQuad(FloatRect(frameRect())), TraverseDocumentBoundaries) .boundingBox()); |
940 // Finally, adjust for scrolling of the root frame, which the above does not take into account. | 940 // Finally, adjust for scrolling of the root frame, which the above does not take into account. |
941 windowRect.moveBy(roundedIntPoint(-rootView->viewRect().location())); | 941 windowRect.moveBy(roundedIntPoint(-rootView->viewRect().location())); |
942 | 942 |
943 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect); | 943 clippedLocalRect = enclosingIntRect(unclippedAbsoluteRect); |
944 unclippedIntLocalRect = clippedLocalRect; | 944 unclippedIntLocalRect = clippedLocalRect; |
945 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect()); | 945 clippedLocalRect.intersect(rootView->frameView()->visibleContentRect()); |
946 | 946 |
947 // TODO(chrishtr): intentionally ignore transform, because the positioning o f frameRect() does also. This is probably wrong. | 947 // TODO(chrishtr): intentionally ignore transform, because the positioning o f frameRect() does also. This is probably wrong. |
wkorman
2016/01/07 18:52:25
Reading line 931 I also wondered why we wouldn't w
chrishtr
2016/01/07 19:06:02
frameRect() is in the space of the containing fram
| |
948 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal Rect)).enclosingBoundingBox(); | 948 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedIntLocal Rect), TraverseDocumentBoundaries).enclosingBoundingBox(); |
949 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect)).enc losingBoundingBox(); | 949 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(clippedLocalRect), Tra verseDocumentBoundaries).enclosingBoundingBox(); |
950 } | 950 } |
951 | 951 |
952 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) | 952 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) |
953 { | 953 { |
954 // document().layoutView() can be null when we receive messages from the | 954 // document().layoutView() can be null when we receive messages from the |
955 // plugins while we are destroying a frame. | 955 // plugins while we are destroying a frame. |
956 // FIXME: Can we just check m_element->document().isActive() ? | 956 // FIXME: Can we just check m_element->document().isActive() ? |
957 if (m_element->layoutObject()->document().layoutView()) { | 957 if (m_element->layoutObject()->document().layoutView()) { |
958 // Take our element and get the clip rect from the enclosing layer and | 958 // Take our element and get the clip rect from the enclosing layer and |
959 // frame view. | 959 // frame view. |
960 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); | 960 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); |
961 } | 961 } |
962 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 962 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
963 // Convert to the plugin position. | 963 // Convert to the plugin position. |
964 for (size_t i = 0; i < cutOutRects.size(); i++) | 964 for (size_t i = 0; i < cutOutRects.size(); i++) |
965 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 965 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
966 } | 966 } |
967 | 967 |
968 } // namespace blinkf | 968 } // namespace blink |
OLD | NEW |