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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 const HashSet<RefPtr<Widget> >* children = parentFrameView->children(); | 137 const HashSet<RefPtr<Widget> >* children = parentFrameView->children(); |
138 for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it !=
children->end(); ++it) { | 138 for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it !=
children->end(); ++it) { |
139 // We only care about FrameView's because iframes show up as FrameViews. | 139 // We only care about FrameView's because iframes show up as FrameViews. |
140 if (!(*it)->isFrameView()) | 140 if (!(*it)->isFrameView()) |
141 continue; | 141 continue; |
142 | 142 |
143 const FrameView* frameView = toFrameView((*it).get()); | 143 const FrameView* frameView = toFrameView((*it).get()); |
144 // Check to make sure we can get both the element and the RenderObject | 144 // Check to make sure we can get both the element and the RenderObject |
145 // for this FrameView, if we can't just move on to the next object. | 145 // for this FrameView, if we can't just move on to the next object. |
146 if (!frameView->frame()->ownerElement() || !frameView->frame()->ownerEle
ment()->renderer()) | 146 HTMLElement* element = frameView->frame().ownerElement(); |
| 147 if (!element || element->renderer()) |
147 continue; | 148 continue; |
148 | 149 |
149 HTMLElement* element = frameView->frame()->ownerElement(); | |
150 RenderObject* iframeRenderer = element->renderer(); | 150 RenderObject* iframeRenderer = element->renderer(); |
151 | 151 |
152 if (element->hasTagName(HTMLNames::iframeTag) | 152 if (element->hasTagName(HTMLNames::iframeTag) |
153 && iframeRenderer->absoluteBoundingBoxRectIgnoringTransforms().inter
sects(frameRect) | 153 && iframeRenderer->absoluteBoundingBoxRectIgnoringTransforms().inter
sects(frameRect) |
154 && (!iframeRenderer->style() || iframeRenderer->style()->visibility(
) == VISIBLE)) { | 154 && (!iframeRenderer->style() || iframeRenderer->style()->visibility(
) == VISIBLE)) { |
155 getObjectStack(iframeRenderer, &iframeZstack); | 155 getObjectStack(iframeRenderer, &iframeZstack); |
156 if (iframeIsAbovePlugin(iframeZstack, pluginZstack)) { | 156 if (iframeIsAbovePlugin(iframeZstack, pluginZstack)) { |
157 IntPoint point = roundedIntPoint(iframeRenderer->localToAbsolute
()); | 157 IntPoint point = roundedIntPoint(iframeRenderer->localToAbsolute
()); |
158 RenderBox* rbox = toRenderBox(iframeRenderer); | 158 RenderBox* rbox = toRenderBox(iframeRenderer); |
159 IntSize size(rbox->width(), rbox->height()); | 159 IntSize size(rbox->width(), rbox->height()); |
160 occlusions.append(IntRect(point, size)); | 160 occlusions.append(IntRect(point, size)); |
161 } | 161 } |
162 } | 162 } |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 } // namespace WebCore | 166 } // namespace WebCore |
OLD | NEW |