summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderTable.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-03-12 14:11:15 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-03-12 14:11:15 +0100
commitdd91e772430dc294e3bf478c119ef8d43c0a3358 (patch)
tree6f33ce4d5872a5691e0291eb45bf6ab373a5f567 /Source/WebCore/rendering/RenderTable.cpp
parentad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (diff)
downloadqtwebkit-dd91e772430dc294e3bf478c119ef8d43c0a3358.tar.gz
Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422)
This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API.
Diffstat (limited to 'Source/WebCore/rendering/RenderTable.cpp')
-rw-r--r--Source/WebCore/rendering/RenderTable.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index 1a42652db..2c8cae1dd 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -270,11 +270,11 @@ void RenderTable::computeLogicalWidth()
LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& styleLogicalWidth, LayoutUnit availableWidth)
{
// HTML tables' width styles already include borders and paddings, but CSS tables' width styles do not.
- LayoutUnit borders = 0;
+ int borders = 0;
bool isCSSTable = !node() || !node()->hasTagName(tableTag);
if (isCSSTable && styleLogicalWidth.isFixed() && styleLogicalWidth.isPositive()) {
recalcBordersInRowDirection();
- borders = borderStart() + borderEnd() + (collapseBorders() ? zeroLayoutUnit : paddingStart() + paddingEnd());
+ borders = borderStart() + borderEnd() + (collapseBorders() ? 0 : paddingStart() + paddingEnd());
}
return styleLogicalWidth.calcMinValue(availableWidth) + borders;
}
@@ -840,14 +840,14 @@ void RenderTable::recalcSections() const
m_needsSectionRecalc = false;
}
-LayoutUnit RenderTable::calcBorderStart() const
+int RenderTable::calcBorderStart() const
{
if (collapseBorders()) {
// Determined by the first cell of the first row. See the CSS 2.1 spec, section 17.6.2.
if (!numEffCols())
return 0;
- LayoutUnit borderWidth = 0;
+ unsigned borderWidth = 0;
const BorderValue& tb = style()->borderStart();
if (tb.style() == BHIDDEN)
@@ -860,7 +860,7 @@ LayoutUnit RenderTable::calcBorderStart() const
if (gb.style() == BHIDDEN)
return 0;
if (gb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, gb.width());
+ borderWidth = max(borderWidth, gb.width());
}
if (const RenderTableSection* topNonEmptySection = this->topNonEmptySection()) {
@@ -869,7 +869,7 @@ LayoutUnit RenderTable::calcBorderStart() const
return 0;
if (sb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, sb.width());
+ borderWidth = max(borderWidth, sb.width());
const RenderTableSection::CellStruct& cs = topNonEmptySection->cellAt(0, 0);
@@ -883,9 +883,9 @@ LayoutUnit RenderTable::calcBorderStart() const
return 0;
if (cb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, cb.width());
+ borderWidth = max(borderWidth, cb.width());
if (rb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, rb.width());
+ borderWidth = max(borderWidth, rb.width());
}
}
return (borderWidth + (style()->isLeftToRightDirection() ? 0 : 1)) / 2;
@@ -893,14 +893,14 @@ LayoutUnit RenderTable::calcBorderStart() const
return RenderBlock::borderStart();
}
-LayoutUnit RenderTable::calcBorderEnd() const
+int RenderTable::calcBorderEnd() const
{
if (collapseBorders()) {
// Determined by the last cell of the first row. See the CSS 2.1 spec, section 17.6.2.
if (!numEffCols())
return 0;
- LayoutUnit borderWidth = 0;
+ unsigned borderWidth = 0;
const BorderValue& tb = style()->borderEnd();
if (tb.style() == BHIDDEN)
@@ -914,7 +914,7 @@ LayoutUnit RenderTable::calcBorderEnd() const
if (gb.style() == BHIDDEN)
return 0;
if (gb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, gb.width());
+ borderWidth = max(borderWidth, gb.width());
}
if (const RenderTableSection* topNonEmptySection = this->topNonEmptySection()) {
@@ -923,7 +923,7 @@ LayoutUnit RenderTable::calcBorderEnd() const
return 0;
if (sb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, sb.width());
+ borderWidth = max(borderWidth, sb.width());
const RenderTableSection::CellStruct& cs = topNonEmptySection->cellAt(0, endColumn);
@@ -937,9 +937,9 @@ LayoutUnit RenderTable::calcBorderEnd() const
return 0;
if (cb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, cb.width());
+ borderWidth = max(borderWidth, cb.width());
if (rb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, rb.width());
+ borderWidth = max(borderWidth, rb.width());
}
}
return (borderWidth + (style()->isLeftToRightDirection() ? 1 : 0)) / 2;
@@ -953,7 +953,7 @@ void RenderTable::recalcBordersInRowDirection()
m_borderEnd = calcBorderEnd();
}
-LayoutUnit RenderTable::borderBefore() const
+int RenderTable::borderBefore() const
{
if (collapseBorders()) {
recalcSectionsIfNeeded();
@@ -962,7 +962,7 @@ LayoutUnit RenderTable::borderBefore() const
return RenderBlock::borderBefore();
}
-LayoutUnit RenderTable::borderAfter() const
+int RenderTable::borderAfter() const
{
if (collapseBorders()) {
recalcSectionsIfNeeded();
@@ -971,11 +971,11 @@ LayoutUnit RenderTable::borderAfter() const
return RenderBlock::borderAfter();
}
-LayoutUnit RenderTable::outerBorderBefore() const
+int RenderTable::outerBorderBefore() const
{
if (!collapseBorders())
return 0;
- LayoutUnit borderWidth = 0;
+ int borderWidth = 0;
if (RenderTableSection* topSection = this->topSection()) {
borderWidth = topSection->outerBorderBefore();
if (borderWidth < 0)
@@ -985,15 +985,15 @@ LayoutUnit RenderTable::outerBorderBefore() const
if (tb.style() == BHIDDEN)
return 0;
if (tb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, tb.width() / 2);
+ borderWidth = max<int>(borderWidth, tb.width() / 2);
return borderWidth;
}
-LayoutUnit RenderTable::outerBorderAfter() const
+int RenderTable::outerBorderAfter() const
{
if (!collapseBorders())
return 0;
- LayoutUnit borderWidth = 0;
+ int borderWidth = 0;
RenderTableSection* bottomSection;
if (m_foot)
bottomSection = m_foot;
@@ -1011,16 +1011,16 @@ LayoutUnit RenderTable::outerBorderAfter() const
if (tb.style() == BHIDDEN)
return 0;
if (tb.style() > BHIDDEN)
- borderWidth = max<LayoutUnit>(borderWidth, (tb.width() + 1) / 2);
+ borderWidth = max<int>(borderWidth, (tb.width() + 1) / 2);
return borderWidth;
}
-LayoutUnit RenderTable::outerBorderStart() const
+int RenderTable::outerBorderStart() const
{
if (!collapseBorders())
return 0;
- LayoutUnit borderWidth = 0;
+ int borderWidth = 0;
const BorderValue& tb = style()->borderStart();
if (tb.style() == BHIDDEN)
@@ -1032,7 +1032,7 @@ LayoutUnit RenderTable::outerBorderStart() const
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (!child->isTableSection())
continue;
- LayoutUnit sw = toRenderTableSection(child)->outerBorderStart();
+ int sw = toRenderTableSection(child)->outerBorderStart();
if (sw < 0)
continue;
allHidden = false;
@@ -1044,12 +1044,12 @@ LayoutUnit RenderTable::outerBorderStart() const
return borderWidth;
}
-LayoutUnit RenderTable::outerBorderEnd() const
+int RenderTable::outerBorderEnd() const
{
if (!collapseBorders())
return 0;
- LayoutUnit borderWidth = 0;
+ int borderWidth = 0;
const BorderValue& tb = style()->borderEnd();
if (tb.style() == BHIDDEN)
@@ -1061,7 +1061,7 @@ LayoutUnit RenderTable::outerBorderEnd() const
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
if (!child->isTableSection())
continue;
- LayoutUnit sw = toRenderTableSection(child)->outerBorderEnd();
+ int sw = toRenderTableSection(child)->outerBorderEnd();
if (sw < 0)
continue;
allHidden = false;