This source file includes following definitions.
- create
- collectStyleForPresentationAttribute
#include "config.h"
#include "core/html/HTMLParagraphElement.h"
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
#include "HTMLNames.h"
namespace WebCore {
using namespace HTMLNames;
inline HTMLParagraphElement::HTMLParagraphElement(Document& document)
: HTMLElement(pTag, document)
{
ScriptWrappable::init(this);
}
PassRefPtr<HTMLParagraphElement> HTMLParagraphElement::create(Document& document)
{
return adoptRef(new HTMLParagraphElement(document));
}
void HTMLParagraphElement::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);
}
}