зеркало из https://github.com/mozilla/pjs.git
Make computed border-style and float be "none" by default. Bugs 120982
and 120965, patch by Christopher Aillon <caillon@returnzero.com>, r=bzbarsky, sr=jst
This commit is contained in:
Родитель
f60fd1c05c
Коммит
7815d37178
|
@ -711,18 +711,17 @@ nsComputedDOMStyle::GetCssFloat(nsIFrame *aFrame,
|
|||
const nsStyleDisplay* display=nsnull;
|
||||
GetStyleData(eStyleStruct_Display,(const nsStyleStruct*&)display,aFrame);
|
||||
|
||||
if(display) {
|
||||
if(display && display->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||
const nsAFlatCString& cssFloat =
|
||||
nsCSSProps::SearchKeywordTable(display->mFloats,
|
||||
nsCSSProps::kFloatKTable);
|
||||
val->SetString(cssFloat);
|
||||
}
|
||||
else {
|
||||
val->SetString(NS_LITERAL_STRING(""));
|
||||
val->SetString(NS_LITERAL_STRING("none"));
|
||||
}
|
||||
|
||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),
|
||||
(void **)&aValue);
|
||||
return CallQueryInterface(val, &aValue);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -2976,18 +2975,23 @@ nsComputedDOMStyle::GetBorderStyleFor(PRUint8 aSide,
|
|||
const nsStyleBorder* border = nsnull;
|
||||
GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);
|
||||
|
||||
if(border) {
|
||||
PRUint8 borderStyle = NS_STYLE_BORDER_STYLE_NONE;
|
||||
|
||||
if (border) {
|
||||
borderStyle = border->GetBorderStyle(aSide);
|
||||
}
|
||||
|
||||
if (borderStyle != NS_STYLE_BORDER_STYLE_NONE) {
|
||||
const nsAFlatCString& style=
|
||||
nsCSSProps::SearchKeywordTable(border->GetBorderStyle(aSide),
|
||||
nsCSSProps::SearchKeywordTable(borderStyle,
|
||||
nsCSSProps::kBorderStyleKTable);
|
||||
val->SetString(style);
|
||||
}
|
||||
else {
|
||||
val->SetString(NS_LITERAL_STRING(""));
|
||||
val->SetString(NS_LITERAL_STRING("none"));
|
||||
}
|
||||
|
||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),
|
||||
(void **)&aValue);
|
||||
return CallQueryInterface(val, &aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -711,18 +711,17 @@ nsComputedDOMStyle::GetCssFloat(nsIFrame *aFrame,
|
|||
const nsStyleDisplay* display=nsnull;
|
||||
GetStyleData(eStyleStruct_Display,(const nsStyleStruct*&)display,aFrame);
|
||||
|
||||
if(display) {
|
||||
if(display && display->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||
const nsAFlatCString& cssFloat =
|
||||
nsCSSProps::SearchKeywordTable(display->mFloats,
|
||||
nsCSSProps::kFloatKTable);
|
||||
val->SetString(cssFloat);
|
||||
}
|
||||
else {
|
||||
val->SetString(NS_LITERAL_STRING(""));
|
||||
val->SetString(NS_LITERAL_STRING("none"));
|
||||
}
|
||||
|
||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),
|
||||
(void **)&aValue);
|
||||
return CallQueryInterface(val, &aValue);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -2976,18 +2975,23 @@ nsComputedDOMStyle::GetBorderStyleFor(PRUint8 aSide,
|
|||
const nsStyleBorder* border = nsnull;
|
||||
GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);
|
||||
|
||||
if(border) {
|
||||
PRUint8 borderStyle = NS_STYLE_BORDER_STYLE_NONE;
|
||||
|
||||
if (border) {
|
||||
borderStyle = border->GetBorderStyle(aSide);
|
||||
}
|
||||
|
||||
if (borderStyle != NS_STYLE_BORDER_STYLE_NONE) {
|
||||
const nsAFlatCString& style=
|
||||
nsCSSProps::SearchKeywordTable(border->GetBorderStyle(aSide),
|
||||
nsCSSProps::SearchKeywordTable(borderStyle,
|
||||
nsCSSProps::kBorderStyleKTable);
|
||||
val->SetString(style);
|
||||
}
|
||||
else {
|
||||
val->SetString(NS_LITERAL_STRING(""));
|
||||
val->SetString(NS_LITERAL_STRING("none"));
|
||||
}
|
||||
|
||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),
|
||||
(void **)&aValue);
|
||||
return CallQueryInterface(val, &aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
Загрузка…
Ссылка в новой задаче