зеркало из https://github.com/mozilla/gecko-dev.git
store system colors as int rather than enums
return proper result code when setting system color r=rods
This commit is contained in:
Родитель
686efe4b0d
Коммит
cc76d235e4
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче