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/HTMLFrameElementBase.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/HTMLFrameElementBase.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLFrameElementBase.cpp | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/Source/WebCore/html/HTMLFrameElementBase.cpp b/Source/WebCore/html/HTMLFrameElementBase.cpp index d7882f37c..7adc9c8fd 100644 --- a/Source/WebCore/html/HTMLFrameElementBase.cpp +++ b/Source/WebCore/html/HTMLFrameElementBase.cpp @@ -102,47 +102,47 @@ void HTMLFrameElementBase::openURL(bool lockHistory, bool lockBackForwardList) contentFrame()->setInViewSourceMode(viewSourceMode()); } -void HTMLFrameElementBase::parseAttribute(const Attribute& attribute) +void HTMLFrameElementBase::parseAttribute(const QualifiedName& name, const AtomicString& value) { - if (attribute.name() == srcdocAttr) + if (name == srcdocAttr) setLocation("about:srcdoc"); - else if (attribute.name() == srcAttr && !fastHasAttribute(srcdocAttr)) - setLocation(stripLeadingAndTrailingHTMLSpaces(attribute.value())); - else if (isIdAttributeName(attribute.name())) { + else if (name == srcAttr && !fastHasAttribute(srcdocAttr)) + setLocation(stripLeadingAndTrailingHTMLSpaces(value)); + else if (isIdAttributeName(name)) { // Important to call through to base for the id attribute so the hasID bit gets set. - HTMLFrameOwnerElement::parseAttribute(attribute); - m_frameName = attribute.value(); - } else if (attribute.name() == nameAttr) { - m_frameName = attribute.value(); + HTMLFrameOwnerElement::parseAttribute(name, value); + m_frameName = value; + } else if (name == nameAttr) { + m_frameName = value; // FIXME: If we are already attached, this doesn't actually change the frame's name. // FIXME: If we are already attached, this doesn't check for frame name // conflicts and generate a unique frame name. - } else if (attribute.name() == marginwidthAttr) { - m_marginWidth = attribute.value().toInt(); + } else if (name == marginwidthAttr) { + m_marginWidth = value.toInt(); // FIXME: If we are already attached, this has no effect. - } else if (attribute.name() == marginheightAttr) { - m_marginHeight = attribute.value().toInt(); + } else if (name == marginheightAttr) { + m_marginHeight = value.toInt(); // FIXME: If we are already attached, this has no effect. - } else if (attribute.name() == scrollingAttr) { + } else if (name == scrollingAttr) { // Auto and yes both simply mean "allow scrolling." No means "don't allow scrolling." - if (equalIgnoringCase(attribute.value(), "auto") || equalIgnoringCase(attribute.value(), "yes")) + if (equalIgnoringCase(value, "auto") || equalIgnoringCase(value, "yes")) m_scrolling = document()->frameElementsShouldIgnoreScrolling() ? ScrollbarAlwaysOff : ScrollbarAuto; - else if (equalIgnoringCase(attribute.value(), "no")) + else if (equalIgnoringCase(value, "no")) m_scrolling = ScrollbarAlwaysOff; // FIXME: If we are already attached, this has no effect. - } else if (attribute.name() == viewsourceAttr) { - m_viewSource = !attribute.isNull(); + } else if (name == viewsourceAttr) { + m_viewSource = !value.isNull(); if (contentFrame()) contentFrame()->setInViewSourceMode(viewSourceMode()); - } else if (attribute.name() == onloadAttr) - setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, attribute)); - else if (attribute.name() == onbeforeloadAttr) - setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attribute)); - else if (attribute.name() == onbeforeunloadAttr) { + } else if (name == onloadAttr) + setAttributeEventListener(eventNames().loadEvent, createAttributeEventListener(this, name, value)); + else if (name == onbeforeloadAttr) + setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, name, value)); + else if (name == onbeforeunloadAttr) { // FIXME: should <frame> elements have beforeunload handlers? - setAttributeEventListener(eventNames().beforeunloadEvent, createAttributeEventListener(this, attribute)); + setAttributeEventListener(eventNames().beforeunloadEvent, createAttributeEventListener(this, name, value)); } else - HTMLFrameOwnerElement::parseAttribute(attribute); + HTMLFrameOwnerElement::parseAttribute(name, value); } void HTMLFrameElementBase::setNameAndOpenURL() @@ -170,6 +170,9 @@ void HTMLFrameElementBase::didNotifySubtreeInsertions(ContainerNode*) if (!document()->frame()) return; + if (!SubframeLoadingDisabler::canLoadFrame(this)) + return; + // JavaScript in src=javascript: and beforeonload can access the renderer // during attribute parsing *before* the normal parser machinery would // attach the element. To support this, we lazyAttach here, but only |