diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
commit | 8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch) | |
tree | cdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/WebCore/html/HTMLIFrameElement.cpp | |
parent | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff) | |
download | qtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz |
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/WebCore/html/HTMLIFrameElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLIFrameElement.cpp | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/Source/WebCore/html/HTMLIFrameElement.cpp b/Source/WebCore/html/HTMLIFrameElement.cpp index c7e157e73..0be7053e4 100644 --- a/Source/WebCore/html/HTMLIFrameElement.cpp +++ b/Source/WebCore/html/HTMLIFrameElement.cpp @@ -41,7 +41,7 @@ inline HTMLIFrameElement::HTMLIFrameElement(const QualifiedName& tagName, Docume : HTMLFrameElementBase(tagName, document) { ASSERT(hasTagName(iframeTag)); - setHasCustomWillOrDidRecalcStyle(); + setHasCustomCallbacks(); } PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(const QualifiedName& tagName, Document* document) @@ -51,44 +51,48 @@ PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(const QualifiedName& tag bool HTMLIFrameElement::isPresentationAttribute(const QualifiedName& name) const { - if (name == widthAttr || name == heightAttr || name == alignAttr || name == frameborderAttr) + if (name == widthAttr || name == heightAttr || name == alignAttr || name == frameborderAttr || name == seamlessAttr) return true; return HTMLFrameElementBase::isPresentationAttribute(name); } -void HTMLIFrameElement::collectStyleForAttribute(Attribute* attr, StylePropertySet* style) +void HTMLIFrameElement::collectStyleForAttribute(const Attribute& attribute, StylePropertySet* style) { - if (attr->name() == widthAttr) - addHTMLLengthToStyle(style, CSSPropertyWidth, attr->value()); - else if (attr->name() == heightAttr) - addHTMLLengthToStyle(style, CSSPropertyHeight, attr->value()); - else if (attr->name() == alignAttr) - applyAlignmentAttributeToStyle(attr, style); - else if (attr->name() == frameborderAttr) { + if (attribute.name() == widthAttr) + addHTMLLengthToStyle(style, CSSPropertyWidth, attribute.value()); + else if (attribute.name() == heightAttr) + addHTMLLengthToStyle(style, CSSPropertyHeight, attribute.value()); + else if (attribute.name() == alignAttr) + applyAlignmentAttributeToStyle(attribute, style); + else if (attribute.name() == frameborderAttr) { // Frame border doesn't really match the HTML4 spec definition for iframes. It simply adds // a presentational hint that the border should be off if set to zero. - if (!attr->isNull() && !attr->value().toInt()) { + if (!attribute.isNull() && !attribute.value().toInt()) { // Add a rule that nulls out our border width. addPropertyToAttributeStyle(style, CSSPropertyBorderWidth, 0, CSSPrimitiveValue::CSS_PX); } } else - HTMLFrameElementBase::collectStyleForAttribute(attr, style); + HTMLFrameElementBase::collectStyleForAttribute(attribute, style); } -void HTMLIFrameElement::parseAttribute(Attribute* attr) +void HTMLIFrameElement::parseAttribute(const Attribute& attribute) { - if (attr->name() == nameAttr) { - const AtomicString& newName = attr->value(); + if (attribute.name() == nameAttr) { + const AtomicString& newName = attribute.value(); if (inDocument() && document()->isHTMLDocument()) { HTMLDocument* document = static_cast<HTMLDocument*>(this->document()); document->removeExtraNamedItem(m_name); document->addExtraNamedItem(newName); } m_name = newName; - } else if (attr->name() == sandboxAttr) - setSandboxFlags(attr->isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(attr->value())); - else - HTMLFrameElementBase::parseAttribute(attr); + } else if (attribute.name() == sandboxAttr) + setSandboxFlags(attribute.isNull() ? SandboxNone : SecurityContext::parseSandboxPolicy(attribute.value())); + else if (attribute.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); } bool HTMLIFrameElement::rendererIsNeeded(const NodeRenderingContext& context) |