From 2e33bbba23ae14cef6decae86cae1dd9adced4a3 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Thu, 25 Mar 1999 03:48:06 +0000 Subject: [PATCH] Use compatability table for div align mappings --- .../html/content/src/nsGenericHTMLElement.cpp | 17 +++++++++++++++++ .../html/content/src/nsGenericHTMLElement.cpp | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index a6ab3dbae22..1dd534ebab4 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -1475,6 +1475,15 @@ static nsGenericHTMLElement::EnumTable kAlignTable[] = { { 0 } }; +static nsGenericHTMLElement::EnumTable kCompatDivAlignTable[] = { + { "left", NS_STYLE_TEXT_ALIGN_LEFT }, + { "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT }, + { "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER }, + { "middle", NS_STYLE_TEXT_ALIGN_MOZ_CENTER }, + { "justify", NS_STYLE_TEXT_ALIGN_JUSTIFY }, + { 0 } +}; + static nsGenericHTMLElement::EnumTable kDivAlignTable[] = { { "left", NS_STYLE_TEXT_ALIGN_LEFT }, { "right", NS_STYLE_TEXT_ALIGN_RIGHT }, @@ -1584,14 +1593,22 @@ PRBool nsGenericHTMLElement::ParseDivAlignValue(const nsString& aString, nsHTMLValue& aResult) { +#if XXX_no_nav_compat return ParseEnumValue(aString, kDivAlignTable, aResult); +#else + return ParseEnumValue(aString, kCompatDivAlignTable, aResult); +#endif } PRBool nsGenericHTMLElement::DivAlignValueToString(const nsHTMLValue& aValue, nsString& aResult) { +#if XXX_no_nav_compat return EnumValueToString(aValue, kDivAlignTable, aResult); +#else + return EnumValueToString(aValue, kCompatDivAlignTable, aResult); +#endif } PRBool diff --git a/layout/html/content/src/nsGenericHTMLElement.cpp b/layout/html/content/src/nsGenericHTMLElement.cpp index a6ab3dbae22..1dd534ebab4 100644 --- a/layout/html/content/src/nsGenericHTMLElement.cpp +++ b/layout/html/content/src/nsGenericHTMLElement.cpp @@ -1475,6 +1475,15 @@ static nsGenericHTMLElement::EnumTable kAlignTable[] = { { 0 } }; +static nsGenericHTMLElement::EnumTable kCompatDivAlignTable[] = { + { "left", NS_STYLE_TEXT_ALIGN_LEFT }, + { "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT }, + { "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER }, + { "middle", NS_STYLE_TEXT_ALIGN_MOZ_CENTER }, + { "justify", NS_STYLE_TEXT_ALIGN_JUSTIFY }, + { 0 } +}; + static nsGenericHTMLElement::EnumTable kDivAlignTable[] = { { "left", NS_STYLE_TEXT_ALIGN_LEFT }, { "right", NS_STYLE_TEXT_ALIGN_RIGHT }, @@ -1584,14 +1593,22 @@ PRBool nsGenericHTMLElement::ParseDivAlignValue(const nsString& aString, nsHTMLValue& aResult) { +#if XXX_no_nav_compat return ParseEnumValue(aString, kDivAlignTable, aResult); +#else + return ParseEnumValue(aString, kCompatDivAlignTable, aResult); +#endif } PRBool nsGenericHTMLElement::DivAlignValueToString(const nsHTMLValue& aValue, nsString& aResult) { +#if XXX_no_nav_compat return EnumValueToString(aValue, kDivAlignTable, aResult); +#else + return EnumValueToString(aValue, kCompatDivAlignTable, aResult); +#endif } PRBool