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)
: HTMLElement(tagName, document)
{
ASSERT(hasTagName(captionTag));
}
PassRefPtr<HTMLTableCaptionElement> HTMLTableCaptionElement::create(const QualifiedName& tagName, Document* document)
{
return adoptRef(new HTMLTableCaptionElement(tagName, document));
}
bool HTMLTableCaptionElement::isPresentationAttribute(const QualifiedName& name) const
{
if (name == alignAttr)
return true;
return HTMLElement::isPresentationAttribute(name);
}
void HTMLTableCaptionElement::collectStyleForAttribute(Attribute* attr, StylePropertySet* style)
{
if (attr->name() == alignAttr) {
if (!attr->isEmpty())
addPropertyToAttributeStyle(style, CSSPropertyCaptionSide, attr->value());
} else
HTMLElement::collectStyleForAttribute(attr, style);
}
}