#include "config.h"
#include "core/html/HTMLTableColElement.h"
-#include "CSSPropertyNames.h"
-#include "HTMLNames.h"
+#include "core/CSSPropertyNames.h"
+#include "core/HTMLNames.h"
#include "core/html/HTMLTableElement.h"
#include "core/rendering/RenderTableCol.h"
-namespace WebCore {
+namespace blink {
using namespace HTMLNames;
: HTMLTablePartElement(tagName, document)
, m_span(1)
{
- ScriptWrappable::init(this);
}
-PassRefPtr<HTMLTableColElement> HTMLTableColElement::create(const QualifiedName& tagName, Document& document)
-{
- return adoptRef(new HTMLTableColElement(tagName, document));
-}
+DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(HTMLTableColElement)
bool HTMLTableColElement::isPresentationAttribute(const QualifiedName& name) const
{
void HTMLTableColElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == spanAttr) {
- m_span = !value.isNull() ? value.toInt() : 1;
+ int newSpan = value.toInt();
+ // If the value of span is not a valid non-negative integer greater than zero,
+ // set it to 1.
+ m_span = newSpan ? newSpan : 1;
if (renderer() && renderer()->isRenderTableCol())
renderer()->updateFromElement();
} else if (name == widthAttr) {
RenderTableCol* col = toRenderTableCol(renderer());
int newWidth = width().toInt();
if (newWidth != col->width())
- col->setNeedsLayoutAndPrefWidthsRecalc();
+ col->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
}
}
} else
const StylePropertySet* HTMLTableColElement::additionalPresentationAttributeStyle()
{
- if (!hasLocalName(colgroupTag))
+ if (!hasTagName(colgroupTag))
return 0;
if (HTMLTableElement* table = findParentTable())
return table->additionalGroupStyle(false);