зеркало из 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;
|
const nsStyleDisplay* display=nsnull;
|
||||||
GetStyleData(eStyleStruct_Display,(const nsStyleStruct*&)display,aFrame);
|
GetStyleData(eStyleStruct_Display,(const nsStyleStruct*&)display,aFrame);
|
||||||
|
|
||||||
if(display) {
|
if(display && display->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||||
const nsAFlatCString& cssFloat =
|
const nsAFlatCString& cssFloat =
|
||||||
nsCSSProps::SearchKeywordTable(display->mFloats,
|
nsCSSProps::SearchKeywordTable(display->mFloats,
|
||||||
nsCSSProps::kFloatKTable);
|
nsCSSProps::kFloatKTable);
|
||||||
val->SetString(cssFloat);
|
val->SetString(cssFloat);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val->SetString(NS_LITERAL_STRING(""));
|
val->SetString(NS_LITERAL_STRING("none"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),
|
return CallQueryInterface(val, &aValue);
|
||||||
(void **)&aValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -2976,18 +2975,23 @@ nsComputedDOMStyle::GetBorderStyleFor(PRUint8 aSide,
|
||||||
const nsStyleBorder* border = nsnull;
|
const nsStyleBorder* border = nsnull;
|
||||||
GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);
|
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=
|
const nsAFlatCString& style=
|
||||||
nsCSSProps::SearchKeywordTable(border->GetBorderStyle(aSide),
|
nsCSSProps::SearchKeywordTable(borderStyle,
|
||||||
nsCSSProps::kBorderStyleKTable);
|
nsCSSProps::kBorderStyleKTable);
|
||||||
val->SetString(style);
|
val->SetString(style);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val->SetString(NS_LITERAL_STRING(""));
|
val->SetString(NS_LITERAL_STRING("none"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),
|
return CallQueryInterface(val, &aValue);
|
||||||
(void **)&aValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
@ -711,18 +711,17 @@ nsComputedDOMStyle::GetCssFloat(nsIFrame *aFrame,
|
||||||
const nsStyleDisplay* display=nsnull;
|
const nsStyleDisplay* display=nsnull;
|
||||||
GetStyleData(eStyleStruct_Display,(const nsStyleStruct*&)display,aFrame);
|
GetStyleData(eStyleStruct_Display,(const nsStyleStruct*&)display,aFrame);
|
||||||
|
|
||||||
if(display) {
|
if(display && display->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||||
const nsAFlatCString& cssFloat =
|
const nsAFlatCString& cssFloat =
|
||||||
nsCSSProps::SearchKeywordTable(display->mFloats,
|
nsCSSProps::SearchKeywordTable(display->mFloats,
|
||||||
nsCSSProps::kFloatKTable);
|
nsCSSProps::kFloatKTable);
|
||||||
val->SetString(cssFloat);
|
val->SetString(cssFloat);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val->SetString(NS_LITERAL_STRING(""));
|
val->SetString(NS_LITERAL_STRING("none"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),
|
return CallQueryInterface(val, &aValue);
|
||||||
(void **)&aValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -2976,18 +2975,23 @@ nsComputedDOMStyle::GetBorderStyleFor(PRUint8 aSide,
|
||||||
const nsStyleBorder* border = nsnull;
|
const nsStyleBorder* border = nsnull;
|
||||||
GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);
|
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=
|
const nsAFlatCString& style=
|
||||||
nsCSSProps::SearchKeywordTable(border->GetBorderStyle(aSide),
|
nsCSSProps::SearchKeywordTable(borderStyle,
|
||||||
nsCSSProps::kBorderStyleKTable);
|
nsCSSProps::kBorderStyleKTable);
|
||||||
val->SetString(style);
|
val->SetString(style);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val->SetString(NS_LITERAL_STRING(""));
|
val->SetString(NS_LITERAL_STRING("none"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),
|
return CallQueryInterface(val, &aValue);
|
||||||
(void **)&aValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
Загрузка…
Ссылка в новой задаче