OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2254 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) | 2254 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) |
2255 cache->handleScrolledToAnchor(anchorNode.get()); | 2255 cache->handleScrolledToAnchor(anchorNode.get()); |
2256 | 2256 |
2257 // scrollRectToVisible can call into setScrollPosition(), which resets m_mai ntainScrollPositionAnchor. | 2257 // scrollRectToVisible can call into setScrollPosition(), which resets m_mai ntainScrollPositionAnchor. |
2258 m_maintainScrollPositionAnchor = anchorNode; | 2258 m_maintainScrollPositionAnchor = anchorNode; |
2259 } | 2259 } |
2260 | 2260 |
2261 void FrameView::updateWidget(RenderObject* object) | 2261 void FrameView::updateWidget(RenderObject* object) |
2262 { | 2262 { |
2263 ASSERT(!object->node() || object->node()->isElementNode()); | 2263 ASSERT(!object->node() || object->node()->isElementNode()); |
2264 Element* ownerElement = toElement(object->node()); | 2264 RefPtr<Element> ownerElement = toElement(object->node()); |
eseidel
2013/04/18 02:14:23
I don't believe that holding onto the Element will
| |
2265 // The object may have already been destroyed (thus node cleared), | 2265 // The object may have already been destroyed (thus node cleared), |
2266 // but FrameView holds a manual ref, so it won't have been deleted. | 2266 // but FrameView holds a manual ref, so it won't have been deleted. |
2267 ASSERT(m_widgetUpdateSet->contains(object)); | 2267 ASSERT(m_widgetUpdateSet->contains(object)); |
2268 if (!ownerElement) | 2268 if (!ownerElement) |
2269 return; | 2269 return; |
2270 | 2270 |
2271 if (object->isEmbeddedObject()) { | 2271 if (object->isEmbeddedObject()) { |
2272 RenderEmbeddedObject* embeddedObject = static_cast<RenderEmbeddedObject* >(object); | 2272 RenderEmbeddedObject* embeddedObject = static_cast<RenderEmbeddedObject* >(object); |
2273 // No need to update if it's already crashed or known to be missing. | 2273 // No need to update if it's already crashed or known to be missing. |
2274 if (embeddedObject->showsUnavailablePluginIndicator()) | 2274 if (embeddedObject->showsUnavailablePluginIndicator()) |
2275 return; | 2275 return; |
2276 | 2276 |
2277 // FIXME: This could turn into a real virtual dispatch if we defined | 2277 // FIXME: This could turn into a real virtual dispatch if we defined |
2278 // updateWidget(PluginCreationOption) on HTMLElement. | 2278 // updateWidget(PluginCreationOption) on HTMLElement. |
2279 if (ownerElement->hasTagName(objectTag) || ownerElement->hasTagName(embe dTag) || ownerElement->hasTagName(appletTag)) { | 2279 if (ownerElement->hasTagName(objectTag) || ownerElement->hasTagName(embe dTag) || ownerElement->hasTagName(appletTag)) { |
2280 HTMLPlugInImageElement* pluginElement = toHTMLPlugInImageElement(own erElement); | 2280 HTMLPlugInImageElement* pluginElement = toHTMLPlugInImageElement(own erElement.get()); |
2281 if (pluginElement->needsWidgetUpdate()) | 2281 if (pluginElement->needsWidgetUpdate()) |
2282 pluginElement->updateWidget(CreateAnyWidgetType); | 2282 pluginElement->updateWidget(CreateAnyWidgetType); |
2283 } else | 2283 } else |
2284 ASSERT_NOT_REACHED(); | 2284 ASSERT_NOT_REACHED(); |
2285 | 2285 |
2286 // Caution: it's possible the object was destroyed again, since loading a | 2286 // Caution: it's possible the object was destroyed again, since loading a |
2287 // plugin may run any arbitrary JavaScript. | 2287 // plugin may run any arbitrary JavaScript. |
2288 RELEASE_ASSERT(ownerElement->renderer() == embeddedObject); | |
eseidel
2013/04/18 00:13:00
Why is crashing the right thing to do here? What
eseidel
2013/04/18 02:14:23
I wouldn't ASSERT, I would just return here. We d
| |
2288 embeddedObject->updateWidgetPosition(); | 2289 embeddedObject->updateWidgetPosition(); |
2289 } | 2290 } |
2290 } | 2291 } |
2291 | 2292 |
2292 bool FrameView::updateWidgets() | 2293 bool FrameView::updateWidgets() |
2293 { | 2294 { |
2294 if (m_nestedLayoutCount > 1 || !m_widgetUpdateSet || m_widgetUpdateSet->isEm pty()) | 2295 if (m_nestedLayoutCount > 1 || !m_widgetUpdateSet || m_widgetUpdateSet->isEm pty()) |
2295 return true; | 2296 return true; |
2296 | 2297 |
2297 size_t size = m_widgetUpdateSet->size(); | 2298 size_t size = m_widgetUpdateSet->size(); |
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3593 } | 3594 } |
3594 | 3595 |
3595 AXObjectCache* FrameView::axObjectCache() const | 3596 AXObjectCache* FrameView::axObjectCache() const |
3596 { | 3597 { |
3597 if (frame() && frame()->document()) | 3598 if (frame() && frame()->document()) |
3598 return frame()->document()->existingAXObjectCache(); | 3599 return frame()->document()->existingAXObjectCache(); |
3599 return 0; | 3600 return 0; |
3600 } | 3601 } |
3601 | 3602 |
3602 } // namespace WebCore | 3603 } // namespace WebCore |
OLD | NEW |