summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderTableCell.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/rendering/RenderTableCell.h
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/rendering/RenderTableCell.h')
-rw-r--r--Source/WebCore/rendering/RenderTableCell.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/Source/WebCore/rendering/RenderTableCell.h b/Source/WebCore/rendering/RenderTableCell.h
index 2dd26a24d..720aa98c4 100644
--- a/Source/WebCore/rendering/RenderTableCell.h
+++ b/Source/WebCore/rendering/RenderTableCell.h
@@ -37,7 +37,7 @@ enum IncludeBorderColorOrNot { DoNotIncludeBorderColor, IncludeBorderColor };
class RenderTableCell : public RenderBlock {
public:
- explicit RenderTableCell(Node*);
+ explicit RenderTableCell(Element*);
unsigned colSpan() const
{
@@ -90,19 +90,18 @@ public:
return styleWidth;
}
- LayoutUnit logicalHeightForRowSizing() const
+ int logicalHeightForRowSizing() const
{
// FIXME: This function does too much work, and is very hot during table layout!
- LayoutUnit adjustedLogicalHeight = logicalHeight() - (intrinsicPaddingBefore() + intrinsicPaddingAfter());
- LayoutUnit styleLogicalHeight = valueForLength(style()->logicalHeight(), 0, view());
+ int adjustedLogicalHeight = pixelSnappedLogicalHeight() - (intrinsicPaddingBefore() + intrinsicPaddingAfter());
+ int styleLogicalHeight = valueForLength(style()->logicalHeight(), 0, view());
// In strict mode, box-sizing: content-box do the right thing and actually add in the border and padding.
// Call computedCSSPadding* directly to avoid including implicitPadding.
if (!document()->inQuirksMode() && style()->boxSizing() != BORDER_BOX)
- styleLogicalHeight += computedCSSPaddingBefore() + computedCSSPaddingAfter() + borderBefore() + borderAfter();
+ styleLogicalHeight += (computedCSSPaddingBefore() + computedCSSPaddingAfter()).floor() + borderBefore() + borderAfter();
return max(styleLogicalHeight, adjustedLogicalHeight);
}
- virtual void computePreferredLogicalWidths();
void setCellLogicalWidth(int constrainedLogicalWidth);
@@ -122,10 +121,17 @@ public:
virtual void paint(PaintInfo&, const LayoutPoint&);
+ bool alignLeftRightBorderPaintRect(int& leftXOffset, int& rightXOffset);
+ bool alignTopBottomBorderPaintRect(int& topYOffset, int& bottomYOffset);
void paintCollapsedBorders(PaintInfo&, const LayoutPoint&);
void paintBackgroundsBehindCell(PaintInfo&, const LayoutPoint&, RenderObject* backgroundObject);
LayoutUnit cellBaselinePosition() const;
+ bool isBaselineAligned() const
+ {
+ EVerticalAlign va = style()->verticalAlign();
+ return va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB || va == LENGTH;
+ }
void computeIntrinsicPadding(int rowHeight);
void clearIntrinsicPadding() { setIntrinsicPadding(0, 0); }
@@ -151,6 +157,7 @@ public:
bool cellWidthChanged() const { return m_cellWidthChanged; }
void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; }
+ static RenderTableCell* createAnonymous(Document*);
static RenderTableCell* createAnonymousWithParentRenderer(const RenderObject*);
virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE
{
@@ -207,9 +214,10 @@ public:
#endif
protected:
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+ virtual void computePreferredLogicalWidths();
private:
- virtual const char* renderName() const { return isAnonymous() ? "RenderTableCell (anonymous)" : "RenderTableCell"; }
+ virtual const char* renderName() const { return (isAnonymous() || isPseudoElement()) ? "RenderTableCell (anonymous)" : "RenderTableCell"; }
virtual bool isTableCell() const { return true; }
@@ -276,13 +284,13 @@ private:
inline RenderTableCell* toRenderTableCell(RenderObject* object)
{
- ASSERT(!object || object->isTableCell());
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isTableCell());
return static_cast<RenderTableCell*>(object);
}
inline const RenderTableCell* toRenderTableCell(const RenderObject* object)
{
- ASSERT(!object || object->isTableCell());
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isTableCell());
return static_cast<const RenderTableCell*>(object);
}