From 4ed0ab46048116d50db57752a85ce4e952a6779e Mon Sep 17 00:00:00 2001 From: "peterl%netscape.com" Date: Wed, 2 Sep 1998 02:12:41 +0000 Subject: [PATCH] fixed unit assumptions in map attributes into git-svn-id: svn://10.0.0.236/trunk@9096 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/html/table/src/nsTablePart.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mozilla/layout/html/table/src/nsTablePart.cpp b/mozilla/layout/html/table/src/nsTablePart.cpp index 4847ba67c54..1d4e764f97c 100644 --- a/mozilla/layout/html/table/src/nsTablePart.cpp +++ b/mozilla/layout/html/table/src/nsTablePart.cpp @@ -748,9 +748,7 @@ nsTablePart::MapAttributesInto(nsIStyleContext* aContext, // align GetAttribute(nsHTMLAtoms::align, value); - if (value.GetUnit() != eHTMLUnit_Null) { - NS_ASSERTION(value.GetUnit() == eHTMLUnit_Enumerated, "unexpected unit"); - + if (value.GetUnit() == eHTMLUnit_Enumerated) { // it may be another type if illegal nsStyleDisplay* display = (nsStyleDisplay*)aContext->GetMutableStyleData(eStyleStruct_Display); switch (value.GetIntValue()) { case NS_STYLE_TEXT_ALIGN_LEFT: @@ -766,14 +764,14 @@ nsTablePart::MapAttributesInto(nsIStyleContext* aContext, // cellpadding nsStyleTable* tableStyle=nsnull; GetAttribute(nsHTMLAtoms::cellpadding, value); - if (value.GetUnit() != eHTMLUnit_Null) { + if (value.GetUnit() == eHTMLUnit_Pixel) { tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table); tableStyle->mCellPadding.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t)); } // cellspacing (reuses tableStyle if already resolved) GetAttribute(nsHTMLAtoms::cellspacing, value); - if (value.GetUnit() != eHTMLUnit_Null) { + if (value.GetUnit() == eHTMLUnit_Pixel) { if (nsnull==tableStyle) tableStyle = (nsStyleTable*)aContext->GetMutableStyleData(eStyleStruct_Table); tableStyle->mCellSpacing.SetCoordValue(NSIntPixelsToTwips(value.GetPixelValue(), p2t));