Fix rules="none" regression for tables. Bug 299723, r+sr=dbaron, a=asa

git-svn-id: svn://10.0.0.236/trunk@175762 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2005-07-07 17:14:36 +00:00
parent d3b1540fe2
commit 5dc34b1d47

View File

@@ -1208,10 +1208,15 @@ MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay();
if (readDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
if (NS_STYLE_BORDER_SEPARATE == tableStyle->mBorderCollapse) {
// Set the cell's border from the table in the separate border model. If there is a border
// on the table, then the mapping to rules=all will take care of borders in the collapsing model.
// Set the cell's border from the table in the separate border
// model. If there is a border on the table, then the mapping to
// rules=all will take care of borders in the collapsing model.
// But if rules="none", we don't want to do this.
const nsAttrValue* value = aAttributes->GetAttr(nsHTMLAtoms::border);
if (value &&
const nsAttrValue* rulesValue = aAttributes->GetAttr(nsHTMLAtoms::rules);
if ((!rulesValue || rulesValue->Type() != nsAttrValue::eEnum ||
rulesValue->GetEnumValue() != NS_STYLE_TABLE_RULES_NONE) &&
value &&
((value->Type() == nsAttrValue::eInteger &&
value->GetIntegerValue() > 0) ||
value->IsEmptyString())) {