зеркало из https://github.com/mozilla/pjs.git
Bug 573322 - Align td@align with HTML5; r=bzbarsky a=blocking-betaN
This commit is contained in:
Родитель
b4a2ed9a09
Коммит
64a48c5362
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
div { background: green; border: solid blue; width: 100px; height: 100px; }
|
||||
</style>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td><div></div>left
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td><div></div>justify
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td style="text-align: -moz-right;"><div></div>right
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td style="text-align: -moz-center;"><div></div>center
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td style="text-align: -moz-center;"><div></div>middle
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td style="text-align: center;"><div></div>absmiddle
|
||||
</table>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
div { background: green; border: solid blue; width: 100px; height: 100px; }
|
||||
</style>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=left><div></div>left
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=justify><div></div>justify
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=right><div></div>right
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=center><div></div>center
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=middle><div></div>middle
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=absmiddle><div></div>absmiddle
|
||||
</table>
|
|
@ -0,0 +1,27 @@
|
|||
<style>
|
||||
div { background: green; border: solid blue; width: 100px; height: 100px; }
|
||||
</style>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td><div></div>left
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td><div></div>justify
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td style="text-align: -moz-right;"><div></div>right
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td style="text-align: -moz-center;"><div></div>center
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td style="text-align: -moz-center;"><div></div>middle
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td style="text-align: center;"><div></div>absmiddle
|
||||
</table>
|
|
@ -0,0 +1,27 @@
|
|||
<style>
|
||||
div { background: green; border: solid blue; width: 100px; height: 100px; }
|
||||
</style>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=left><div></div>left
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=justify><div></div>justify
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=right><div></div>right
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=center><div></div>center
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=middle><div></div>middle
|
||||
</table>
|
||||
<table border=1 width=50%>
|
||||
<tr>
|
||||
<td align=absmiddle><div></div>absmiddle
|
||||
</table>
|
|
@ -11,5 +11,7 @@
|
|||
== 485377.html 485377-ref.html
|
||||
== 557840.html 557840-ref.html
|
||||
== 560059-video-dimensions.html 560059-video-dimensions-ref.html
|
||||
== 573322-quirks.html 573322-quirks-ref.html
|
||||
== 573322-no-quirks.html 573322-no-quirks-ref.html
|
||||
== href-attr-change-restyles.html href-attr-change-restyles-ref.html
|
||||
== figure.html figure-ref.html
|
||||
|
|
|
@ -1541,39 +1541,22 @@ nsGenericHTMLElement::ParseTableHAlignValue(const nsAString& aString,
|
|||
|
||||
//----------------------------------------
|
||||
|
||||
// These tables are used for TD,TH,TR, etc (but not TABLE)
|
||||
// This table is used for td, th, tr, col, thead, tbody and tfoot.
|
||||
static const nsAttrValue::EnumTable kTableCellHAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_MOZ_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
{ "char", NS_STYLE_TEXT_ALIGN_CHAR },
|
||||
{ "justify",NS_STYLE_TEXT_ALIGN_JUSTIFY },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsAttrValue::EnumTable kCompatTableCellHAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_MOZ_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
{ "char", NS_STYLE_TEXT_ALIGN_CHAR },
|
||||
{ "justify",NS_STYLE_TEXT_ALIGN_JUSTIFY },
|
||||
|
||||
// The following are non-standard but necessary for Nav4 compatibility
|
||||
{ "middle", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
// allow center and absmiddle to map to NS_STYLE_TEXT_ALIGN_CENTER and
|
||||
// NS_STYLE_TEXT_ALIGN_CENTER to map to center by using the following order
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ "absmiddle", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::ParseTableCellHAlignValue(const nsAString& aString,
|
||||
nsAttrValue& aResult) const
|
||||
nsAttrValue& aResult)
|
||||
{
|
||||
if (InNavQuirksMode(GetOwnerDoc())) {
|
||||
return aResult.ParseEnumValue(aString, kCompatTableCellHAlignTable, PR_FALSE);
|
||||
}
|
||||
return aResult.ParseEnumValue(aString, kTableCellHAlignTable, PR_FALSE);
|
||||
}
|
||||
|
||||
|
|
|
@ -273,8 +273,8 @@ public:
|
|||
* @param aResult the resulting HTMLValue
|
||||
* @return whether the value was parsed
|
||||
*/
|
||||
PRBool ParseTableCellHAlignValue(const nsAString& aString,
|
||||
nsAttrValue& aResult) const;
|
||||
static PRBool ParseTableCellHAlignValue(const nsAString& aString,
|
||||
nsAttrValue& aResult);
|
||||
|
||||
/**
|
||||
* Convert a table valign string to value (left/right/center/char/justify/
|
||||
|
|
Загрузка…
Ссылка в новой задаче