HTMLFrameOwnerElement.h [plain text]
#ifndef HTMLFrameOwnerElement_h
#define HTMLFrameOwnerElement_h
#include "HTMLElement.h"
#include <wtf/HashCountedSet.h>
namespace WebCore {
class DOMWindow;
class Frame;
class RenderWidget;
class SVGDocument;
class HTMLFrameOwnerElement : public HTMLElement {
public:
virtual ~HTMLFrameOwnerElement();
Frame* contentFrame() const { return m_contentFrame; }
DOMWindow* contentWindow() const;
WEBCORE_EXPORT Document* contentDocument() const;
void setContentFrame(Frame*);
void clearContentFrame();
void disconnectContentFrame();
RenderWidget* renderWidget() const;
SVGDocument* getSVGDocument(ExceptionCode&) const;
virtual ScrollbarMode scrollingMode() const { return ScrollbarAuto; }
SandboxFlags sandboxFlags() const { return m_sandboxFlags; }
void scheduleSetNeedsStyleRecalc(StyleChangeType = FullStyleChange);
protected:
HTMLFrameOwnerElement(const QualifiedName& tagName, Document&);
void setSandboxFlags(SandboxFlags);
private:
virtual bool isKeyboardFocusable(KeyboardEvent*) const override;
virtual bool isFrameOwnerElement() const override final { return true; }
Frame* m_contentFrame;
SandboxFlags m_sandboxFlags;
};
class SubframeLoadingDisabler {
public:
explicit SubframeLoadingDisabler(ContainerNode& root)
: m_root(root)
{
disabledSubtreeRoots().add(&m_root);
}
~SubframeLoadingDisabler()
{
disabledSubtreeRoots().remove(&m_root);
}
static bool canLoadFrame(HTMLFrameOwnerElement&);
private:
static HashCountedSet<ContainerNode*>& disabledSubtreeRoots()
{
DEPRECATED_DEFINE_STATIC_LOCAL(HashCountedSet<ContainerNode*>, nodes, ());
return nodes;
}
ContainerNode& m_root;
};
}
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::HTMLFrameOwnerElement)
static bool isType(const WebCore::Node& node) { return node.isFrameOwnerElement(); }
SPECIALIZE_TYPE_TRAITS_END()
#endif // HTMLFrameOwnerElement_h