aboutsummaryrefslogtreecommitdiff
path: root/dw/table.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-08-29 00:57:38 +0200
committerSebastian Geerken <devnull@localhost>2014-08-29 00:57:38 +0200
commit92a85e39c7bdec28d3e4890f2df7d73440606e4f (patch)
treed07c7eac65af344ad3acd740140f4cc278e993a0 /dw/table.cc
parente569803c28ed96548720f123a63adb40171c1de9 (diff)
Fixed CSS 'width' in table cells. (Plus some RTFL.)
Diffstat (limited to 'dw/table.cc')
-rw-r--r--dw/table.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/dw/table.cc b/dw/table.cc
index 9922543f..746856c7 100644
--- a/dw/table.cc
+++ b/dw/table.cc
@@ -259,6 +259,20 @@ int Table::calcAvailWidthForDescendant (Widget *child)
for (int i = 0; i < children->get(n)->cell.colspanEff; i++)
width += colWidths->get (col + i);
width = misc::max (width, 0);
+
+ if (child != actualChild) {
+ // For table cells (direct children: child == actualChild),
+ // CSS 'width' is already regarded in the column calculation.
+ // However, for children of the table cells, CSS 'width' must
+ // be regarded here.
+
+ int corrWidth = width;
+ child->calcFinalWidth (child->getStyle(), -1, this, 0, true,
+ &corrWidth);
+
+ // But better not exceed it ... (TODO: Only here?)
+ width = misc::min (width, corrWidth);
+ }
}
}
}