| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "core/html/HTMLFrameOwnerElement.h" | 22 #include "core/html/HTMLFrameOwnerElement.h" |
| 23 | 23 |
| 24 #include "bindings/core/v8/ExceptionMessages.h" | 24 #include "bindings/core/v8/ExceptionMessages.h" |
| 25 #include "bindings/core/v8/ExceptionState.h" | 25 #include "bindings/core/v8/ExceptionState.h" |
| 26 #include "core/dom/AXObjectCache.h" | 26 #include "core/dom/AXObjectCache.h" |
| 27 #include "core/dom/ExceptionCode.h" | 27 #include "core/dom/ExceptionCode.h" |
| 28 #include "core/events/Event.h" | 28 #include "core/events/Event.h" |
| 29 #include "core/frame/FrameView.h" | 29 #include "core/frame/FrameView.h" |
| 30 #include "core/frame/LocalFrame.h" | 30 #include "core/frame/LocalFrame.h" |
| 31 #include "core/layout/Layer.h" | 31 #include "core/layout/Layer.h" |
| 32 #include "core/layout/LayoutPart.h" |
| 32 #include "core/layout/compositing/LayerCompositor.h" | 33 #include "core/layout/compositing/LayerCompositor.h" |
| 33 #include "core/loader/FrameLoader.h" | 34 #include "core/loader/FrameLoader.h" |
| 34 #include "core/loader/FrameLoaderClient.h" | 35 #include "core/loader/FrameLoaderClient.h" |
| 35 #include "core/plugins/PluginView.h" | 36 #include "core/plugins/PluginView.h" |
| 36 #include "core/rendering/RenderPart.h" | |
| 37 #include "platform/weborigin/SecurityOrigin.h" | 37 #include "platform/weborigin/SecurityOrigin.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 typedef WillBeHeapHashMap<RefPtrWillBeMember<Widget>, RawPtrWillBeMember<FrameVi
ew>> WidgetToParentMap; | 41 typedef WillBeHeapHashMap<RefPtrWillBeMember<Widget>, RawPtrWillBeMember<FrameVi
ew>> WidgetToParentMap; |
| 42 static WidgetToParentMap& widgetNewParentMap() | 42 static WidgetToParentMap& widgetNewParentMap() |
| 43 { | 43 { |
| 44 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WidgetToParentMap>, map, (adoptPt
rWillBeNoop(new WidgetToParentMap()))); | 44 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WidgetToParentMap>, map, (adoptPt
rWillBeNoop(new WidgetToParentMap()))); |
| 45 return *map; | 45 return *map; |
| 46 } | 46 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 | 105 |
| 106 HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum
ent& document) | 106 HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Docum
ent& document) |
| 107 : HTMLElement(tagName, document) | 107 : HTMLElement(tagName, document) |
| 108 , m_contentFrame(nullptr) | 108 , m_contentFrame(nullptr) |
| 109 , m_widget(nullptr) | 109 , m_widget(nullptr) |
| 110 , m_sandboxFlags(SandboxNone) | 110 , m_sandboxFlags(SandboxNone) |
| 111 { | 111 { |
| 112 } | 112 } |
| 113 | 113 |
| 114 RenderPart* HTMLFrameOwnerElement::renderPart() const | 114 LayoutPart* HTMLFrameOwnerElement::layoutPart() const |
| 115 { | 115 { |
| 116 // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers | 116 // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers |
| 117 // when using fallback content. | 117 // when using fallback content. |
| 118 if (!renderer() || !renderer()->isRenderPart()) | 118 if (!renderer() || !renderer()->isLayoutPart()) |
| 119 return nullptr; | 119 return nullptr; |
| 120 return toRenderPart(renderer()); | 120 return toLayoutPart(renderer()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void HTMLFrameOwnerElement::setContentFrame(Frame& frame) | 123 void HTMLFrameOwnerElement::setContentFrame(Frame& frame) |
| 124 { | 124 { |
| 125 // Make sure we will not end up with two frames referencing the same owner e
lement. | 125 // Make sure we will not end up with two frames referencing the same owner e
lement. |
| 126 ASSERT(!m_contentFrame || m_contentFrame->owner() != this); | 126 ASSERT(!m_contentFrame || m_contentFrame->owner() != this); |
| 127 // Disconnected frames should not be allowed to load. | 127 // Disconnected frames should not be allowed to load. |
| 128 ASSERT(inDocument()); | 128 ASSERT(inDocument()); |
| 129 m_contentFrame = &frame; | 129 m_contentFrame = &frame; |
| 130 | 130 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 return; | 210 return; |
| 211 | 211 |
| 212 if (m_widget) { | 212 if (m_widget) { |
| 213 if (m_widget->parent()) | 213 if (m_widget->parent()) |
| 214 moveWidgetToParentSoon(m_widget.get(), 0); | 214 moveWidgetToParentSoon(m_widget.get(), 0); |
| 215 m_widget = nullptr; | 215 m_widget = nullptr; |
| 216 } | 216 } |
| 217 | 217 |
| 218 m_widget = widget; | 218 m_widget = widget; |
| 219 | 219 |
| 220 RenderPart* renderPart = toRenderPart(renderer()); | 220 LayoutPart* layoutPart = toLayoutPart(renderer()); |
| 221 if (!renderPart) | 221 if (!layoutPart) |
| 222 return; | 222 return; |
| 223 | 223 |
| 224 if (m_widget) { | 224 if (m_widget) { |
| 225 renderPart->updateOnWidgetChange(); | 225 layoutPart->updateOnWidgetChange(); |
| 226 | 226 |
| 227 ASSERT(document().view() == renderPart->frameView()); | 227 ASSERT(document().view() == layoutPart->frameView()); |
| 228 ASSERT(renderPart->frameView()); | 228 ASSERT(layoutPart->frameView()); |
| 229 moveWidgetToParentSoon(m_widget.get(), renderPart->frameView()); | 229 moveWidgetToParentSoon(m_widget.get(), layoutPart->frameView()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 if (AXObjectCache* cache = document().existingAXObjectCache()) | 232 if (AXObjectCache* cache = document().existingAXObjectCache()) |
| 233 cache->childrenChanged(renderPart); | 233 cache->childrenChanged(layoutPart); |
| 234 } | 234 } |
| 235 | 235 |
| 236 Widget* HTMLFrameOwnerElement::ownedWidget() const | 236 Widget* HTMLFrameOwnerElement::ownedWidget() const |
| 237 { | 237 { |
| 238 return m_widget.get(); | 238 return m_widget.get(); |
| 239 } | 239 } |
| 240 | 240 |
| 241 bool HTMLFrameOwnerElement::loadOrRedirectSubframe(const KURL& url, const Atomic
String& frameName, bool lockBackForwardList, ContentSecurityPolicyDisposition sh
ouldCheckContentSecurityPolicy) | 241 bool HTMLFrameOwnerElement::loadOrRedirectSubframe(const KURL& url, const Atomic
String& frameName, bool lockBackForwardList, ContentSecurityPolicyDisposition sh
ouldCheckContentSecurityPolicy) |
| 242 { | 242 { |
| 243 RefPtrWillBeRawPtr<LocalFrame> parentFrame = document().frame(); | 243 RefPtrWillBeRawPtr<LocalFrame> parentFrame = document().frame(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 260 void HTMLFrameOwnerElement::trace(Visitor* visitor) | 260 void HTMLFrameOwnerElement::trace(Visitor* visitor) |
| 261 { | 261 { |
| 262 visitor->trace(m_contentFrame); | 262 visitor->trace(m_contentFrame); |
| 263 visitor->trace(m_widget); | 263 visitor->trace(m_widget); |
| 264 HTMLElement::trace(visitor); | 264 HTMLElement::trace(visitor); |
| 265 FrameOwner::trace(visitor); | 265 FrameOwner::trace(visitor); |
| 266 } | 266 } |
| 267 | 267 |
| 268 | 268 |
| 269 } // namespace blink | 269 } // namespace blink |
| OLD | NEW |