This source file includes following definitions.
- create
- isPresentationAttribute
- collectStyleForPresentationAttribute
- createRenderer
#include "config.h"
#include "core/html/HTMLBRElement.h"
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
#include "HTMLNames.h"
#include "core/rendering/RenderBR.h"
namespace WebCore {
using namespace HTMLNames;
HTMLBRElement::HTMLBRElement(Document& document)
: HTMLElement(brTag, document)
{
ScriptWrappable::init(this);
}
PassRefPtr<HTMLBRElement> HTMLBRElement::create(Document& document)
{
return adoptRef(new HTMLBRElement(document));
}
bool HTMLBRElement::isPresentationAttribute(const QualifiedName& name) const
{
if (name == clearAttr)
return true;
return HTMLElement::isPresentationAttribute(name);
}
void HTMLBRElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
{
if (name == clearAttr) {
if (!value.isEmpty()) {
if (equalIgnoringCase(value, "all"))
addPropertyToPresentationAttributeStyle(style, CSSPropertyClear, CSSValueBoth);
else
addPropertyToPresentationAttributeStyle(style, CSSPropertyClear, value);
}
} else
HTMLElement::collectStyleForPresentationAttribute(name, value, style);
}
RenderObject* HTMLBRElement::createRenderer(RenderStyle* style)
{
if (style->hasContent())
return RenderObject::createObject(this, style);
return new RenderBR(this);
}
}