summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLTableColElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-24 16:36:50 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-24 16:36:50 +0100
commitad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch)
treeb34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/WebCore/html/HTMLTableColElement.cpp
parent03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff)
downloadqtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/WebCore/html/HTMLTableColElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLTableColElement.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/Source/WebCore/html/HTMLTableColElement.cpp b/Source/WebCore/html/HTMLTableColElement.cpp
index 0c83e781c..db75b2544 100644
--- a/Source/WebCore/html/HTMLTableColElement.cpp
+++ b/Source/WebCore/html/HTMLTableColElement.cpp
@@ -47,6 +47,21 @@ PassRefPtr<HTMLTableColElement> HTMLTableColElement::create(const QualifiedName&
return adoptRef(new HTMLTableColElement(tagName, document));
}
+bool HTMLTableColElement::isPresentationAttribute(Attribute* attr) const
+{
+ if (attr->name() == widthAttr)
+ return true;
+ return HTMLTablePartElement::isPresentationAttribute(attr);
+}
+
+void HTMLTableColElement::collectStyleForAttribute(Attribute* attr, StylePropertySet* style)
+{
+ if (attr->name() == widthAttr)
+ addHTMLLengthToStyle(style, CSSPropertyWidth, attr->value());
+ else
+ HTMLTablePartElement::collectStyleForAttribute(attr, style);
+}
+
void HTMLTableColElement::parseAttribute(Attribute* attr)
{
if (attr->name() == spanAttr) {
@@ -55,15 +70,13 @@ void HTMLTableColElement::parseAttribute(Attribute* attr)
renderer()->updateFromElement();
} else if (attr->name() == widthAttr) {
if (!attr->value().isEmpty()) {
- addCSSLength(CSSPropertyWidth, attr->value());
if (renderer() && renderer()->isTableCol()) {
RenderTableCol* col = toRenderTableCol(renderer());
int newWidth = width().toInt();
if (newWidth != col->width())
col->setNeedsLayoutAndPrefWidthsRecalc();
}
- } else
- removeCSSProperty(CSSPropertyWidth);
+ }
} else
HTMLTablePartElement::parseAttribute(attr);
}
@@ -72,12 +85,9 @@ StylePropertySet* HTMLTableColElement::additionalAttributeStyle()
{
if (!hasLocalName(colgroupTag))
return 0;
- ContainerNode* p = parentNode();
- while (p && !p->hasTagName(tableTag))
- p = p->parentNode();
- if (!p)
- return 0;
- return static_cast<HTMLTableElement*>(p)->additionalGroupStyle(false);
+ if (HTMLTableElement* table = findParentTable())
+ return table->additionalGroupStyle(false);
+ return 0;
}
void HTMLTableColElement::setSpan(int n)