diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/html/HTMLIFrameElement.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/html/HTMLIFrameElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLIFrameElement.cpp | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/Source/WebCore/html/HTMLIFrameElement.cpp b/Source/WebCore/html/HTMLIFrameElement.cpp index a2f9d10cd..d30322dc0 100644 --- a/Source/WebCore/html/HTMLIFrameElement.cpp +++ b/Source/WebCore/html/HTMLIFrameElement.cpp @@ -25,8 +25,8 @@ #include "config.h" #include "HTMLIFrameElement.h" -#include "Attribute.h" #include "CSSPropertyNames.h" +#include "DOMTokenList.h" #include "Frame.h" #include "HTMLDocument.h" #include "HTMLNames.h" @@ -41,17 +41,25 @@ inline HTMLIFrameElement::HTMLIFrameElement(const QualifiedName& tagName, Docume : HTMLFrameElementBase(tagName, document) { ASSERT(hasTagName(iframeTag)); - setHasCustomStyleResolveCallbacks(); } -PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(const QualifiedName& tagName, Document& document) +Ref<HTMLIFrameElement> HTMLIFrameElement::create(const QualifiedName& tagName, Document& document) { - return adoptRef(new HTMLIFrameElement(tagName, document)); + return adoptRef(*new HTMLIFrameElement(tagName, document)); +} + +DOMTokenList& HTMLIFrameElement::sandbox() +{ + if (!m_sandbox) + m_sandbox = std::make_unique<DOMTokenList>(*this, sandboxAttr, [](StringView token) { + return SecurityContext::isSupportedSandboxPolicy(token); + }); + return *m_sandbox; } bool HTMLIFrameElement::isPresentationAttribute(const QualifiedName& name) const { - if (name == widthAttr || name == heightAttr || name == alignAttr || name == frameborderAttr || name == seamlessAttr) + if (name == widthAttr || name == heightAttr || name == alignAttr || name == frameborderAttr) return true; return HTMLFrameElementBase::isPresentationAttribute(name); } @@ -78,14 +86,13 @@ void HTMLIFrameElement::collectStyleForPresentationAttribute(const QualifiedName void HTMLIFrameElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { if (name == sandboxAttr) { + if (m_sandbox) + m_sandbox->associatedAttributeValueChanged(value); + String invalidTokens; setSandboxFlags(value.isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(value, invalidTokens)); if (!invalidTokens.isNull()) - document().addConsoleMessage(OtherMessageSource, ErrorMessageLevel, "Error while parsing the 'sandbox' attribute: " + invalidTokens); - } else if (name == seamlessAttr) { - // If we're adding or removing the seamless attribute, we need to force the content document to recalculate its StyleResolver. - if (contentDocument()) - contentDocument()->styleResolverChanged(DeferRecalcStyle); + document().addConsoleMessage(MessageSource::Other, MessageLevel::Error, "Error while parsing the 'sandbox' attribute: " + invalidTokens); } else HTMLFrameElementBase::parseAttribute(name, value); } @@ -95,23 +102,9 @@ bool HTMLIFrameElement::rendererIsNeeded(const RenderStyle& style) return isURLAllowed() && style.display() != NONE; } -RenderPtr<RenderElement> HTMLIFrameElement::createElementRenderer(PassRef<RenderStyle> style) -{ - return createRenderer<RenderIFrame>(*this, std::move(style)); -} - -bool HTMLIFrameElement::shouldDisplaySeamlessly() const -{ - return contentDocument() && contentDocument()->shouldDisplaySeamlesslyWithParent(); -} - -void HTMLIFrameElement::didRecalcStyle(Style::Change styleChange) +RenderPtr<RenderElement> HTMLIFrameElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) { - if (!shouldDisplaySeamlessly()) - return; - Document* childDocument = contentDocument(); - if (styleChange >= Style::Inherit || childDocument->childNeedsStyleRecalc() || childDocument->needsStyleRecalc()) - contentDocument()->recalcStyle(styleChange == Style::Detach ? Style::Force : styleChange); + return createRenderer<RenderIFrame>(*this, WTFMove(style)); } } |