Bug 1580346 - Initialize table-row and table-row-group borders to zero in border-collapse:separate tables. r=bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D45940

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mats Palmgren 2019-09-16 22:07:03 +00:00
Родитель 3b9cddf6d8
Коммит 9f0578ffbf
6 изменённых файлов: 226 добавлений и 18 удалений

Просмотреть файл

@ -2649,19 +2649,15 @@ LogicalMargin nsTableFrame::GetChildAreaOffset(
}
void nsTableFrame::InitChildReflowInput(ReflowInput& aReflowInput) {
nsMargin collapseBorder;
nsMargin padding(0, 0, 0, 0);
nsMargin* pCollapseBorder = nullptr;
nsPresContext* presContext = PresContext();
nsMargin border;
if (IsBorderCollapse()) {
nsTableRowGroupFrame* rgFrame =
static_cast<nsTableRowGroupFrame*>(aReflowInput.mFrame);
WritingMode wm = GetWritingMode();
LogicalMargin border = rgFrame->GetBCBorderWidth(wm);
collapseBorder = border.GetPhysicalMargin(wm);
pCollapseBorder = &collapseBorder;
border = rgFrame->GetBCBorderWidth(wm).GetPhysicalMargin(wm);
}
aReflowInput.Init(presContext, Nothing(), pCollapseBorder, &padding);
const nsMargin padding;
aReflowInput.Init(PresContext(), Nothing(), &border, &padding);
NS_ASSERTION(!mBits.mResizedColumns ||
!aReflowInput.mParentReflowInput->mFlags.mSpecialBSizeReflow,

Просмотреть файл

@ -304,19 +304,15 @@ void nsTableRowGroupFrame::PlaceChild(
void nsTableRowGroupFrame::InitChildReflowInput(nsPresContext& aPresContext,
bool aBorderCollapse,
ReflowInput& aReflowInput) {
nsMargin collapseBorder;
nsMargin padding(0, 0, 0, 0);
nsMargin* pCollapseBorder = nullptr;
if (aBorderCollapse) {
nsTableRowFrame* rowFrame = do_QueryFrame(aReflowInput.mFrame);
if (rowFrame) {
nsMargin border;
if (nsTableRowFrame* rowFrame = do_QueryFrame(aReflowInput.mFrame)) {
if (aBorderCollapse) {
WritingMode wm = GetWritingMode();
LogicalMargin border = rowFrame->GetBCBorderWidth(wm);
collapseBorder = border.GetPhysicalMargin(wm);
pCollapseBorder = &collapseBorder;
border = rowFrame->GetBCBorderWidth(wm).GetPhysicalMargin(wm);
}
}
aReflowInput.Init(&aPresContext, Nothing(), pCollapseBorder, &padding);
const nsMargin padding;
aReflowInput.Init(&aPresContext, Nothing(), &border, &padding);
}
static void CacheRowBSizesForPrinting(nsPresContext* aPresContext,

Просмотреть файл

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<title>Reference: table-row-group border/padding/margin has no effect in border-collapse:separate tables</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<style>
.ltr { direction:ltr; }
.rtl { direction:rtl; }
table, td {
border: 3px solid;
}
.bc table {
border-collapse: collapse;
}
.inherited td {
border: 3px dashed;
padding: 5px;
margin: 7px;
}
</style>
</head>
<body>
<table class="ltr"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody class="inherited"><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody class="inherited"><tr><td></td><td></td></tr></tbody></table>
<div class="bc">
<table class="rtl"><tbody><tr style="border: 20px solid"><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody><tr style="border: 20px solid"><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody class="inherited"><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody class="inherited"><tr><td></td><td></td></tr></tbody></table>
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Table test: table-row-group border/padding/margin has no effect in border-collapse:separate tables</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<link rel="help" href="https://www.w3.org/TR/CSS22/tables.html#separated-borders">
<link rel="match" href="row-group-margin-border-padding-ref.html">
<style>
.ltr { direction:ltr; }
.rtl { direction:rtl; }
table, td {
border: 3px solid;
}
.bc table {
border-collapse: collapse;
}
tbody.inherited {
border: 3px dashed;
padding: 5px;
margin: 7px;
}
.inherited * {
border:inherit;
padding:inherit;
margin:inherit;
}
</style>
</head>
<body>
<table class="ltr"><tbody style="border: 20px solid"><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody style="padding: 20px"><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody style="margin: 20px"><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody style="border: 20px solid"><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody style="padding: 20px"><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody style="margin: 20px"><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody class="inherited"><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody class="inherited"><tr><td></td><td></td></tr></tbody></table>
<!-- ditto with border-collapse:collapse -->
<div class="bc">
<table class="ltr"><tbody style="border: 20px solid"><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody style="padding: 20px"><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody style="margin: 20px"><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody style="border: 20px solid"><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody style="padding: 20px"><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody style="margin: 20px"><tr><td></td><td></td></tr></tbody></table>
<table class="ltr"><tbody class="inherited"><tr><td></td><td></td></tr></tbody></table>
<table class="rtl"><tbody class="inherited"><tr><td></td><td></td></tr></tbody></table>
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<title>Reference: table-row border/padding/margin has no effect in border-collapse:separate tables</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<style>
.ltr { direction:ltr; }
.rtl { direction:rtl; }
table, td {
border: 3px solid;
}
.bc table {
border-collapse: collapse;
}
.inherited > td {
border: 3px dashed;
padding: 5px;
margin: 7px;
}
</style>
</head>
<body>
<table class="ltr"><tr><td></td><td></td></tr></table>
<table class="ltr"><tr><td></td><td></td></tr></table>
<table class="ltr"><tr><td></td><td></td></tr></table>
<table class="rtl"><tr><td></td><td></td></tr></table>
<table class="rtl"><tr><td></td><td></td></tr></table>
<table class="rtl"><tr><td></td><td></td></tr></table>
<table class="ltr"><tr class="inherited"><td></td><td></td></tr></table>
<table class="rtl"><tr class="inherited"><td></td><td></td></tr></table>
<div class="bc">
<table class="rtl"><tr style="border: 20px solid"><td></td><td></td></tr></table>
<table class="rtl"><tr><td></td><td></td></tr></table>
<table class="rtl"><tr><td></td><td></td></tr></table>
<table class="ltr"><tr style="border: 20px solid"><td></td><td></td></tr></table>
<table class="ltr"><tr><td></td><td></td></tr></table>
<table class="ltr"><tr><td></td><td></td></tr></table>
<table class="rtl"><tr class="inherited"><td></td><td></td></tr></table>
<table class="ltr"><tr class="inherited"><td></td><td></td></tr></table>
</div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<title>CSS Table test: table-row border/padding/margin has no effect in border-collapse:separate tables</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<link rel="help" href="https://www.w3.org/TR/CSS22/tables.html#separated-borders">
<link rel="match" href="row-margin-border-padding-ref.html">
<style>
.ltr { direction:ltr; }
.rtl { direction:rtl; }
table, td {
border: 3px solid;
}
.bc table {
border-collapse: collapse;
}
tr.inherited {
border: 3px dashed;
padding: 5px;
margin: 7px;
}
.inherited > td {
border:inherit;
padding:inherit;
margin:inherit;
}
</style>
</head>
<body>
<table class="ltr"><tr style="border: 20px solid"><td></td><td></td></tr></table>
<table class="ltr"><tr style="padding: 20px"><td></td><td></td></tr></table>
<table class="ltr"><tr style="margin: 20px"><td></td><td></td></tr></table>
<table class="rtl"><tr style="border: 20px solid"><td></td><td></td></tr></table>
<table class="rtl"><tr style="padding: 20px"><td></td><td></td></tr></table>
<table class="rtl"><tr style="margin: 20px"><td></td><td></td></tr></table>
<table class="ltr"><tr class="inherited"><td></td><td></td></tr></table>
<table class="rtl"><tr class="inherited"><td></td><td></td></tr></table>
<!-- ditto with border-collapse:collapse -->
<div class="bc">
<table class="ltr"><tr style="border: 20px solid"><td></td><td></td></tr></table>
<table class="ltr"><tr style="padding: 20px"><td></td><td></td></tr></table>
<table class="ltr"><tr style="margin: 20px"><td></td><td></td></tr></table>
<table class="rtl"><tr style="border: 20px solid"><td></td><td></td></tr></table>
<table class="rtl"><tr style="padding: 20px"><td></td><td></td></tr></table>
<table class="rtl"><tr style="margin: 20px"><td></td><td></td></tr></table>
<table class="ltr"><tr class="inherited"><td></td><td></td></tr></table>
<table class="rtl"><tr class="inherited"><td></td><td></td></tr></table>
</div>
</body>
</html>