From 5dc34b1d471372fabed437647ec51309aec87ee0 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 7 Jul 2005 17:14:36 +0000 Subject: [PATCH] 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 --- .../content/html/content/src/nsHTMLTableElement.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mozilla/content/html/content/src/nsHTMLTableElement.cpp b/mozilla/content/html/content/src/nsHTMLTableElement.cpp index a2de6e0fba8..d5608192e8c 100644 --- a/mozilla/content/html/content/src/nsHTMLTableElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableElement.cpp @@ -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())) {