diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:09:45 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:10:13 +0100 |
commit | 470286ecfe79d59df14944e5b5d34630fc739391 (patch) | |
tree | 43983212872e06cebefd2ae474418fa2908ca54c /Source/WebCore/html/HTMLIFrameElement.cpp | |
parent | 23037105e948c2065da5a937d3a2396b0ff45c1e (diff) | |
download | qtwebkit-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/HTMLIFrameElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLIFrameElement.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/Source/WebCore/html/HTMLIFrameElement.cpp b/Source/WebCore/html/HTMLIFrameElement.cpp index 0ebe09469..1195dcfe4 100644 --- a/Source/WebCore/html/HTMLIFrameElement.cpp +++ b/Source/WebCore/html/HTMLIFrameElement.cpp @@ -32,6 +32,8 @@ #include "HTMLNames.h" #include "NodeRenderingContext.h" #include "RenderIFrame.h" +#include "ScriptableDocumentParser.h" +#include <wtf/text/TextPosition.h> namespace WebCore { @@ -56,7 +58,7 @@ bool HTMLIFrameElement::isPresentationAttribute(const QualifiedName& name) const return HTMLFrameElementBase::isPresentationAttribute(name); } -void HTMLIFrameElement::collectStyleForAttribute(const Attribute& attribute, StylePropertySet* style) +void HTMLIFrameElement::collectStyleForPresentationAttribute(const Attribute& attribute, StylePropertySet* style) { if (attribute.name() == widthAttr) addHTMLLengthToStyle(style, CSSPropertyWidth, attribute.value()); @@ -69,30 +71,34 @@ void HTMLIFrameElement::collectStyleForAttribute(const Attribute& attribute, Sty // a presentational hint that the border should be off if set to zero. if (!attribute.isNull() && !attribute.value().toInt()) { // Add a rule that nulls out our border width. - addPropertyToAttributeStyle(style, CSSPropertyBorderWidth, 0, CSSPrimitiveValue::CSS_PX); + addPropertyToPresentationAttributeStyle(style, CSSPropertyBorderWidth, 0, CSSPrimitiveValue::CSS_PX); } } else - HTMLFrameElementBase::collectStyleForAttribute(attribute, style); + HTMLFrameElementBase::collectStyleForPresentationAttribute(attribute, style); } -void HTMLIFrameElement::parseAttribute(const Attribute& attribute) +void HTMLIFrameElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { - if (attribute.name() == nameAttr) { - const AtomicString& newName = attribute.value(); + if (name == nameAttr) { if (inDocument() && document()->isHTMLDocument()) { HTMLDocument* document = static_cast<HTMLDocument*>(this->document()); document->removeExtraNamedItem(m_name); - document->addExtraNamedItem(newName); + document->addExtraNamedItem(value); } - m_name = newName; - } else if (attribute.name() == sandboxAttr) - setSandboxFlags(attribute.isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(attribute.value())); - else if (attribute.name() == seamlessAttr) { + m_name = value; + } else if (name == sandboxAttr) { + String invalidTokens; + setSandboxFlags(value.isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(value, invalidTokens)); + if (!invalidTokens.isNull()) { + int line = document()->scriptableDocumentParser() ? document()->scriptableDocumentParser()->lineNumber().oneBasedInt() : 0; + document()->addConsoleMessage(HTMLMessageSource, LogMessageType, ErrorMessageLevel, "Error while parsing the 'sandbox' attribute: " + invalidTokens, document()->url().string(), line); + } + } 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); } else - HTMLFrameElementBase::parseAttribute(attribute); + HTMLFrameElementBase::parseAttribute(name, value); } bool HTMLIFrameElement::rendererIsNeeded(const NodeRenderingContext& context) |