summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLFrameOwnerElement.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-22 09:09:45 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-22 09:10:13 +0100
commit470286ecfe79d59df14944e5b5d34630fc739391 (patch)
tree43983212872e06cebefd2ae474418fa2908ca54c /Source/WebCore/html/HTMLFrameOwnerElement.h
parent23037105e948c2065da5a937d3a2396b0ff45c1e (diff)
downloadqtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebCore/html/HTMLFrameOwnerElement.h')
-rw-r--r--Source/WebCore/html/HTMLFrameOwnerElement.h40
1 files changed, 37 insertions, 3 deletions
diff --git a/Source/WebCore/html/HTMLFrameOwnerElement.h b/Source/WebCore/html/HTMLFrameOwnerElement.h
index 5e2426a7d..15383aeee 100644
--- a/Source/WebCore/html/HTMLFrameOwnerElement.h
+++ b/Source/WebCore/html/HTMLFrameOwnerElement.h
@@ -42,6 +42,11 @@ public:
DOMWindow* contentWindow() const;
Document* contentDocument() const;
+ void setContentFrame(Frame*);
+ void clearContentFrame() { m_contentFrame = 0; }
+
+ void disconnectContentFrame();
+
// Most subclasses use RenderPart (either RenderEmbeddedObject or RenderIFrame)
// except for HTMLObjectElement and HTMLEmbedElement which may return any
// RenderObject when using fallback content.
@@ -54,15 +59,12 @@ public:
virtual ScrollbarMode scrollingMode() const { return ScrollbarAuto; }
SandboxFlags sandboxFlags() const { return m_sandboxFlags; }
- void disconnectContentFrame();
protected:
HTMLFrameOwnerElement(const QualifiedName& tagName, Document*);
void setSandboxFlags(SandboxFlags);
private:
- friend class Frame;
-
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
virtual bool isFrameOwnerElement() const OVERRIDE { return true; }
@@ -76,6 +78,38 @@ inline HTMLFrameOwnerElement* toFrameOwnerElement(Node* node)
return static_cast<HTMLFrameOwnerElement*>(node);
}
+class SubframeLoadingDisabler {
+public:
+ explicit SubframeLoadingDisabler(Node* root)
+ : m_root(root)
+ {
+ disabledSubtreeRoots().add(m_root);
+ }
+
+ ~SubframeLoadingDisabler()
+ {
+ disabledSubtreeRoots().remove(m_root);
+ }
+
+ static bool canLoadFrame(HTMLFrameOwnerElement* owner)
+ {
+ for (Node* node = owner; node; node = node->parentOrHostNode()) {
+ if (disabledSubtreeRoots().contains(node))
+ return false;
+ }
+ return true;
+ }
+
+private:
+ static HashSet<Node*>& disabledSubtreeRoots()
+ {
+ DEFINE_STATIC_LOCAL(HashSet<Node*>, nodes, ());
+ return nodes;
+ }
+
+ Node* m_root;
+};
+
} // namespace WebCore
#endif // HTMLFrameOwnerElement_h