Diff
Modified: trunk/Source/WebCore/ChangeLog (163170 => 163171)
--- trunk/Source/WebCore/ChangeLog 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/ChangeLog 2014-01-31 16:48:55 UTC (rev 163171)
@@ -1,3 +1,45 @@
+2014-01-31 Zalan Bujtas <[email protected]>
+
+ Subpixel rendering: Change RenderBoxModelObject's border functions' signature to support subpixel border painting.
+ https://bugs.webkit.org/show_bug.cgi?id=127975
+
+ Reviewed by Simon Fraser.
+
+ From int to LayoutUnit.
+
+ Covered by existing tests. No change in functionality.
+
+ * platform/text/TextStream.cpp:
+ (WebCore::TextStream::operator<<):
+ * platform/text/TextStream.h:
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+ * rendering/RenderBoxModelObject.h:
+ (WebCore::RenderBoxModelObject::borderTop):
+ (WebCore::RenderBoxModelObject::borderBottom):
+ (WebCore::RenderBoxModelObject::borderLeft):
+ (WebCore::RenderBoxModelObject::borderRight):
+ (WebCore::RenderBoxModelObject::borderBefore):
+ (WebCore::RenderBoxModelObject::borderAfter):
+ (WebCore::RenderBoxModelObject::borderStart):
+ (WebCore::RenderBoxModelObject::borderEnd):
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::borderBefore):
+ (WebCore::RenderTable::borderAfter):
+ * rendering/RenderTable.h:
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::borderLeft):
+ (WebCore::RenderTableCell::borderRight):
+ (WebCore::RenderTableCell::borderTop):
+ (WebCore::RenderTableCell::borderBottom):
+ (WebCore::RenderTableCell::borderStart):
+ (WebCore::RenderTableCell::borderEnd):
+ (WebCore::RenderTableCell::borderBefore):
+ (WebCore::RenderTableCell::borderAfter):
+ * rendering/RenderTableCell.h:
+
2014-01-31 Brady Eidson <[email protected]>
IDB: Index writing
Modified: trunk/Source/WebCore/platform/text/TextStream.cpp (163170 => 163171)
--- trunk/Source/WebCore/platform/text/TextStream.cpp 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/platform/text/TextStream.cpp 2014-01-31 16:48:55 UTC (rev 163171)
@@ -31,6 +31,7 @@
#include "IntPoint.h"
#include "IntRect.h"
#include "LayoutRect.h"
+#include "LayoutUnit.h"
#include <wtf/MathExtras.h>
#include <wtf/StringExtras.h>
#include <wtf/text/WTFString.h>
@@ -150,6 +151,11 @@
<< " height=" << TextStream::FormatNumberRespectingIntegers(s.height());
}
+TextStream& TextStream::operator<<(const LayoutUnit& v)
+{
+ return *this << TextStream::FormatNumberRespectingIntegers(v.toFloat());
+}
+
TextStream& TextStream::operator<<(const LayoutPoint& p)
{
// FIXME: These should be printed as floats. Keeping them ints for consistency with pervious test expectations.
Modified: trunk/Source/WebCore/platform/text/TextStream.h (163170 => 163171)
--- trunk/Source/WebCore/platform/text/TextStream.h 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/platform/text/TextStream.h 2014-01-31 16:48:55 UTC (rev 163171)
@@ -38,6 +38,7 @@
class FloatSize;
class LayoutPoint;
class LayoutRect;
+class LayoutUnit;
class TextStream {
public:
@@ -64,6 +65,7 @@
TextStream& operator<<(const IntRect&);
TextStream& operator<<(const FloatPoint&);
TextStream& operator<<(const FloatSize&);
+ TextStream& operator<<(const LayoutUnit&);
TextStream& operator<<(const LayoutPoint&);
TextStream& operator<<(const LayoutRect&);
Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (163170 => 163171)
--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp 2014-01-31 16:48:55 UTC (rev 163171)
@@ -676,8 +676,8 @@
clipRoundedInnerRect(context, rect, border);
}
- int bLeft = includeLeftEdge ? borderLeft() : 0;
- int bRight = includeRightEdge ? borderRight() : 0;
+ LayoutUnit bLeft = includeLeftEdge ? borderLeft() : LayoutUnit::fromPixel(0);
+ LayoutUnit bRight = includeRightEdge ? borderRight() : LayoutUnit::fromPixel(0);
LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : LayoutUnit();
LayoutUnit pRight = includeRightEdge ? paddingRight() : LayoutUnit();
Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.h (163170 => 163171)
--- trunk/Source/WebCore/rendering/RenderBoxModelObject.h 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.h 2014-01-31 16:48:55 UTC (rev 163171)
@@ -113,14 +113,14 @@
virtual LayoutUnit paddingStart() const { return computedCSSPaddingStart(); }
virtual LayoutUnit paddingEnd() const { return computedCSSPaddingEnd(); }
- virtual int borderTop() const { return style().borderTopWidth(); }
- virtual int borderBottom() const { return style().borderBottomWidth(); }
- virtual int borderLeft() const { return style().borderLeftWidth(); }
- virtual int borderRight() const { return style().borderRightWidth(); }
- virtual int borderBefore() const { return style().borderBeforeWidth(); }
- virtual int borderAfter() const { return style().borderAfterWidth(); }
- virtual int borderStart() const { return style().borderStartWidth(); }
- virtual int borderEnd() const { return style().borderEndWidth(); }
+ virtual LayoutUnit borderTop() const { return style().borderTopWidth(); }
+ virtual LayoutUnit borderBottom() const { return style().borderBottomWidth(); }
+ virtual LayoutUnit borderLeft() const { return style().borderLeftWidth(); }
+ virtual LayoutUnit borderRight() const { return style().borderRightWidth(); }
+ virtual LayoutUnit borderBefore() const { return style().borderBeforeWidth(); }
+ virtual LayoutUnit borderAfter() const { return style().borderAfterWidth(); }
+ virtual LayoutUnit borderStart() const { return style().borderStartWidth(); }
+ virtual LayoutUnit borderEnd() const { return style().borderEndWidth(); }
LayoutUnit borderAndPaddingStart() const { return borderStart() + paddingStart(); }
LayoutUnit borderAndPaddingBefore() const { return borderBefore() + paddingBefore(); }
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (163170 => 163171)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2014-01-31 16:48:55 UTC (rev 163171)
@@ -1226,7 +1226,7 @@
LayoutUnit shadowLeft;
LayoutUnit shadowRight;
style().getBoxShadowHorizontalExtent(shadowLeft, shadowRight);
- int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0;
+ int borderRight = isBox() ? toRenderBox(this)->borderRight() : LayoutUnit::fromPixel(0);
LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit();
LayoutUnit minInsetRightShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.right(), std::min<LayoutUnit>(newBounds.width(), oldBounds.width()));
LayoutUnit borderWidth = std::max<LayoutUnit>(borderRight, std::max<LayoutUnit>(valueForLength(style().borderTopRightRadius().width(), boxWidth, &view()), valueForLength(style().borderBottomRightRadius().width(), boxWidth)));
@@ -1246,7 +1246,7 @@
LayoutUnit shadowTop;
LayoutUnit shadowBottom;
style().getBoxShadowVerticalExtent(shadowTop, shadowBottom);
- int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0;
+ int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : LayoutUnit::fromPixel(0);
LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUnit();
LayoutUnit minInsetBottomShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.bottom(), std::min<LayoutUnit>(newBounds.height(), oldBounds.height()));
LayoutUnit borderHeight = std::max<LayoutUnit>(borderBottom, std::max<LayoutUnit>(valueForLength(style().borderBottomLeftRadius().height(), boxHeight), valueForLength(style().borderBottomRightRadius().height(), boxHeight, &view())));
Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (163170 => 163171)
--- trunk/Source/WebCore/rendering/RenderTable.cpp 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp 2014-01-31 16:48:55 UTC (rev 163171)
@@ -1073,7 +1073,7 @@
m_borderEnd = calcBorderEnd();
}
-int RenderTable::borderBefore() const
+LayoutUnit RenderTable::borderBefore() const
{
if (collapseBorders()) {
recalcSectionsIfNeeded();
@@ -1082,7 +1082,7 @@
return RenderBlock::borderBefore();
}
-int RenderTable::borderAfter() const
+LayoutUnit RenderTable::borderAfter() const
{
if (collapseBorders()) {
recalcSectionsIfNeeded();
Modified: trunk/Source/WebCore/rendering/RenderTable.h (163170 => 163171)
--- trunk/Source/WebCore/rendering/RenderTable.h 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/rendering/RenderTable.h 2014-01-31 16:48:55 UTC (rev 163171)
@@ -53,33 +53,33 @@
bool collapseBorders() const { return style().borderCollapse(); }
- virtual int borderStart() const override { return m_borderStart; }
- virtual int borderEnd() const override { return m_borderEnd; }
- virtual int borderBefore() const override;
- virtual int borderAfter() const override;
+ virtual LayoutUnit borderStart() const override { return m_borderStart; }
+ virtual LayoutUnit borderEnd() const override { return m_borderEnd; }
+ virtual LayoutUnit borderBefore() const override;
+ virtual LayoutUnit borderAfter() const override;
- virtual int borderLeft() const override
+ virtual LayoutUnit borderLeft() const override
{
if (style().isHorizontalWritingMode())
return style().isLeftToRightDirection() ? borderStart() : borderEnd();
return style().isFlippedBlocksWritingMode() ? borderAfter() : borderBefore();
}
- virtual int borderRight() const override
+ virtual LayoutUnit borderRight() const override
{
if (style().isHorizontalWritingMode())
return style().isLeftToRightDirection() ? borderEnd() : borderStart();
return style().isFlippedBlocksWritingMode() ? borderBefore() : borderAfter();
}
- virtual int borderTop() const override
+ virtual LayoutUnit borderTop() const override
{
if (style().isHorizontalWritingMode())
return style().isFlippedBlocksWritingMode() ? borderAfter() : borderBefore();
return style().isLeftToRightDirection() ? borderStart() : borderEnd();
}
- virtual int borderBottom() const override
+ virtual LayoutUnit borderBottom() const override
{
if (style().isHorizontalWritingMode())
return style().isFlippedBlocksWritingMode() ? borderBefore() : borderAfter();
Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (163170 => 163171)
--- trunk/Source/WebCore/rendering/RenderTableCell.cpp 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp 2014-01-31 16:48:55 UTC (rev 163171)
@@ -930,46 +930,46 @@
return styleForCellFlow->isLeftToRightDirection() ? table()->cellAfter(this) : table()->cellBefore(this);
}
-int RenderTableCell::borderLeft() const
+LayoutUnit RenderTableCell::borderLeft() const
{
- return table()->collapseBorders() ? borderHalfLeft(false) : RenderBlockFlow::borderLeft();
+ return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfLeft(false)) : RenderBlockFlow::borderLeft();
}
-int RenderTableCell::borderRight() const
+LayoutUnit RenderTableCell::borderRight() const
{
- return table()->collapseBorders() ? borderHalfRight(false) : RenderBlockFlow::borderRight();
+ return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfRight(false)) : RenderBlockFlow::borderRight();
}
-int RenderTableCell::borderTop() const
+LayoutUnit RenderTableCell::borderTop() const
{
- return table()->collapseBorders() ? borderHalfTop(false) : RenderBlockFlow::borderTop();
+ return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfTop(false)) : RenderBlockFlow::borderTop();
}
-int RenderTableCell::borderBottom() const
+LayoutUnit RenderTableCell::borderBottom() const
{
- return table()->collapseBorders() ? borderHalfBottom(false) : RenderBlockFlow::borderBottom();
+ return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfBottom(false)) : RenderBlockFlow::borderBottom();
}
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=46191, make the collapsed border drawing
// work with different block flow values instead of being hard-coded to top-to-bottom.
-int RenderTableCell::borderStart() const
+LayoutUnit RenderTableCell::borderStart() const
{
- return table()->collapseBorders() ? borderHalfStart(false) : RenderBlockFlow::borderStart();
+ return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfStart(false)) : RenderBlockFlow::borderStart();
}
-int RenderTableCell::borderEnd() const
+LayoutUnit RenderTableCell::borderEnd() const
{
- return table()->collapseBorders() ? borderHalfEnd(false) : RenderBlockFlow::borderEnd();
+ return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfEnd(false)) : RenderBlockFlow::borderEnd();
}
-int RenderTableCell::borderBefore() const
+LayoutUnit RenderTableCell::borderBefore() const
{
- return table()->collapseBorders() ? borderHalfBefore(false) : RenderBlockFlow::borderBefore();
+ return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfBefore(false)) : RenderBlockFlow::borderBefore();
}
-int RenderTableCell::borderAfter() const
+LayoutUnit RenderTableCell::borderAfter() const
{
- return table()->collapseBorders() ? borderHalfAfter(false) : RenderBlockFlow::borderAfter();
+ return table()->collapseBorders() ? LayoutUnit::fromPixel(borderHalfAfter(false)) : RenderBlockFlow::borderAfter();
}
int RenderTableCell::borderHalfLeft(bool outer) const
Modified: trunk/Source/WebCore/rendering/RenderTableCell.h (163170 => 163171)
--- trunk/Source/WebCore/rendering/RenderTableCell.h 2014-01-31 15:55:28 UTC (rev 163170)
+++ trunk/Source/WebCore/rendering/RenderTableCell.h 2014-01-31 16:48:55 UTC (rev 163171)
@@ -103,21 +103,21 @@
// 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()).floor() + borderBefore() + borderAfter();
+ styleLogicalHeight += (computedCSSPaddingBefore() + computedCSSPaddingAfter()).floor() + (borderBefore() + borderAfter()).floor();
return std::max(styleLogicalHeight, adjustedLogicalHeight);
}
void setCellLogicalWidth(int constrainedLogicalWidth);
- virtual int borderLeft() const override;
- virtual int borderRight() const override;
- virtual int borderTop() const override;
- virtual int borderBottom() const override;
- virtual int borderStart() const override;
- virtual int borderEnd() const override;
- virtual int borderBefore() const override;
- virtual int borderAfter() const override;
+ virtual LayoutUnit borderLeft() const override;
+ virtual LayoutUnit borderRight() const override;
+ virtual LayoutUnit borderTop() const override;
+ virtual LayoutUnit borderBottom() const override;
+ virtual LayoutUnit borderStart() const override;
+ virtual LayoutUnit borderEnd() const override;
+ virtual LayoutUnit borderBefore() const override;
+ virtual LayoutUnit borderAfter() const override;
void collectBorderValues(RenderTable::CollapsedBorderValues&) const;
static void sortBorderValues(RenderTable::CollapsedBorderValues&);