diff options
Diffstat (limited to 'Source/WebCore/html/HTMLTableColElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLTableColElement.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
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> HTMLTableColElement::create(const QualifiedName& tagName, Document& document) +Ref<HTMLTableColElement> 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<RenderTableCol>(renderer())) + downcast<RenderTableCol>(*renderer()).updateFromElement(); } else if (name == widthAttr) { if (!value.isEmpty()) { - if (renderer() && renderer()->isRenderTableCol()) { - RenderTableCol* col = toRenderTableCol(renderer()); + if (is<RenderTableCol>(renderer())) { + RenderTableCol& col = downcast<RenderTableCol>(*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); } } |