diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/html/HTMLFrameOwnerElement.cpp | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/html/HTMLFrameOwnerElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLFrameOwnerElement.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/Source/WebCore/html/HTMLFrameOwnerElement.cpp b/Source/WebCore/html/HTMLFrameOwnerElement.cpp index 2af585b9b..253aaee8f 100644 --- a/Source/WebCore/html/HTMLFrameOwnerElement.cpp +++ b/Source/WebCore/html/HTMLFrameOwnerElement.cpp @@ -22,20 +22,22 @@ #include "HTMLFrameOwnerElement.h" #include "DOMWindow.h" -#include "ExceptionCode.h" #include "Frame.h" #include "FrameLoader.h" #include "RenderWidget.h" #include "ShadowRoot.h" -#include "SVGDocument.h" -#include "StyleTreeResolver.h" #include <wtf/Ref.h> +#if ENABLE(SVG) +#include "ExceptionCode.h" +#include "SVGDocument.h" +#endif + namespace WebCore { HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Document& document) : HTMLElement(tagName, document) - , m_contentFrame(nullptr) + , m_contentFrame(0) , m_sandboxFlags(SandboxNone) { } @@ -44,9 +46,9 @@ RenderWidget* HTMLFrameOwnerElement::renderWidget() const { // HTMLObjectElement and HTMLEmbedElement may return arbitrary renderers // when using fallback content. - if (!is<RenderWidget>(renderer())) - return nullptr; - return downcast<RenderWidget>(renderer()); + if (!renderer() || !renderer()->isWidget()) + return 0; + return toRenderWidget(renderer()); } void HTMLFrameOwnerElement::setContentFrame(Frame* frame) @@ -112,24 +114,28 @@ bool HTMLFrameOwnerElement::isKeyboardFocusable(KeyboardEvent* event) const return m_contentFrame && HTMLElement::isKeyboardFocusable(event); } +#if ENABLE(SVG) SVGDocument* HTMLFrameOwnerElement::getSVGDocument(ExceptionCode& ec) const { - Document* document = contentDocument(); - if (is<SVGDocument>(document)) - return downcast<SVGDocument>(document); + Document* doc = contentDocument(); + if (doc && doc->isSVGDocument()) + return toSVGDocument(doc); // Spec: http://www.w3.org/TR/SVG/struct.html#InterfaceGetSVGDocument ec = NOT_SUPPORTED_ERR; - return nullptr; + return 0; +} +#endif + +static void needsStyleRecalcCallback(Node& node, unsigned data) +{ + node.setNeedsStyleRecalc(static_cast<StyleChangeType>(data)); } void HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc(StyleChangeType changeType) { - if (Style::postResolutionCallbacksAreSuspended()) { - RefPtr<HTMLFrameOwnerElement> element = this; - Style::queuePostResolutionCallback([element, changeType]{ - element->setNeedsStyleRecalc(changeType); - }); - } else + if (postAttachCallbacksAreSuspended()) + queuePostAttachCallback(needsStyleRecalcCallback, *this, static_cast<unsigned>(changeType)); + else setNeedsStyleRecalc(changeType); } |