diff options
Diffstat (limited to 'Source/WebCore/html/HTMLFrameOwnerElement.h')
-rw-r--r-- | Source/WebCore/html/HTMLFrameOwnerElement.h | 56 |
1 files changed, 23 insertions, 33 deletions
diff --git a/Source/WebCore/html/HTMLFrameOwnerElement.h b/Source/WebCore/html/HTMLFrameOwnerElement.h index 25e5dc497..96671f37c 100644 --- a/Source/WebCore/html/HTMLFrameOwnerElement.h +++ b/Source/WebCore/html/HTMLFrameOwnerElement.h @@ -22,16 +22,15 @@ #define HTMLFrameOwnerElement_h #include "HTMLElement.h" +#include <wtf/HashCountedSet.h> +#include <wtf/NeverDestroyed.h> namespace WebCore { class DOMWindow; class Frame; -class RenderPart; - -#if ENABLE(SVG) +class RenderWidget; class SVGDocument; -#endif class HTMLFrameOwnerElement : public HTMLElement { public: @@ -39,76 +38,67 @@ public: Frame* contentFrame() const { return m_contentFrame; } DOMWindow* contentWindow() const; - Document* contentDocument() const; + WEBCORE_EXPORT Document* contentDocument() const; void setContentFrame(Frame*); void clearContentFrame(); void disconnectContentFrame(); - // Most subclasses use RenderPart (either RenderEmbeddedObject or RenderIFrame) + // Most subclasses use RenderWidget (either RenderEmbeddedObject or RenderIFrame) // except for HTMLObjectElement and HTMLEmbedElement which may return any - // RenderObject when using fallback content. - RenderPart* renderPart() const; + // RenderElement when using fallback content. + RenderWidget* renderWidget() const; -#if ENABLE(SVG) SVGDocument* getSVGDocument(ExceptionCode&) const; -#endif virtual ScrollbarMode scrollingMode() const { return ScrollbarAuto; } SandboxFlags sandboxFlags() const { return m_sandboxFlags; } + void scheduleSetNeedsStyleRecalc(StyleChangeType = FullStyleChange); + protected: - HTMLFrameOwnerElement(const QualifiedName& tagName, Document*); + HTMLFrameOwnerElement(const QualifiedName& tagName, Document&); void setSandboxFlags(SandboxFlags); private: - virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE; - virtual bool isFrameOwnerElement() const OVERRIDE { return true; } + virtual bool isKeyboardFocusable(KeyboardEvent*) const override; + virtual bool isFrameOwnerElement() const override final { return true; } Frame* m_contentFrame; SandboxFlags m_sandboxFlags; }; -inline HTMLFrameOwnerElement* toFrameOwnerElement(Node* node) -{ - ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isFrameOwnerElement()); - return static_cast<HTMLFrameOwnerElement*>(node); -} - class SubframeLoadingDisabler { public: - explicit SubframeLoadingDisabler(Node* root) + explicit SubframeLoadingDisabler(ContainerNode& root) : m_root(root) { - disabledSubtreeRoots().add(m_root); + disabledSubtreeRoots().add(&m_root); } ~SubframeLoadingDisabler() { - disabledSubtreeRoots().remove(m_root); + disabledSubtreeRoots().remove(&m_root); } - static bool canLoadFrame(HTMLFrameOwnerElement* owner) - { - for (Node* node = owner; node; node = node->parentOrShadowHostNode()) { - if (disabledSubtreeRoots().contains(node)) - return false; - } - return true; - } + static bool canLoadFrame(HTMLFrameOwnerElement&); private: - static HashSet<Node*>& disabledSubtreeRoots() + static HashCountedSet<ContainerNode*>& disabledSubtreeRoots() { - DEFINE_STATIC_LOCAL(HashSet<Node*>, nodes, ()); + static NeverDestroyed<HashCountedSet<ContainerNode*>> nodes; return nodes; } - Node* m_root; + ContainerNode& m_root; }; } // namespace WebCore +SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::HTMLFrameOwnerElement) + static bool isType(const WebCore::Node& node) { return node.isFrameOwnerElement(); } +SPECIALIZE_TYPE_TRAITS_END() + #endif // HTMLFrameOwnerElement_h |