HTMLBaseElement.cpp [plain text]
#include "config.h"
#include "HTMLBaseElement.h"
#include "Attribute.h"
#include "Document.h"
#include "HTMLNames.h"
namespace WebCore {
using namespace HTMLNames;
inline HTMLBaseElement::HTMLBaseElement(const QualifiedName& tagName, Document* document)
: HTMLElement(tagName, document)
{
ASSERT(hasTagName(baseTag));
}
PassRefPtr<HTMLBaseElement> HTMLBaseElement::create(const QualifiedName& tagName, Document* document)
{
return adoptRef(new HTMLBaseElement(tagName, document));
}
void HTMLBaseElement::parseAttribute(Attribute* attribute)
{
if (attribute->name() == hrefAttr || attribute->name() == targetAttr)
document()->processBaseElement();
else
HTMLElement::parseAttribute(attribute);
}
Node::InsertionNotificationRequest HTMLBaseElement::insertedInto(Node* insertionPoint)
{
HTMLElement::insertedInto(insertionPoint);
if (insertionPoint->inDocument())
document()->processBaseElement();
return InsertionDone;
}
void HTMLBaseElement::removedFrom(Node* insertionPoint)
{
HTMLElement::removedFrom(insertionPoint);
if (insertionPoint->inDocument())
document()->processBaseElement();
}
bool HTMLBaseElement::isURLAttribute(Attribute* attribute) const
{
return attribute->name() == hrefAttr || HTMLElement::isURLAttribute(attribute);
}
String HTMLBaseElement::target() const
{
return fastGetAttribute(targetAttr);
}
}