HTMLTableCaptionElement.cpp [plain text]
#include "config.h"
#include "HTMLTableCaptionElement.h"
#include "Attribute.h"
#include "CSSPropertyNames.h"
#include "HTMLNames.h"
namespace WebCore {
using namespace HTMLNames;
inline HTMLTableCaptionElement::HTMLTableCaptionElement(const QualifiedName& tagName, Document* document)
: HTMLTablePartElement(tagName, document)
{
ASSERT(hasTagName(captionTag));
}
PassRefPtr<HTMLTableCaptionElement> HTMLTableCaptionElement::create(const QualifiedName& tagName, Document* document)
{
return adoptRef(new HTMLTableCaptionElement(tagName, document));
}
bool HTMLTableCaptionElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
{
if (attrName == alignAttr) {
result = eCaption;
return false;
}
return HTMLElement::mapToEntry(attrName, result);
}
void HTMLTableCaptionElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == alignAttr) {
if (!attr->value().isEmpty())
addCSSProperty(attr, CSSPropertyCaptionSide, attr->value());
} else
HTMLElement::parseMappedAttribute(attr);
}
}