summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLTablePartElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/html/HTMLTablePartElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLTablePartElement.cpp71
1 files changed, 30 insertions, 41 deletions
diff --git a/Source/WebCore/html/HTMLTablePartElement.cpp b/Source/WebCore/html/HTMLTablePartElement.cpp
index dfaecca9a..8fd747bd8 100644
--- a/Source/WebCore/html/HTMLTablePartElement.cpp
+++ b/Source/WebCore/html/HTMLTablePartElement.cpp
@@ -36,65 +36,54 @@ namespace WebCore {
using namespace HTMLNames;
-bool HTMLTablePartElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
-{
- if (attrName == backgroundAttr) {
- result = (MappedAttributeEntry)(eLastEntry + document()->docID());
- return false;
- }
-
- if (attrName == bgcolorAttr ||
- attrName == bordercolorAttr ||
- attrName == valignAttr ||
- attrName == heightAttr) {
- result = eUniversal;
- return false;
- }
-
- if (attrName == alignAttr) {
- result = eCell; // All table parts will just share in the TD space.
- return false;
- }
-
- return HTMLElement::mapToEntry(attrName, result);
-}
-
-void HTMLTablePartElement::parseMappedAttribute(Attribute* attr)
+void HTMLTablePartElement::parseAttribute(Attribute* attr)
{
if (attr->name() == bgcolorAttr)
- addCSSColor(attr, CSSPropertyBackgroundColor, attr->value());
+ if (attr->value().isNull())
+ removeCSSProperty(CSSPropertyBackgroundColor);
+ else
+ addCSSColor(CSSPropertyBackgroundColor, attr->value());
else if (attr->name() == backgroundAttr) {
String url = stripLeadingAndTrailingHTMLSpaces(attr->value());
if (!url.isEmpty())
- addCSSImageProperty(attr, CSSPropertyBackgroundImage, document()->completeURL(url).string());
+ addCSSImageProperty(CSSPropertyBackgroundImage, document()->completeURL(url).string());
+ else
+ removeCSSProperty(CSSPropertyBackgroundImage);
} else if (attr->name() == bordercolorAttr) {
if (!attr->value().isEmpty()) {
- addCSSColor(attr, CSSPropertyBorderColor, attr->value());
- addCSSProperty(attr, CSSPropertyBorderTopStyle, CSSValueSolid);
- addCSSProperty(attr, CSSPropertyBorderBottomStyle, CSSValueSolid);
- addCSSProperty(attr, CSSPropertyBorderLeftStyle, CSSValueSolid);
- addCSSProperty(attr, CSSPropertyBorderRightStyle, CSSValueSolid);
- }
+ addCSSColor(CSSPropertyBorderColor, attr->value());
+ addCSSProperty(CSSPropertyBorderTopStyle, CSSValueSolid);
+ addCSSProperty(CSSPropertyBorderBottomStyle, CSSValueSolid);
+ addCSSProperty(CSSPropertyBorderLeftStyle, CSSValueSolid);
+ addCSSProperty(CSSPropertyBorderRightStyle, CSSValueSolid);
+ } else
+ removeCSSProperties(CSSPropertyBorderColor, CSSPropertyBorderTopStyle, CSSPropertyBorderBottomStyle, CSSPropertyBorderLeftStyle, CSSPropertyBorderRightStyle);
} else if (attr->name() == valignAttr) {
if (!attr->value().isEmpty())
- addCSSProperty(attr, CSSPropertyVerticalAlign, attr->value());
+ addCSSProperty(CSSPropertyVerticalAlign, attr->value());
+ else
+ removeCSSProperty(CSSPropertyVerticalAlign);
} else if (attr->name() == alignAttr) {
const AtomicString& v = attr->value();
- if (equalIgnoringCase(v, "middle") || equalIgnoringCase(v, "center"))
- addCSSProperty(attr, CSSPropertyTextAlign, CSSValueWebkitCenter);
+ if (v.isNull())
+ removeCSSProperty(CSSPropertyTextAlign);
+ else if (equalIgnoringCase(v, "middle") || equalIgnoringCase(v, "center"))
+ addCSSProperty(CSSPropertyTextAlign, CSSValueWebkitCenter);
else if (equalIgnoringCase(v, "absmiddle"))
- addCSSProperty(attr, CSSPropertyTextAlign, CSSValueCenter);
+ addCSSProperty(CSSPropertyTextAlign, CSSValueCenter);
else if (equalIgnoringCase(v, "left"))
- addCSSProperty(attr, CSSPropertyTextAlign, CSSValueWebkitLeft);
+ addCSSProperty(CSSPropertyTextAlign, CSSValueWebkitLeft);
else if (equalIgnoringCase(v, "right"))
- addCSSProperty(attr, CSSPropertyTextAlign, CSSValueWebkitRight);
+ addCSSProperty(CSSPropertyTextAlign, CSSValueWebkitRight);
else
- addCSSProperty(attr, CSSPropertyTextAlign, v);
+ addCSSProperty(CSSPropertyTextAlign, v);
} else if (attr->name() == heightAttr) {
if (!attr->value().isEmpty())
- addCSSLength(attr, CSSPropertyHeight, attr->value());
+ addCSSLength(CSSPropertyHeight, attr->value());
+ else
+ removeCSSProperty(CSSPropertyHeight);
} else
- HTMLElement::parseMappedAttribute(attr);
+ HTMLElement::parseAttribute(attr);
}
}