HTMLMetaElement.cpp [plain text]
#include "config.h"
#include "HTMLMetaElement.h"
#include "Document.h"
#include "HTMLNames.h"
#include "MappedAttribute.h"
namespace WebCore {
using namespace HTMLNames;
HTMLMetaElement::HTMLMetaElement(const QualifiedName& tagName, Document* doc)
: HTMLElement(tagName, doc)
{
ASSERT(hasTagName(metaTag));
}
HTMLMetaElement::~HTMLMetaElement()
{
}
void HTMLMetaElement::parseMappedAttribute(MappedAttribute* attr)
{
if (attr->name() == http_equivAttr) {
m_equiv = attr->value();
process();
} else if (attr->name() == contentAttr) {
m_content = attr->value();
process();
} else if (attr->name() == nameAttr) {
} else
HTMLElement::parseMappedAttribute(attr);
}
void HTMLMetaElement::insertedIntoDocument()
{
HTMLElement::insertedIntoDocument();
process();
}
void HTMLMetaElement::process()
{
if (!inDocument() || m_content.isNull())
return;
if (equalIgnoringCase(name(), "viewport"))
document()->processViewport(m_content);
if (!m_equiv.isNull())
document()->processHttpEquiv(m_equiv, m_content);
}
String HTMLMetaElement::content() const
{
return getAttribute(contentAttr);
}
void HTMLMetaElement::setContent(const String& value)
{
setAttribute(contentAttr, value);
}
String HTMLMetaElement::httpEquiv() const
{
return getAttribute(http_equivAttr);
}
void HTMLMetaElement::setHttpEquiv(const String& value)
{
setAttribute(http_equivAttr, value);
}
String HTMLMetaElement::name() const
{
return getAttribute(nameAttr);
}
void HTMLMetaElement::setName(const String& value)
{
setAttribute(nameAttr, value);
}
String HTMLMetaElement::scheme() const
{
return getAttribute(schemeAttr);
}
void HTMLMetaElement::setScheme(const String &value)
{
setAttribute(schemeAttr, value);
}
}