зеркало из https://github.com/mozilla/pjs.git
store system colors as int rather than enums
return proper result code when setting system color r=rods
This commit is contained in:
Родитель
73836fbfa0
Коммит
62cd20de05
|
@ -1844,7 +1844,7 @@ PRBool CSSParserImpl::ParseColor(PRInt32& aErrorCode, nsCSSValue& aValue)
|
|||
if (eCSSKeyword_UNKNOWN < keyword) { // known keyword
|
||||
PRInt32 index = SearchKeywordTable(keyword, nsCSSProps::kColorKTable);
|
||||
if (0 < index) {
|
||||
aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Enumerated);
|
||||
aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Integer);
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1178,11 +1178,13 @@ static PRBool SetColor(const nsCSSValue& aValue, const nscolor aParentColor,
|
|||
result = PR_TRUE;
|
||||
}
|
||||
}
|
||||
else if (eCSSUnit_Enumerated == unit) {
|
||||
else if (eCSSUnit_Integer == unit) {
|
||||
nsILookAndFeel* look = nsnull;
|
||||
if (NS_SUCCEEDED(aPresContext->GetLookAndFeel(&look)) && look) {
|
||||
nsILookAndFeel::nsColorID colorID = (nsILookAndFeel::nsColorID)aValue.GetIntValue();
|
||||
look->GetColor(colorID, aResult);
|
||||
if (NS_SUCCEEDED(look->GetColor(colorID, aResult))) {
|
||||
result = PR_TRUE;
|
||||
}
|
||||
NS_RELEASE(look);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1844,7 +1844,7 @@ PRBool CSSParserImpl::ParseColor(PRInt32& aErrorCode, nsCSSValue& aValue)
|
|||
if (eCSSKeyword_UNKNOWN < keyword) { // known keyword
|
||||
PRInt32 index = SearchKeywordTable(keyword, nsCSSProps::kColorKTable);
|
||||
if (0 < index) {
|
||||
aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Enumerated);
|
||||
aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Integer);
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1178,11 +1178,13 @@ static PRBool SetColor(const nsCSSValue& aValue, const nscolor aParentColor,
|
|||
result = PR_TRUE;
|
||||
}
|
||||
}
|
||||
else if (eCSSUnit_Enumerated == unit) {
|
||||
else if (eCSSUnit_Integer == unit) {
|
||||
nsILookAndFeel* look = nsnull;
|
||||
if (NS_SUCCEEDED(aPresContext->GetLookAndFeel(&look)) && look) {
|
||||
nsILookAndFeel::nsColorID colorID = (nsILookAndFeel::nsColorID)aValue.GetIntValue();
|
||||
look->GetColor(colorID, aResult);
|
||||
if (NS_SUCCEEDED(look->GetColor(colorID, aResult))) {
|
||||
result = PR_TRUE;
|
||||
}
|
||||
NS_RELEASE(look);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1844,7 +1844,7 @@ PRBool CSSParserImpl::ParseColor(PRInt32& aErrorCode, nsCSSValue& aValue)
|
|||
if (eCSSKeyword_UNKNOWN < keyword) { // known keyword
|
||||
PRInt32 index = SearchKeywordTable(keyword, nsCSSProps::kColorKTable);
|
||||
if (0 < index) {
|
||||
aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Enumerated);
|
||||
aValue.SetIntValue(nsCSSProps::kColorKTable[index], eCSSUnit_Integer);
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1178,11 +1178,13 @@ static PRBool SetColor(const nsCSSValue& aValue, const nscolor aParentColor,
|
|||
result = PR_TRUE;
|
||||
}
|
||||
}
|
||||
else if (eCSSUnit_Enumerated == unit) {
|
||||
else if (eCSSUnit_Integer == unit) {
|
||||
nsILookAndFeel* look = nsnull;
|
||||
if (NS_SUCCEEDED(aPresContext->GetLookAndFeel(&look)) && look) {
|
||||
nsILookAndFeel::nsColorID colorID = (nsILookAndFeel::nsColorID)aValue.GetIntValue();
|
||||
look->GetColor(colorID, aResult);
|
||||
if (NS_SUCCEEDED(look->GetColor(colorID, aResult))) {
|
||||
result = PR_TRUE;
|
||||
}
|
||||
NS_RELEASE(look);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче