From 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 9 Feb 2012 14:16:12 +0100 Subject: Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223) --- Source/WebCore/html/HTMLParagraphElement.cpp | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'Source/WebCore/html/HTMLParagraphElement.cpp') 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::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); } } -- cgit v1.2.1