summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLParagraphElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
commit03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch)
tree52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/WebCore/html/HTMLParagraphElement.cpp
parentcd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff)
downloadqtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/WebCore/html/HTMLParagraphElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLParagraphElement.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/Source/WebCore/html/HTMLParagraphElement.cpp b/Source/WebCore/html/HTMLParagraphElement.cpp
index e8a5aa70f..6cc9f51b8 100644
--- a/Source/WebCore/html/HTMLParagraphElement.cpp
+++ b/Source/WebCore/html/HTMLParagraphElement.cpp
@@ -44,28 +44,21 @@ PassRefPtr<HTMLParagraphElement> HTMLParagraphElement::create(const QualifiedNam
return adoptRef(new HTMLParagraphElement(tagName, document));
}
-bool HTMLParagraphElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
-{
- if (attrName == alignAttr) {
- result = eBlock; // We can share with DIV here.
- return false;
- }
- return HTMLElement::mapToEntry(attrName, result);
-}
-
-void HTMLParagraphElement::parseMappedAttribute(Attribute* attr)
+void HTMLParagraphElement::parseAttribute(Attribute* attr)
{
if (attr->name() == alignAttr) {
- if (equalIgnoringCase(attr->value(), "middle") || equalIgnoringCase(attr->value(), "center"))
- addCSSProperty(attr, CSSPropertyTextAlign, CSSValueWebkitCenter);
+ if (attr->value().isNull())
+ removeCSSProperty(CSSPropertyTextAlign);
+ else if (equalIgnoringCase(attr->value(), "middle") || equalIgnoringCase(attr->value(), "center"))
+ addCSSProperty(CSSPropertyTextAlign, CSSValueWebkitCenter);
else if (equalIgnoringCase(attr->value(), "left"))
- addCSSProperty(attr, CSSPropertyTextAlign, CSSValueWebkitLeft);
+ addCSSProperty(CSSPropertyTextAlign, CSSValueWebkitLeft);
else if (equalIgnoringCase(attr->value(), "right"))
- addCSSProperty(attr, CSSPropertyTextAlign, CSSValueWebkitRight);
+ addCSSProperty(CSSPropertyTextAlign, CSSValueWebkitRight);
else
- addCSSProperty(attr, CSSPropertyTextAlign, attr->value());
+ addCSSProperty(CSSPropertyTextAlign, attr->value());
} else
- HTMLElement::parseMappedAttribute(attr);
+ HTMLElement::parseAttribute(attr);
}
}