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

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

Issue 1994443003: [Layout API] Use FrameView::layoutViewItem() in WebPluginContainerImpl.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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/Source/core/layout/api/LayoutItem.h ('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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 // Plugin frameRects are in absolute space within their frame. 903 // Plugin frameRects are in absolute space within their frame.
904 FloatRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect( frameRect()), UseTransforms).boundingBox(); 904 FloatRect frameRectInOwnerElementSpace = box->absoluteToLocalQuad(FloatRect( frameRect()), UseTransforms).boundingBox();
905 905
906 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace); 906 LayoutRect unclippedAbsoluteRect(frameRectInOwnerElementSpace);
907 box->mapToVisualRectInAncestorSpace(rootView, unclippedAbsoluteRect); 907 box->mapToVisualRectInAncestorSpace(rootView, unclippedAbsoluteRect);
908 908
909 // The frameRect is already in absolute space of the local frame to the plug in. 909 // The frameRect is already in absolute space of the local frame to the plug in.
910 windowRect = frameRect(); 910 windowRect = frameRect();
911 // Map up to the root frame. 911 // Map up to the root frame.
912 LayoutRect layoutWindowRect = 912 LayoutRect layoutWindowRect =
913 LayoutRect(m_element->document().view()->layoutView()->localToAbsoluteQu ad(FloatQuad(FloatRect(frameRect())), TraverseDocumentBoundaries).boundingBox()) ; 913 LayoutRect(m_element->document().view()->layoutViewItem().localToAbsolut eQuad(FloatQuad(FloatRect(frameRect())), TraverseDocumentBoundaries).boundingBox ());
914 // Finally, adjust for scrolling of the root frame, which the above does not take into account. 914 // Finally, adjust for scrolling of the root frame, which the above does not take into account.
915 layoutWindowRect.moveBy(-rootView->viewRect().location()); 915 layoutWindowRect.moveBy(-rootView->viewRect().location());
916 windowRect = pixelSnappedIntRect(layoutWindowRect); 916 windowRect = pixelSnappedIntRect(layoutWindowRect);
917 917
918 LayoutRect layoutClippedLocalRect = unclippedAbsoluteRect; 918 LayoutRect layoutClippedLocalRect = unclippedAbsoluteRect;
919 LayoutRect unclippedLayoutLocalRect = layoutClippedLocalRect; 919 LayoutRect unclippedLayoutLocalRect = layoutClippedLocalRect;
920 layoutClippedLocalRect.intersect(LayoutRect(rootView->frameView()->visibleCo ntentRect())); 920 layoutClippedLocalRect.intersect(LayoutRect(rootView->frameView()->visibleCo ntentRect()));
921 921
922 // TODO(chrishtr): intentionally ignore transform, because the positioning o f frameRect() does also. This is probably wrong. 922 // TODO(chrishtr): intentionally ignore transform, because the positioning o f frameRect() does also. This is probably wrong.
923 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedLayoutLo calRect), TraverseDocumentBoundaries).enclosingBoundingBox(); 923 unclippedIntLocalRect = box->absoluteToLocalQuad(FloatRect(unclippedLayoutLo calRect), TraverseDocumentBoundaries).enclosingBoundingBox();
924 // As a performance optimization, map the clipped rect separately if is diff erent than the unclipped rect. 924 // As a performance optimization, map the clipped rect separately if is diff erent than the unclipped rect.
925 if (layoutClippedLocalRect != unclippedLayoutLocalRect) 925 if (layoutClippedLocalRect != unclippedLayoutLocalRect)
926 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(layoutClippedLocal Rect), TraverseDocumentBoundaries).enclosingBoundingBox(); 926 clippedLocalRect = box->absoluteToLocalQuad(FloatRect(layoutClippedLocal Rect), TraverseDocumentBoundaries).enclosingBoundingBox();
927 else 927 else
928 clippedLocalRect = unclippedIntLocalRect; 928 clippedLocalRect = unclippedIntLocalRect;
929 } 929 }
930 930
931 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects) 931 void WebPluginContainerImpl::calculateGeometry(IntRect& windowRect, IntRect& cli pRect, IntRect& unobscuredRect, Vector<IntRect>& cutOutRects)
932 { 932 {
933 // document().layoutView() can be null when we receive messages from the 933 // document().layoutView() can be null when we receive messages from the
934 // plugins while we are destroying a frame. 934 // plugins while we are destroying a frame.
935 // FIXME: Can we just check m_element->document().isActive() ? 935 // FIXME: Can we just check m_element->document().isActive() ?
936 if (m_element->layoutObject()->document().layoutView()) { 936 if (!m_element->layoutObject()->document().layoutViewItem().isNull()) {
937 // Take our element and get the clip rect from the enclosing layer and 937 // Take our element and get the clip rect from the enclosing layer and
938 // frame view. 938 // frame view.
939 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); 939 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t);
940 } 940 }
941 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 941 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
942 // Convert to the plugin position. 942 // Convert to the plugin position.
943 for (size_t i = 0; i < cutOutRects.size(); i++) 943 for (size_t i = 0; i < cutOutRects.size(); i++)
944 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 944 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
945 } 945 }
946 946
947 } // namespace blink 947 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/api/LayoutItem.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698