OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 Vector<const RenderObject*> pluginZstack; | 157 Vector<const RenderObject*> pluginZstack; |
158 Vector<const RenderObject*> iframeZstack; | 158 Vector<const RenderObject*> iframeZstack; |
159 getObjectStack(pluginNode, &pluginZstack); | 159 getObjectStack(pluginNode, &pluginZstack); |
160 | 160 |
161 if (!parentWidget->isFrameView()) | 161 if (!parentWidget->isFrameView()) |
162 return; | 162 return; |
163 | 163 |
164 FrameView* parentFrameView = toFrameView(parentWidget); | 164 FrameView* parentFrameView = toFrameView(parentWidget); |
165 | 165 |
166 // Occlusions by iframes. | 166 // Occlusions by iframes. |
167 const HashSet<RefPtr<Widget> >* children = parentFrameView->children(); | 167 const WillBeHeapHashSet<RefPtrWillBeMember<Widget> >* children = parentFrame
View->children(); |
168 for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it !=
children->end(); ++it) { | 168 for (WillBeHeapHashSet<RefPtrWillBeMember<Widget> >::const_iterator it = chi
ldren->begin(); it != children->end(); ++it) { |
169 // We only care about FrameView's because iframes show up as FrameViews. | 169 // We only care about FrameView's because iframes show up as FrameViews. |
170 if (!(*it)->isFrameView()) | 170 if (!(*it)->isFrameView()) |
171 continue; | 171 continue; |
172 | 172 |
173 const FrameView* frameView = toFrameView((*it).get()); | 173 const FrameView* frameView = toFrameView(it->get()); |
174 // Check to make sure we can get both the element and the RenderObject | 174 // Check to make sure we can get both the element and the RenderObject |
175 // for this FrameView, if we can't just move on to the next object. | 175 // for this FrameView, if we can't just move on to the next object. |
176 // FIXME: Plugin occlusion by remote frames is probably broken. | 176 // FIXME: Plugin occlusion by remote frames is probably broken. |
177 HTMLElement* element = frameView->frame().deprecatedLocalOwner(); | 177 HTMLElement* element = frameView->frame().deprecatedLocalOwner(); |
178 if (!element || !element->renderer()) | 178 if (!element || !element->renderer()) |
179 continue; | 179 continue; |
180 | 180 |
181 RenderObject* iframeRenderer = element->renderer(); | 181 RenderObject* iframeRenderer = element->renderer(); |
182 | 182 |
183 if (isHTMLIFrameElement(*element) && intersectsRect(iframeRenderer, fram
eRect)) { | 183 if (isHTMLIFrameElement(*element) && intersectsRect(iframeRenderer, fram
eRect)) { |
(...skipping 10 matching lines...) Expand all Loading... |
194 // as being in the top layer. | 194 // as being in the top layer. |
195 const Element* ancestor = topLayerAncestor(element); | 195 const Element* ancestor = topLayerAncestor(element); |
196 Document* document = parentFrameView->frame().document(); | 196 Document* document = parentFrameView->frame().document(); |
197 const WillBeHeapVector<RefPtrWillBeMember<Element> >& elements = document->t
opLayerElements(); | 197 const WillBeHeapVector<RefPtrWillBeMember<Element> >& elements = document->t
opLayerElements(); |
198 size_t start = ancestor ? elements.find(ancestor) + 1 : 0; | 198 size_t start = ancestor ? elements.find(ancestor) + 1 : 0; |
199 for (size_t i = start; i < elements.size(); ++i) | 199 for (size_t i = start; i < elements.size(); ++i) |
200 addTreeToOcclusions(elements[i]->renderer(), frameRect, occlusions); | 200 addTreeToOcclusions(elements[i]->renderer(), frameRect, occlusions); |
201 } | 201 } |
202 | 202 |
203 } // namespace blink | 203 } // namespace blink |
OLD | NEW |