diff options
Diffstat (limited to 'Source/WebCore/rendering/RenderTableCell.h')
| -rw-r--r-- | Source/WebCore/rendering/RenderTableCell.h | 26 |
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); } |
