bug 49490 - turn off collapsing borders, rules. Fix reflow state to not account for vertical borders or padding on rows. a=buster, r=dcone.
This commit is contained in:
@@ -1708,10 +1708,12 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
|
||||
} else if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == mFrameType) {
|
||||
// Internal table elements. The rules vary depending on the type.
|
||||
// Calculate the computed width
|
||||
PRBool rowOrRowGroup = PR_FALSE;
|
||||
if ((NS_STYLE_DISPLAY_TABLE_ROW == mStyleDisplay->mDisplay) ||
|
||||
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP == mStyleDisplay->mDisplay)) {
|
||||
// 'width' property doesn't apply to table rows and row groups
|
||||
widthUnit = eStyleUnit_Auto;
|
||||
rowOrRowGroup = PR_TRUE;
|
||||
}
|
||||
|
||||
if (eStyleUnit_Inherit == widthUnit) {
|
||||
@@ -1719,9 +1721,9 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
|
||||
} else if (eStyleUnit_Auto == widthUnit) {
|
||||
mComputedWidth = availableWidth;
|
||||
|
||||
if (mComputedWidth != NS_UNCONSTRAINEDSIZE) {
|
||||
// Internal table elements don't have margins, but they have border
|
||||
// and padding
|
||||
if ((mComputedWidth != NS_UNCONSTRAINEDSIZE) && !rowOrRowGroup){
|
||||
// Internal table elements don't have margins. Only tables and
|
||||
// cells have border and padding
|
||||
mComputedWidth -= mComputedBorderPadding.left +
|
||||
mComputedBorderPadding.right;
|
||||
}
|
||||
|
||||
@@ -1708,10 +1708,12 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
|
||||
} else if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == mFrameType) {
|
||||
// Internal table elements. The rules vary depending on the type.
|
||||
// Calculate the computed width
|
||||
PRBool rowOrRowGroup = PR_FALSE;
|
||||
if ((NS_STYLE_DISPLAY_TABLE_ROW == mStyleDisplay->mDisplay) ||
|
||||
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP == mStyleDisplay->mDisplay)) {
|
||||
// 'width' property doesn't apply to table rows and row groups
|
||||
widthUnit = eStyleUnit_Auto;
|
||||
rowOrRowGroup = PR_TRUE;
|
||||
}
|
||||
|
||||
if (eStyleUnit_Inherit == widthUnit) {
|
||||
@@ -1719,9 +1721,9 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
|
||||
} else if (eStyleUnit_Auto == widthUnit) {
|
||||
mComputedWidth = availableWidth;
|
||||
|
||||
if (mComputedWidth != NS_UNCONSTRAINEDSIZE) {
|
||||
// Internal table elements don't have margins, but they have border
|
||||
// and padding
|
||||
if ((mComputedWidth != NS_UNCONSTRAINEDSIZE) && !rowOrRowGroup){
|
||||
// Internal table elements don't have margins. Only tables and
|
||||
// cells have border and padding
|
||||
mComputedWidth -= mComputedBorderPadding.left +
|
||||
mComputedBorderPadding.right;
|
||||
}
|
||||
|
||||
@@ -937,6 +937,10 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
|
||||
nsTableFrame* aTableFrame)
|
||||
{
|
||||
//adjust the border style based on the table rules attribute
|
||||
|
||||
/* The RULES code below has been disabled because collapsing borders have been disabled
|
||||
and RULES depend on collapsing borders
|
||||
|
||||
const nsStyleTable* tableStyle;
|
||||
aTableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
|
||||
|
||||
@@ -964,6 +968,7 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
|
||||
// "GROUPS" will be handled in nsTableFrame::ProcessGroupRules
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4034,9 +4034,11 @@ void nsTableFrame::GetTableBorderForRowGroup(nsTableRowGroupFrame* aRowGroupFram
|
||||
|
||||
PRUint8 nsTableFrame::GetBorderCollapseStyle()
|
||||
{
|
||||
/* the following has been commented out to turn off collapsing borders
|
||||
const nsStyleTable* tableStyle;
|
||||
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
|
||||
return tableStyle->mBorderCollapse;
|
||||
return tableStyle->mBorderCollapse;*/
|
||||
return NS_STYLE_BORDER_SEPARATE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -937,6 +937,10 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
|
||||
nsTableFrame* aTableFrame)
|
||||
{
|
||||
//adjust the border style based on the table rules attribute
|
||||
|
||||
/* The RULES code below has been disabled because collapsing borders have been disabled
|
||||
and RULES depend on collapsing borders
|
||||
|
||||
const nsStyleTable* tableStyle;
|
||||
aTableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
|
||||
|
||||
@@ -964,6 +968,7 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
|
||||
// "GROUPS" will be handled in nsTableFrame::ProcessGroupRules
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4034,9 +4034,11 @@ void nsTableFrame::GetTableBorderForRowGroup(nsTableRowGroupFrame* aRowGroupFram
|
||||
|
||||
PRUint8 nsTableFrame::GetBorderCollapseStyle()
|
||||
{
|
||||
/* the following has been commented out to turn off collapsing borders
|
||||
const nsStyleTable* tableStyle;
|
||||
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
|
||||
return tableStyle->mBorderCollapse;
|
||||
return tableStyle->mBorderCollapse;*/
|
||||
return NS_STYLE_BORDER_SEPARATE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user