added style for HTML 4 table elements and TH

This commit is contained in:
buster 1998-04-23 17:19:21 +00:00
Родитель 87e6585798
Коммит 742a6deb6f
3 изменённых файлов: 45 добавлений и 36 удалений

Просмотреть файл

@ -627,19 +627,22 @@ void StyleContextImpl::HackStyleFor(nsIPresContext* aPresContext,
mMolecule.floats = NS_STYLE_FLOAT_RIGHT; mMolecule.floats = NS_STYLE_FLOAT_RIGHT;
} }
} }
} else if (buf.EqualsIgnoreCase("CAPTION")) { // CAPTION } else if (buf.EqualsIgnoreCase("CAPTION")) { // table captions
mMolecule.verticalAlign = NS_STYLE_VERTICAL_ALIGN_TOP; mMolecule.verticalAlign = NS_STYLE_VERTICAL_ALIGN_TOP;
} else if (buf.EqualsIgnoreCase("TBODY")) { // TBODY } else if (buf.EqualsIgnoreCase("TBODY") ||
mSpacing.mPadding.top = NS_POINTS_TO_TWIPS_INT(0); buf.EqualsIgnoreCase("THEAD") ||
mSpacing.mPadding.bottom = NS_POINTS_TO_TWIPS_INT(0); buf.EqualsIgnoreCase("TFOOT") ) { // table rowgroups
mSpacing.mPadding.right = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.top = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.left = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.bottom = NS_POINTS_TO_TWIPS_INT(0);
} else if (buf.EqualsIgnoreCase("TR")) { // TROW mMolecule.padding.right = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.top = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.left = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.bottom = NS_POINTS_TO_TWIPS_INT(0); } else if (buf.EqualsIgnoreCase("TR")) { // table rows
mSpacing.mPadding.right = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.top = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.left = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.bottom = NS_POINTS_TO_TWIPS_INT(0);
} else if (buf.EqualsIgnoreCase("TD")) { // TD mMolecule.padding.right = NS_POINTS_TO_TWIPS_INT(0);
mMolecule.padding.left = NS_POINTS_TO_TWIPS_INT(0);
} else if (buf.EqualsIgnoreCase("TD") ||
buf.EqualsIgnoreCase("TH")) { // table cells
float p2t = aPresContext->GetPixelsToTwips(); float p2t = aPresContext->GetPixelsToTwips();

Просмотреть файл

@ -627,19 +627,22 @@ void StyleContextImpl::HackStyleFor(nsIPresContext* aPresContext,
mMolecule.floats = NS_STYLE_FLOAT_RIGHT; mMolecule.floats = NS_STYLE_FLOAT_RIGHT;
} }
} }
} else if (buf.EqualsIgnoreCase("CAPTION")) { // CAPTION } else if (buf.EqualsIgnoreCase("CAPTION")) { // table captions
mMolecule.verticalAlign = NS_STYLE_VERTICAL_ALIGN_TOP; mMolecule.verticalAlign = NS_STYLE_VERTICAL_ALIGN_TOP;
} else if (buf.EqualsIgnoreCase("TBODY")) { // TBODY } else if (buf.EqualsIgnoreCase("TBODY") ||
mSpacing.mPadding.top = NS_POINTS_TO_TWIPS_INT(0); buf.EqualsIgnoreCase("THEAD") ||
mSpacing.mPadding.bottom = NS_POINTS_TO_TWIPS_INT(0); buf.EqualsIgnoreCase("TFOOT") ) { // table rowgroups
mSpacing.mPadding.right = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.top = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.left = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.bottom = NS_POINTS_TO_TWIPS_INT(0);
} else if (buf.EqualsIgnoreCase("TR")) { // TROW mMolecule.padding.right = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.top = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.left = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.bottom = NS_POINTS_TO_TWIPS_INT(0); } else if (buf.EqualsIgnoreCase("TR")) { // table rows
mSpacing.mPadding.right = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.top = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.left = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.bottom = NS_POINTS_TO_TWIPS_INT(0);
} else if (buf.EqualsIgnoreCase("TD")) { // TD mMolecule.padding.right = NS_POINTS_TO_TWIPS_INT(0);
mMolecule.padding.left = NS_POINTS_TO_TWIPS_INT(0);
} else if (buf.EqualsIgnoreCase("TD") ||
buf.EqualsIgnoreCase("TH")) { // table cells
float p2t = aPresContext->GetPixelsToTwips(); float p2t = aPresContext->GetPixelsToTwips();

Просмотреть файл

@ -627,19 +627,22 @@ void StyleContextImpl::HackStyleFor(nsIPresContext* aPresContext,
mMolecule.floats = NS_STYLE_FLOAT_RIGHT; mMolecule.floats = NS_STYLE_FLOAT_RIGHT;
} }
} }
} else if (buf.EqualsIgnoreCase("CAPTION")) { // CAPTION } else if (buf.EqualsIgnoreCase("CAPTION")) { // table captions
mMolecule.verticalAlign = NS_STYLE_VERTICAL_ALIGN_TOP; mMolecule.verticalAlign = NS_STYLE_VERTICAL_ALIGN_TOP;
} else if (buf.EqualsIgnoreCase("TBODY")) { // TBODY } else if (buf.EqualsIgnoreCase("TBODY") ||
mSpacing.mPadding.top = NS_POINTS_TO_TWIPS_INT(0); buf.EqualsIgnoreCase("THEAD") ||
mSpacing.mPadding.bottom = NS_POINTS_TO_TWIPS_INT(0); buf.EqualsIgnoreCase("TFOOT") ) { // table rowgroups
mSpacing.mPadding.right = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.top = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.left = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.bottom = NS_POINTS_TO_TWIPS_INT(0);
} else if (buf.EqualsIgnoreCase("TR")) { // TROW mMolecule.padding.right = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.top = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.left = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.bottom = NS_POINTS_TO_TWIPS_INT(0); } else if (buf.EqualsIgnoreCase("TR")) { // table rows
mSpacing.mPadding.right = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.top = NS_POINTS_TO_TWIPS_INT(0);
mSpacing.mPadding.left = NS_POINTS_TO_TWIPS_INT(0); mMolecule.padding.bottom = NS_POINTS_TO_TWIPS_INT(0);
} else if (buf.EqualsIgnoreCase("TD")) { // TD mMolecule.padding.right = NS_POINTS_TO_TWIPS_INT(0);
mMolecule.padding.left = NS_POINTS_TO_TWIPS_INT(0);
} else if (buf.EqualsIgnoreCase("TD") ||
buf.EqualsIgnoreCase("TH")) { // table cells
float p2t = aPresContext->GetPixelsToTwips(); float p2t = aPresContext->GetPixelsToTwips();