This source file includes following definitions.
- create
- collectStyleForPresentationAttribute
#include "config.h"
#include "core/html/HTMLDivElement.h"
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
#include "HTMLNames.h"
namespace WebCore {
using namespace HTMLNames;
HTMLDivElement::HTMLDivElement(Document& document)
: HTMLElement(divTag, document)
{
ScriptWrappable::init(this);
}
PassRefPtr<HTMLDivElement> HTMLDivElement::create(Document& document)
{
return adoptRef(new HTMLDivElement(document));
}
void HTMLDivElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
{
if (name == alignAttr) {
if (equalIgnoringCase(value, "middle") || equalIgnoringCase(value, "center"))
addPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitCenter);
else if (equalIgnoringCase(value, "left"))
addPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitLeft);
else if (equalIgnoringCase(value, "right"))
addPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, CSSValueWebkitRight);
else
addPropertyToPresentationAttributeStyle(style, CSSPropertyTextAlign, value);
} else
HTMLElement::collectStyleForPresentationAttribute(name, value, style);
}
}