From ba5cb51bf5e43ed9936eebbe2b2a119f61533067 Mon Sep 17 00:00:00 2001 From: "glazman%netscape.com" Date: Wed, 6 Nov 2002 08:31:19 +0000 Subject: [PATCH] CSS properties set to system colors were returning inconsistent values; b=172199, r=caillon, sr=peterv git-svn-id: svn://10.0.0.236/trunk@133139 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/style/src/nsCSSDeclaration.cpp | 34 ++++++++++++++++++- .../content/html/style/src/nsCSSStruct.cpp | 34 ++++++++++++++++++- mozilla/layout/style/nsCSSDeclaration.cpp | 34 ++++++++++++++++++- mozilla/layout/style/nsCSSStruct.cpp | 34 ++++++++++++++++++- 4 files changed, 132 insertions(+), 4 deletions(-) diff --git a/mozilla/content/html/style/src/nsCSSDeclaration.cpp b/mozilla/content/html/style/src/nsCSSDeclaration.cpp index 5c9b8f77ea6..71338985ee2 100644 --- a/mozilla/content/html/style/src/nsCSSDeclaration.cpp +++ b/mozilla/content/html/style/src/nsCSSDeclaration.cpp @@ -4859,7 +4859,13 @@ PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, const nsCS else if (eCSSUnit_Integer == unit) { switch (aProperty) { case eCSSProperty_color: - case eCSSProperty_background_color: { + case eCSSProperty_background_color: + case eCSSProperty_border_top_color: + case eCSSProperty_border_bottom_color: + case eCSSProperty_border_left_color: + case eCSSProperty_border_right_color: + case eCSSProperty__moz_outline_color: + case eCSSProperty_text_shadow_color: { // we can lookup the property in the ColorTable and then // get a string mapping the name nsAutoString tmpStr; @@ -5378,6 +5384,32 @@ nsCSSDeclaration::GetValue(nsCSSProperty aProperty, } break; } + case eCSSProperty_border_top_colors: + case eCSSProperty_border_right_colors: + case eCSSProperty_border_bottom_colors: + case eCSSProperty_border_left_colors: { + CSS_VARONSTACK_GET(Margin); + PRUint8 index; + switch (aProperty) { + case eCSSProperty_border_top_colors: index = 0; break; + case eCSSProperty_border_right_colors: index = 1; break; + case eCSSProperty_border_bottom_colors: index = 2; break; + case eCSSProperty_border_left_colors: index = 3; break; + CSS_BOGUS_DEFAULT; // make compiler happy + } + if ((nsnull != theMargin) && (nsnull != theMargin->mBorderColors) && + (nsnull != theMargin->mBorderColors[index])) { + nsCSSValueList* borderSideColors = theMargin->mBorderColors[index]; + do { + AppendValueToString(aProperty, borderSideColors->mValue, aValue); + borderSideColors = borderSideColors->mNext; + if (nsnull != borderSideColors) { + aValue.Append(PRUnichar(' ')); + } + } while (nsnull != borderSideColors); + } + break; + } default: AppendValueToString(aProperty, aValue); break; diff --git a/mozilla/content/html/style/src/nsCSSStruct.cpp b/mozilla/content/html/style/src/nsCSSStruct.cpp index 5c9b8f77ea6..71338985ee2 100644 --- a/mozilla/content/html/style/src/nsCSSStruct.cpp +++ b/mozilla/content/html/style/src/nsCSSStruct.cpp @@ -4859,7 +4859,13 @@ PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, const nsCS else if (eCSSUnit_Integer == unit) { switch (aProperty) { case eCSSProperty_color: - case eCSSProperty_background_color: { + case eCSSProperty_background_color: + case eCSSProperty_border_top_color: + case eCSSProperty_border_bottom_color: + case eCSSProperty_border_left_color: + case eCSSProperty_border_right_color: + case eCSSProperty__moz_outline_color: + case eCSSProperty_text_shadow_color: { // we can lookup the property in the ColorTable and then // get a string mapping the name nsAutoString tmpStr; @@ -5378,6 +5384,32 @@ nsCSSDeclaration::GetValue(nsCSSProperty aProperty, } break; } + case eCSSProperty_border_top_colors: + case eCSSProperty_border_right_colors: + case eCSSProperty_border_bottom_colors: + case eCSSProperty_border_left_colors: { + CSS_VARONSTACK_GET(Margin); + PRUint8 index; + switch (aProperty) { + case eCSSProperty_border_top_colors: index = 0; break; + case eCSSProperty_border_right_colors: index = 1; break; + case eCSSProperty_border_bottom_colors: index = 2; break; + case eCSSProperty_border_left_colors: index = 3; break; + CSS_BOGUS_DEFAULT; // make compiler happy + } + if ((nsnull != theMargin) && (nsnull != theMargin->mBorderColors) && + (nsnull != theMargin->mBorderColors[index])) { + nsCSSValueList* borderSideColors = theMargin->mBorderColors[index]; + do { + AppendValueToString(aProperty, borderSideColors->mValue, aValue); + borderSideColors = borderSideColors->mNext; + if (nsnull != borderSideColors) { + aValue.Append(PRUnichar(' ')); + } + } while (nsnull != borderSideColors); + } + break; + } default: AppendValueToString(aProperty, aValue); break; diff --git a/mozilla/layout/style/nsCSSDeclaration.cpp b/mozilla/layout/style/nsCSSDeclaration.cpp index 5c9b8f77ea6..71338985ee2 100644 --- a/mozilla/layout/style/nsCSSDeclaration.cpp +++ b/mozilla/layout/style/nsCSSDeclaration.cpp @@ -4859,7 +4859,13 @@ PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, const nsCS else if (eCSSUnit_Integer == unit) { switch (aProperty) { case eCSSProperty_color: - case eCSSProperty_background_color: { + case eCSSProperty_background_color: + case eCSSProperty_border_top_color: + case eCSSProperty_border_bottom_color: + case eCSSProperty_border_left_color: + case eCSSProperty_border_right_color: + case eCSSProperty__moz_outline_color: + case eCSSProperty_text_shadow_color: { // we can lookup the property in the ColorTable and then // get a string mapping the name nsAutoString tmpStr; @@ -5378,6 +5384,32 @@ nsCSSDeclaration::GetValue(nsCSSProperty aProperty, } break; } + case eCSSProperty_border_top_colors: + case eCSSProperty_border_right_colors: + case eCSSProperty_border_bottom_colors: + case eCSSProperty_border_left_colors: { + CSS_VARONSTACK_GET(Margin); + PRUint8 index; + switch (aProperty) { + case eCSSProperty_border_top_colors: index = 0; break; + case eCSSProperty_border_right_colors: index = 1; break; + case eCSSProperty_border_bottom_colors: index = 2; break; + case eCSSProperty_border_left_colors: index = 3; break; + CSS_BOGUS_DEFAULT; // make compiler happy + } + if ((nsnull != theMargin) && (nsnull != theMargin->mBorderColors) && + (nsnull != theMargin->mBorderColors[index])) { + nsCSSValueList* borderSideColors = theMargin->mBorderColors[index]; + do { + AppendValueToString(aProperty, borderSideColors->mValue, aValue); + borderSideColors = borderSideColors->mNext; + if (nsnull != borderSideColors) { + aValue.Append(PRUnichar(' ')); + } + } while (nsnull != borderSideColors); + } + break; + } default: AppendValueToString(aProperty, aValue); break; diff --git a/mozilla/layout/style/nsCSSStruct.cpp b/mozilla/layout/style/nsCSSStruct.cpp index 5c9b8f77ea6..71338985ee2 100644 --- a/mozilla/layout/style/nsCSSStruct.cpp +++ b/mozilla/layout/style/nsCSSStruct.cpp @@ -4859,7 +4859,13 @@ PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, const nsCS else if (eCSSUnit_Integer == unit) { switch (aProperty) { case eCSSProperty_color: - case eCSSProperty_background_color: { + case eCSSProperty_background_color: + case eCSSProperty_border_top_color: + case eCSSProperty_border_bottom_color: + case eCSSProperty_border_left_color: + case eCSSProperty_border_right_color: + case eCSSProperty__moz_outline_color: + case eCSSProperty_text_shadow_color: { // we can lookup the property in the ColorTable and then // get a string mapping the name nsAutoString tmpStr; @@ -5378,6 +5384,32 @@ nsCSSDeclaration::GetValue(nsCSSProperty aProperty, } break; } + case eCSSProperty_border_top_colors: + case eCSSProperty_border_right_colors: + case eCSSProperty_border_bottom_colors: + case eCSSProperty_border_left_colors: { + CSS_VARONSTACK_GET(Margin); + PRUint8 index; + switch (aProperty) { + case eCSSProperty_border_top_colors: index = 0; break; + case eCSSProperty_border_right_colors: index = 1; break; + case eCSSProperty_border_bottom_colors: index = 2; break; + case eCSSProperty_border_left_colors: index = 3; break; + CSS_BOGUS_DEFAULT; // make compiler happy + } + if ((nsnull != theMargin) && (nsnull != theMargin->mBorderColors) && + (nsnull != theMargin->mBorderColors[index])) { + nsCSSValueList* borderSideColors = theMargin->mBorderColors[index]; + do { + AppendValueToString(aProperty, borderSideColors->mValue, aValue); + borderSideColors = borderSideColors->mNext; + if (nsnull != borderSideColors) { + aValue.Append(PRUnichar(' ')); + } + } while (nsnull != borderSideColors); + } + break; + } default: AppendValueToString(aProperty, aValue); break;