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) {
|
} else if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == mFrameType) {
|
||||||
// Internal table elements. The rules vary depending on the type.
|
// Internal table elements. The rules vary depending on the type.
|
||||||
// Calculate the computed width
|
// Calculate the computed width
|
||||||
|
PRBool rowOrRowGroup = PR_FALSE;
|
||||||
if ((NS_STYLE_DISPLAY_TABLE_ROW == mStyleDisplay->mDisplay) ||
|
if ((NS_STYLE_DISPLAY_TABLE_ROW == mStyleDisplay->mDisplay) ||
|
||||||
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP == mStyleDisplay->mDisplay)) {
|
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP == mStyleDisplay->mDisplay)) {
|
||||||
// 'width' property doesn't apply to table rows and row groups
|
// 'width' property doesn't apply to table rows and row groups
|
||||||
widthUnit = eStyleUnit_Auto;
|
widthUnit = eStyleUnit_Auto;
|
||||||
|
rowOrRowGroup = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eStyleUnit_Inherit == widthUnit) {
|
if (eStyleUnit_Inherit == widthUnit) {
|
||||||
@@ -1719,9 +1721,9 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
|
|||||||
} else if (eStyleUnit_Auto == widthUnit) {
|
} else if (eStyleUnit_Auto == widthUnit) {
|
||||||
mComputedWidth = availableWidth;
|
mComputedWidth = availableWidth;
|
||||||
|
|
||||||
if (mComputedWidth != NS_UNCONSTRAINEDSIZE) {
|
if ((mComputedWidth != NS_UNCONSTRAINEDSIZE) && !rowOrRowGroup){
|
||||||
// Internal table elements don't have margins, but they have border
|
// Internal table elements don't have margins. Only tables and
|
||||||
// and padding
|
// cells have border and padding
|
||||||
mComputedWidth -= mComputedBorderPadding.left +
|
mComputedWidth -= mComputedBorderPadding.left +
|
||||||
mComputedBorderPadding.right;
|
mComputedBorderPadding.right;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1708,10 +1708,12 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
|
|||||||
} else if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == mFrameType) {
|
} else if (NS_CSS_FRAME_TYPE_INTERNAL_TABLE == mFrameType) {
|
||||||
// Internal table elements. The rules vary depending on the type.
|
// Internal table elements. The rules vary depending on the type.
|
||||||
// Calculate the computed width
|
// Calculate the computed width
|
||||||
|
PRBool rowOrRowGroup = PR_FALSE;
|
||||||
if ((NS_STYLE_DISPLAY_TABLE_ROW == mStyleDisplay->mDisplay) ||
|
if ((NS_STYLE_DISPLAY_TABLE_ROW == mStyleDisplay->mDisplay) ||
|
||||||
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP == mStyleDisplay->mDisplay)) {
|
(NS_STYLE_DISPLAY_TABLE_ROW_GROUP == mStyleDisplay->mDisplay)) {
|
||||||
// 'width' property doesn't apply to table rows and row groups
|
// 'width' property doesn't apply to table rows and row groups
|
||||||
widthUnit = eStyleUnit_Auto;
|
widthUnit = eStyleUnit_Auto;
|
||||||
|
rowOrRowGroup = PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eStyleUnit_Inherit == widthUnit) {
|
if (eStyleUnit_Inherit == widthUnit) {
|
||||||
@@ -1719,9 +1721,9 @@ nsHTMLReflowState::InitConstraints(nsIPresContext* aPresContext,
|
|||||||
} else if (eStyleUnit_Auto == widthUnit) {
|
} else if (eStyleUnit_Auto == widthUnit) {
|
||||||
mComputedWidth = availableWidth;
|
mComputedWidth = availableWidth;
|
||||||
|
|
||||||
if (mComputedWidth != NS_UNCONSTRAINEDSIZE) {
|
if ((mComputedWidth != NS_UNCONSTRAINEDSIZE) && !rowOrRowGroup){
|
||||||
// Internal table elements don't have margins, but they have border
|
// Internal table elements don't have margins. Only tables and
|
||||||
// and padding
|
// cells have border and padding
|
||||||
mComputedWidth -= mComputedBorderPadding.left +
|
mComputedWidth -= mComputedBorderPadding.left +
|
||||||
mComputedBorderPadding.right;
|
mComputedBorderPadding.right;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -937,6 +937,10 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
|
|||||||
nsTableFrame* aTableFrame)
|
nsTableFrame* aTableFrame)
|
||||||
{
|
{
|
||||||
//adjust the border style based on the table rules attribute
|
//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;
|
const nsStyleTable* tableStyle;
|
||||||
aTableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
|
aTableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
|
||||||
|
|
||||||
@@ -964,6 +968,7 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
|
|||||||
// "GROUPS" will be handled in nsTableFrame::ProcessGroupRules
|
// "GROUPS" will be handled in nsTableFrame::ProcessGroupRules
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4034,9 +4034,11 @@ void nsTableFrame::GetTableBorderForRowGroup(nsTableRowGroupFrame* aRowGroupFram
|
|||||||
|
|
||||||
PRUint8 nsTableFrame::GetBorderCollapseStyle()
|
PRUint8 nsTableFrame::GetBorderCollapseStyle()
|
||||||
{
|
{
|
||||||
|
/* the following has been commented out to turn off collapsing borders
|
||||||
const nsStyleTable* tableStyle;
|
const nsStyleTable* tableStyle;
|
||||||
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)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)
|
nsTableFrame* aTableFrame)
|
||||||
{
|
{
|
||||||
//adjust the border style based on the table rules attribute
|
//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;
|
const nsStyleTable* tableStyle;
|
||||||
aTableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
|
aTableFrame->GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle);
|
||||||
|
|
||||||
@@ -964,6 +968,7 @@ void nsTableCellFrame::MapHTMLBorderStyle(nsIPresContext* aPresContext,
|
|||||||
// "GROUPS" will be handled in nsTableFrame::ProcessGroupRules
|
// "GROUPS" will be handled in nsTableFrame::ProcessGroupRules
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4034,9 +4034,11 @@ void nsTableFrame::GetTableBorderForRowGroup(nsTableRowGroupFrame* aRowGroupFram
|
|||||||
|
|
||||||
PRUint8 nsTableFrame::GetBorderCollapseStyle()
|
PRUint8 nsTableFrame::GetBorderCollapseStyle()
|
||||||
{
|
{
|
||||||
|
/* the following has been commented out to turn off collapsing borders
|
||||||
const nsStyleTable* tableStyle;
|
const nsStyleTable* tableStyle;
|
||||||
GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)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