From 64a48c536237b0e39276cd80f6f6d033800c5d7b Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 30 Jul 2010 16:48:57 -0700 Subject: [PATCH] Bug 573322 - Align td@align with HTML5; r=bzbarsky a=blocking-betaN --- .../reftests/573322-no-quirks-ref.html | 28 +++++++++++++++++++ .../content/reftests/573322-no-quirks.html | 28 +++++++++++++++++++ .../content/reftests/573322-quirks-ref.html | 27 ++++++++++++++++++ .../html/content/reftests/573322-quirks.html | 27 ++++++++++++++++++ content/html/content/reftests/reftest.list | 2 ++ .../html/content/src/nsGenericHTMLElement.cpp | 21 ++------------ .../html/content/src/nsGenericHTMLElement.h | 4 +-- 7 files changed, 116 insertions(+), 21 deletions(-) create mode 100644 content/html/content/reftests/573322-no-quirks-ref.html create mode 100644 content/html/content/reftests/573322-no-quirks.html create mode 100644 content/html/content/reftests/573322-quirks-ref.html create mode 100644 content/html/content/reftests/573322-quirks.html diff --git a/content/html/content/reftests/573322-no-quirks-ref.html b/content/html/content/reftests/573322-no-quirks-ref.html new file mode 100644 index 00000000000..e3f993f2f77 --- /dev/null +++ b/content/html/content/reftests/573322-no-quirks-ref.html @@ -0,0 +1,28 @@ + + + + +
left +
+ + +
justify +
+ + +
right +
+ + +
center +
+ + +
middle +
+ + +
absmiddle +
diff --git a/content/html/content/reftests/573322-no-quirks.html b/content/html/content/reftests/573322-no-quirks.html new file mode 100644 index 00000000000..ac27609e362 --- /dev/null +++ b/content/html/content/reftests/573322-no-quirks.html @@ -0,0 +1,28 @@ + + + + +
left +
+ + +
justify +
+ + +
right +
+ + +
center +
+ + +
middle +
+ + +
absmiddle +
diff --git a/content/html/content/reftests/573322-quirks-ref.html b/content/html/content/reftests/573322-quirks-ref.html new file mode 100644 index 00000000000..6cc22a58e54 --- /dev/null +++ b/content/html/content/reftests/573322-quirks-ref.html @@ -0,0 +1,27 @@ + + + +
left +
+ + +
justify +
+ + +
right +
+ + +
center +
+ + +
middle +
+ + +
absmiddle +
diff --git a/content/html/content/reftests/573322-quirks.html b/content/html/content/reftests/573322-quirks.html new file mode 100644 index 00000000000..35757b1859f --- /dev/null +++ b/content/html/content/reftests/573322-quirks.html @@ -0,0 +1,27 @@ + + + +
left +
+ + +
justify +
+ + +
right +
+ + +
center +
+ + +
middle +
+ + +
absmiddle +
diff --git a/content/html/content/reftests/reftest.list b/content/html/content/reftests/reftest.list index 792f2b6331f..2b943ccf3fb 100644 --- a/content/html/content/reftests/reftest.list +++ b/content/html/content/reftests/reftest.list @@ -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 diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 302a9eb2008..fe7faed38d4 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -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); } diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h index e9d5c7e3fb6..04b4bfec6a6 100644 --- a/content/html/content/src/nsGenericHTMLElement.h +++ b/content/html/content/src/nsGenericHTMLElement.h @@ -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/