From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/html/HTMLTableColElement.cpp | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'Source/WebCore/html/HTMLTableColElement.cpp') diff --git a/Source/WebCore/html/HTMLTableColElement.cpp b/Source/WebCore/html/HTMLTableColElement.cpp index 995b892f9..caa9d190c 100644 --- a/Source/WebCore/html/HTMLTableColElement.cpp +++ b/Source/WebCore/html/HTMLTableColElement.cpp @@ -25,9 +25,9 @@ #include "config.h" #include "HTMLTableColElement.h" -#include "Attribute.h" #include "CSSPropertyNames.h" #include "HTMLNames.h" +#include "HTMLParserIdioms.h" #include "HTMLTableElement.h" #include "RenderTableCol.h" #include "Text.h" @@ -42,9 +42,9 @@ inline HTMLTableColElement::HTMLTableColElement(const QualifiedName& tagName, Do { } -PassRefPtr HTMLTableColElement::create(const QualifiedName& tagName, Document& document) +Ref HTMLTableColElement::create(const QualifiedName& tagName, Document& document) { - return adoptRef(new HTMLTableColElement(tagName, document)); + return adoptRef(*new HTMLTableColElement(tagName, document)); } bool HTMLTableColElement::isPresentationAttribute(const QualifiedName& name) const @@ -65,39 +65,39 @@ void HTMLTableColElement::collectStyleForPresentationAttribute(const QualifiedNa void HTMLTableColElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { if (name == spanAttr) { - m_span = !value.isNull() ? value.toInt() : 1; - if (renderer() && renderer()->isRenderTableCol()) - renderer()->updateFromElement(); + m_span = limitToOnlyHTMLNonNegativeNumbersGreaterThanZero(value); + if (is(renderer())) + downcast(*renderer()).updateFromElement(); } else if (name == widthAttr) { if (!value.isEmpty()) { - if (renderer() && renderer()->isRenderTableCol()) { - RenderTableCol* col = toRenderTableCol(renderer()); + if (is(renderer())) { + RenderTableCol& col = downcast(*renderer()); int newWidth = width().toInt(); - if (newWidth != col->width()) - col->setNeedsLayoutAndPrefWidthsRecalc(); + if (newWidth != col.width()) + col.setNeedsLayoutAndPrefWidthsRecalc(); } } } else HTMLTablePartElement::parseAttribute(name, value); } -const StyleProperties* HTMLTableColElement::additionalPresentationAttributeStyle() +const StyleProperties* HTMLTableColElement::additionalPresentationAttributeStyle() const { - if (!hasLocalName(colgroupTag)) - return 0; + if (!hasTagName(colgroupTag)) + return nullptr; if (HTMLTableElement* table = findParentTable()) return table->additionalGroupStyle(false); - return 0; + return nullptr; } -void HTMLTableColElement::setSpan(int n) +void HTMLTableColElement::setSpan(unsigned n) { - setIntegralAttribute(spanAttr, n); + setUnsignedIntegralAttribute(spanAttr, limitToOnlyHTMLNonNegativeNumbersGreaterThanZero(n)); } String HTMLTableColElement::width() const { - return fastGetAttribute(widthAttr); + return attributeWithoutSynchronization(widthAttr); } } -- cgit v1.2.1