summaryrefslogtreecommitdiffstats
path: root/WebCore/html/HTMLBaseElement.cpp
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-09-08 12:18:00 +0100
committerKristian Monsen <kristianm@google.com>2010-09-11 12:08:58 +0100
commit5ddde30071f639962dd557c453f2ad01f8f0fd00 (patch)
tree775803c4ab35af50aa5f5472cd1fb95fe9d5152d /WebCore/html/HTMLBaseElement.cpp
parent3e63d9b33b753ca86d0765d1b3d711114ba9e34f (diff)
downloadexternal_webkit-5ddde30071f639962dd557c453f2ad01f8f0fd00.zip
external_webkit-5ddde30071f639962dd557c453f2ad01f8f0fd00.tar.gz
external_webkit-5ddde30071f639962dd557c453f2ad01f8f0fd00.tar.bz2
Merge WebKit at r66666 : Initial merge by git.
Change-Id: I57dedeb49859adc9c539e760f0e749768c66626f
Diffstat (limited to 'WebCore/html/HTMLBaseElement.cpp')
-rw-r--r--WebCore/html/HTMLBaseElement.cpp42
1 files changed, 13 insertions, 29 deletions
diff --git a/WebCore/html/HTMLBaseElement.cpp b/WebCore/html/HTMLBaseElement.cpp
index a3095d1..0dd16fa 100644
--- a/WebCore/html/HTMLBaseElement.cpp
+++ b/WebCore/html/HTMLBaseElement.cpp
@@ -24,11 +24,8 @@
#include "HTMLBaseElement.h"
#include "Attribute.h"
-#include "CSSHelper.h"
#include "Document.h"
-#include "Frame.h"
#include "HTMLNames.h"
-#include "XSSAuditor.h"
namespace WebCore {
@@ -45,47 +42,34 @@ PassRefPtr<HTMLBaseElement> HTMLBaseElement::create(const QualifiedName& tagName
return adoptRef(new HTMLBaseElement(tagName, document));
}
-void HTMLBaseElement::parseMappedAttribute(Attribute* attr)
+void HTMLBaseElement::parseMappedAttribute(Attribute* attribute)
{
- if (attr->name() == hrefAttr) {
- m_hrefAttrValue = attr->value();
- m_href = deprecatedParseURL(attr->value());
- process();
- } else if (attr->name() == targetAttr) {
- m_target = attr->value();
- process();
- } else
- HTMLElement::parseMappedAttribute(attr);
+ if (attribute->name() == hrefAttr || attribute->name() == targetAttr)
+ document()->processBaseElement();
+ else
+ HTMLElement::parseMappedAttribute(attribute);
}
void HTMLBaseElement::insertedIntoDocument()
{
HTMLElement::insertedIntoDocument();
- process();
+ document()->processBaseElement();
}
void HTMLBaseElement::removedFromDocument()
{
HTMLElement::removedFromDocument();
-
- // Since the document doesn't have a base element, clear the base URL and target.
- // FIXME: This does not handle the case of multiple base elements correctly.
- document()->setBaseElementURL(KURL());
- document()->setBaseElementTarget(String());
+ document()->processBaseElement();
}
-void HTMLBaseElement::process()
+bool HTMLBaseElement::isURLAttribute(Attribute* attribute) const
{
- if (!inDocument())
- return;
-
- if (!m_href.isEmpty() && (!document()->frame() || document()->frame()->script()->xssAuditor()->canSetBaseElementURL(m_hrefAttrValue)))
- document()->setBaseElementURL(KURL(document()->url(), m_href));
-
- if (!m_target.isEmpty())
- document()->setBaseElementTarget(m_target);
+ return attribute->name() == hrefAttr;
+}
- // FIXME: Changing a document's base URL should probably automatically update the resolved relative URLs of all images, stylesheets, etc.
+String HTMLBaseElement::target() const
+{
+ return fastGetAttribute(targetAttr);
}
}