summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLTableColElement.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/html/HTMLTableColElement.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/html/HTMLTableColElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLTableColElement.cpp34
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);
}
}