summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLFrameOwnerElement.h
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-25 19:20:41 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:30:55 +0000
commit6882a04fb36642862b11efe514251d32070c3d65 (patch)
treeb7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebCore/html/HTMLFrameOwnerElement.h
parentab6df191029eeeb0b0f16f127d553265659f739e (diff)
downloadqtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/html/HTMLFrameOwnerElement.h')
-rw-r--r--Source/WebCore/html/HTMLFrameOwnerElement.h56
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