[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
hyatt at apple.com
hyatt at apple.com
Wed Dec 22 13:36:13 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit d76152ffcc235c8dae50aac9a7032a7272e947a1
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 21 07:45:08 2010 +0000
https://bugs.webkit.org/show_bug.cgi?id=46125, convert table cell intrinsic padding from top/bottom-based
to before/after-based. A vertical text table can have intrinsic padding built into the left/right
direction (and this allows the base class logical padding methods on RenderBoxModelObject to be safe to use).
Reviewed by Dan Bernstein.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::RenderTableCell):
(WebCore::RenderTableCell::paddingTop):
(WebCore::RenderTableCell::paddingBottom):
(WebCore::RenderTableCell::paddingLeft):
(WebCore::RenderTableCell::paddingRight):
(WebCore::RenderTableCell::paddingBefore):
(WebCore::RenderTableCell::paddingAfter):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::setIntrinsicPaddingBefore):
(WebCore::RenderTableCell::setIntrinsicPaddingAfter):
(WebCore::RenderTableCell::setIntrinsicPadding):
(WebCore::RenderTableCell::intrinsicPaddingBefore):
(WebCore::RenderTableCell::intrinsicPaddingAfter):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowHeight):
(WebCore::RenderTableSection::layoutRows):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::writeTextRun):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7f16a3b..618fdfc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,32 @@
+2010-09-21 David Hyatt <hyatt at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46125, convert table cell intrinsic padding from top/bottom-based
+ to before/after-based. A vertical text table can have intrinsic padding built into the left/right
+ direction (and this allows the base class logical padding methods on RenderBoxModelObject to be safe to use).
+
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::RenderTableCell):
+ (WebCore::RenderTableCell::paddingTop):
+ (WebCore::RenderTableCell::paddingBottom):
+ (WebCore::RenderTableCell::paddingLeft):
+ (WebCore::RenderTableCell::paddingRight):
+ (WebCore::RenderTableCell::paddingBefore):
+ (WebCore::RenderTableCell::paddingAfter):
+ * rendering/RenderTableCell.h:
+ (WebCore::RenderTableCell::setIntrinsicPaddingBefore):
+ (WebCore::RenderTableCell::setIntrinsicPaddingAfter):
+ (WebCore::RenderTableCell::setIntrinsicPadding):
+ (WebCore::RenderTableCell::intrinsicPaddingBefore):
+ (WebCore::RenderTableCell::intrinsicPaddingAfter):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::calcRowHeight):
+ (WebCore::RenderTableSection::layoutRows):
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::RenderTreeAsText::writeRenderObject):
+ (WebCore::writeTextRun):
+
2010-09-21 Dirk Schulze <krit at webkit.org>
Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/rendering/RenderTableCell.cpp b/WebCore/rendering/RenderTableCell.cpp
index 9c3fc33..853dba6 100644
--- a/WebCore/rendering/RenderTableCell.cpp
+++ b/WebCore/rendering/RenderTableCell.cpp
@@ -45,8 +45,8 @@ RenderTableCell::RenderTableCell(Node* node)
, m_column(-1)
, m_rowSpan(1)
, m_columnSpan(1)
- , m_intrinsicPaddingTop(0)
- , m_intrinsicPaddingBottom(0)
+ , m_intrinsicPaddingBefore(0)
+ , m_intrinsicPaddingAfter(0)
, m_percentageHeight(0)
{
updateFromElement();
@@ -164,12 +164,51 @@ void RenderTableCell::layout()
int RenderTableCell::paddingTop(bool includeIntrinsicPadding) const
{
- return RenderBlock::paddingTop() + (includeIntrinsicPadding ? intrinsicPaddingTop() : 0);
+ int result = RenderBlock::paddingTop();
+ if (!includeIntrinsicPadding || !style()->isVerticalBlockFlow())
+ return result;
+ return result + (style()->blockFlow() == TopToBottomBlockFlow ? intrinsicPaddingBefore() : intrinsicPaddingAfter());
}
int RenderTableCell::paddingBottom(bool includeIntrinsicPadding) const
{
- return RenderBlock::paddingBottom() + (includeIntrinsicPadding ? intrinsicPaddingBottom() : 0);
+ int result = RenderBlock::paddingBottom();
+ if (!includeIntrinsicPadding || !style()->isVerticalBlockFlow())
+ return result;
+ return result + (style()->blockFlow() == TopToBottomBlockFlow ? intrinsicPaddingAfter() : intrinsicPaddingBefore());
+}
+
+int RenderTableCell::paddingLeft(bool includeIntrinsicPadding) const
+{
+ int result = RenderBlock::paddingLeft();
+ if (!includeIntrinsicPadding || style()->isVerticalBlockFlow())
+ return result;
+ return result + (style()->blockFlow() == LeftToRightBlockFlow ? intrinsicPaddingBefore() : intrinsicPaddingAfter());
+
+}
+
+int RenderTableCell::paddingRight(bool includeIntrinsicPadding) const
+{
+ int result = RenderBlock::paddingRight();
+ if (!includeIntrinsicPadding || style()->isVerticalBlockFlow())
+ return result;
+ return result + (style()->blockFlow() == LeftToRightBlockFlow ? intrinsicPaddingAfter() : intrinsicPaddingBefore());
+}
+
+int RenderTableCell::paddingBefore(bool includeIntrinsicPadding) const
+{
+ int result = RenderBlock::paddingBefore();
+ if (!includeIntrinsicPadding)
+ return result;
+ return result + intrinsicPaddingBefore();
+}
+
+int RenderTableCell::paddingAfter(bool includeIntrinsicPadding) const
+{
+ int result = RenderBlock::paddingAfter();
+ if (!includeIntrinsicPadding)
+ return result;
+ return result + intrinsicPaddingAfter();
}
void RenderTableCell::setOverrideSize(int size)
diff --git a/WebCore/rendering/RenderTableCell.h b/WebCore/rendering/RenderTableCell.h
index b6622f4..c498ab4 100644
--- a/WebCore/rendering/RenderTableCell.h
+++ b/WebCore/rendering/RenderTableCell.h
@@ -86,16 +86,24 @@ public:
virtual int baselinePosition(bool firstLine = false, bool isRootLineBox = false) const;
- void setIntrinsicPaddingTop(int p) { m_intrinsicPaddingTop = p; }
- void setIntrinsicPaddingBottom(int p) { m_intrinsicPaddingBottom = p; }
- void setIntrinsicPadding(int top, int bottom) { setIntrinsicPaddingTop(top); setIntrinsicPaddingBottom(bottom); }
+ void setIntrinsicPaddingBefore(int p) { m_intrinsicPaddingBefore = p; }
+ void setIntrinsicPaddingAfter(int p) { m_intrinsicPaddingAfter = p; }
+ void setIntrinsicPadding(int before, int after) { setIntrinsicPaddingBefore(before); setIntrinsicPaddingAfter(after); }
void clearIntrinsicPadding() { setIntrinsicPadding(0, 0); }
- int intrinsicPaddingTop() const { return m_intrinsicPaddingTop; }
- int intrinsicPaddingBottom() const { return m_intrinsicPaddingBottom; }
+ int intrinsicPaddingBefore() const { return m_intrinsicPaddingBefore; }
+ int intrinsicPaddingAfter() const { return m_intrinsicPaddingAfter; }
virtual int paddingTop(bool includeIntrinsicPadding = true) const;
virtual int paddingBottom(bool includeIntrinsicPadding = true) const;
+ virtual int paddingLeft(bool includeIntrinsicPadding = true) const;
+ virtual int paddingRight(bool includeIntrinsicPadding = true) const;
+
+ // FIXME: For now we just assume the cell has the same block flow direction as the table. It's likely we'll
+ // create an extra anonymous RenderBlock to handle mixing directionality anyway, in which case we can lock
+ // the block flow directionality of the cells to the table's directionality.
+ virtual int paddingBefore(bool includeIntrinsicPadding = true) const;
+ virtual int paddingAfter(bool includeIntrinsicPadding = true) const;
virtual void setOverrideSize(int);
@@ -129,8 +137,8 @@ private:
int m_column;
int m_rowSpan;
int m_columnSpan;
- int m_intrinsicPaddingTop;
- int m_intrinsicPaddingBottom;
+ int m_intrinsicPaddingBefore;
+ int m_intrinsicPaddingAfter;
int m_percentageHeight;
};
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index 72338b7..cc9fc5c 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -342,9 +342,9 @@ int RenderTableSection::calcRowHeight()
cell->layoutIfNeeded();
}
- int adjustedPaddingTop = cell->paddingTop() - cell->intrinsicPaddingTop();
- int adjustedPaddingBottom = cell->paddingBottom() - cell->intrinsicPaddingBottom();
- int adjustedHeight = cell->height() - (cell->intrinsicPaddingTop() + cell->intrinsicPaddingBottom());
+ int adjustedPaddingTop = cell->paddingTop() - cell->intrinsicPaddingBefore();
+ int adjustedPaddingBottom = cell->paddingBottom() - cell->intrinsicPaddingAfter();
+ int adjustedHeight = cell->height() - (cell->intrinsicPaddingBefore() + cell->intrinsicPaddingAfter());
// Explicit heights use the border box in quirks mode. In strict mode do the right
// thing and actually add in the border and padding.
@@ -362,8 +362,8 @@ int RenderTableSection::calcRowHeight()
if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB) {
int b = cell->baselinePosition();
if (b > cell->borderTop() + cell->paddingTop()) {
- baseline = max(baseline, b - cell->intrinsicPaddingTop());
- bdesc = max(bdesc, m_rowPos[indx] + ch - (b - cell->intrinsicPaddingTop()));
+ baseline = max(baseline, b - cell->intrinsicPaddingBefore());
+ bdesc = max(bdesc, m_rowPos[indx] + ch - (b - cell->intrinsicPaddingBefore()));
}
}
}
@@ -570,8 +570,8 @@ int RenderTableSection::layoutRows(int toAdd)
}
}
- int oldTe = cell->intrinsicPaddingTop();
- int oldBe = cell->intrinsicPaddingBottom();
+ int oldTe = cell->intrinsicPaddingBefore();
+ int oldBe = cell->intrinsicPaddingAfter();
int heightWithoutIntrinsicPadding = cell->height() - oldTe - oldBe;
int te = 0;
@@ -600,8 +600,8 @@ int RenderTableSection::layoutRows(int toAdd)
}
int be = rHeight - heightWithoutIntrinsicPadding - te;
- cell->setIntrinsicPaddingTop(te);
- cell->setIntrinsicPaddingBottom(be);
+ cell->setIntrinsicPaddingBefore(te);
+ cell->setIntrinsicPaddingAfter(be);
IntRect oldCellRect(cell->x(), cell->y() , cell->width(), cell->height());
diff --git a/WebCore/rendering/RenderTreeAsText.cpp b/WebCore/rendering/RenderTreeAsText.cpp
index be1e8d0..16dc7bf 100644
--- a/WebCore/rendering/RenderTreeAsText.cpp
+++ b/WebCore/rendering/RenderTreeAsText.cpp
@@ -262,13 +262,13 @@ void RenderTreeAsText::writeRenderObject(TextStream& ts, const RenderObject& o,
// to clean up the results to dump both the outer box and the intrinsic padding so that both bits of information are
// captured by the results.
const RenderTableCell& cell = *toRenderTableCell(&o);
- r = IntRect(cell.x(), cell.y() + cell.intrinsicPaddingTop(), cell.width(), cell.height() - cell.intrinsicPaddingTop() - cell.intrinsicPaddingBottom());
+ r = IntRect(cell.x(), cell.y() + cell.intrinsicPaddingBefore(), cell.width(), cell.height() - cell.intrinsicPaddingBefore() - cell.intrinsicPaddingAfter());
} else if (o.isBox())
r = toRenderBox(&o)->frameRect();
// FIXME: Temporary in order to ensure compatibility with existing layout test results.
if (adjustForTableCells)
- r.move(0, -toRenderTableCell(o.containingBlock())->intrinsicPaddingTop());
+ r.move(0, -toRenderTableCell(o.containingBlock())->intrinsicPaddingBefore());
ts << " " << r;
@@ -437,7 +437,7 @@ static void writeTextRun(TextStream& ts, const RenderText& o, const InlineTextBo
// FIXME: Table cell adjustment is temporary until results can be updated.
int y = run.m_y;
if (o.containingBlock()->isTableCell())
- y -= toRenderTableCell(o.containingBlock())->intrinsicPaddingTop();
+ y -= toRenderTableCell(o.containingBlock())->intrinsicPaddingBefore();
ts << "text run at (" << run.m_x << "," << y << ") width " << run.m_width;
if (run.direction() == RTL || run.m_dirOverride) {
ts << (run.direction() == RTL ? " RTL" : " LTR");
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list