зеркало из https://github.com/mozilla/gecko-dev.git
Bug 263685. getComputedStyle not working on -moz-outline-radius. r=roc, sr=dbaron
This commit is contained in:
Родитель
e9d20500ed
Коммит
10b573a49b
|
@ -1372,6 +1372,34 @@ nsComputedDOMStyle::GetOutlineStyle(nsIFrame *aFrame,
|
|||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusBottomLeft(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
return GetOutlineRadiusFor(NS_SIDE_LEFT, aFrame, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusBottomRight(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
return GetOutlineRadiusFor(NS_SIDE_BOTTOM, aFrame, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusTopLeft(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
return GetOutlineRadiusFor(NS_SIDE_TOP, aFrame, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusTopRight(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
return GetOutlineRadiusFor(NS_SIDE_RIGHT, aFrame, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineColor(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
|
@ -1400,6 +1428,44 @@ nsComputedDOMStyle::GetOutlineColor(nsIFrame *aFrame,
|
|||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusFor(PRUint8 aSide, nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
const nsStyleOutline *outline = nsnull;
|
||||
GetStyleData(eStyleStruct_Outline, (const nsStyleStruct*&)outline, aFrame);
|
||||
|
||||
if (outline) {
|
||||
nsStyleCoord coord;
|
||||
outline->mOutlineRadius.Get(aSide, coord);
|
||||
|
||||
switch (coord.GetUnit()) {
|
||||
case eStyleUnit_Coord:
|
||||
val->SetTwips(coord.GetCoordValue());
|
||||
break;
|
||||
case eStyleUnit_Percent:
|
||||
if (aFrame) {
|
||||
val->SetTwips(coord.GetPercentValue() * aFrame->GetSize().width);
|
||||
} else {
|
||||
val->SetPercent(coord.GetPercentValue());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_ComputedDOMStyle
|
||||
NS_WARNING("double check the outline radius");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
val->SetTwips(0);
|
||||
}
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetZIndex(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
|
@ -3305,24 +3371,8 @@ nsComputedDOMStyle::GetBorderRadiusFor(PRUint8 aSide, nsIFrame *aFrame,
|
|||
|
||||
if (border) {
|
||||
nsStyleCoord coord;
|
||||
switch (aSide) {
|
||||
case NS_SIDE_TOP:
|
||||
border->mBorderRadius.GetTop(coord);
|
||||
break;
|
||||
case NS_SIDE_BOTTOM:
|
||||
border->mBorderRadius.GetBottom(coord);
|
||||
break;
|
||||
case NS_SIDE_LEFT:
|
||||
border->mBorderRadius.GetLeft(coord);
|
||||
break;
|
||||
case NS_SIDE_RIGHT:
|
||||
border->mBorderRadius.GetRight(coord);
|
||||
break;
|
||||
default:
|
||||
NS_WARNING("double check the side");
|
||||
break;
|
||||
}
|
||||
|
||||
border->mBorderRadius.Get(aSide, coord);
|
||||
|
||||
switch (coord.GetUnit()) {
|
||||
case eStyleUnit_Coord:
|
||||
val->SetTwips(coord.GetCoordValue());
|
||||
|
@ -3692,6 +3742,10 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
|
|||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_color, OutlineColor),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_style, OutlineStyle),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_width, OutlineWidth),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_bottomLeft, OutlineRadiusBottomLeft),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_bottomRight,OutlineRadiusBottomRight),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_topLeft, OutlineRadiusTopLeft),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_topRight, OutlineRadiusTopRight),
|
||||
COMPUTED_STYLE_MAP_ENTRY(user_focus, UserFocus),
|
||||
COMPUTED_STYLE_MAP_ENTRY(user_input, UserInput),
|
||||
COMPUTED_STYLE_MAP_ENTRY(user_modify, UserModify),
|
||||
|
|
|
@ -128,6 +128,10 @@ private:
|
|||
nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue);
|
||||
|
||||
nsresult GetOutlineRadiusFor(PRUint8 aSide,
|
||||
nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue);
|
||||
|
||||
nsresult GetMarginWidthFor(PRUint8 aSide,
|
||||
nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue);
|
||||
|
@ -233,6 +237,10 @@ private:
|
|||
nsresult GetOutlineWidth(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineStyle(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineColor(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineRadiusBottomLeft(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineRadiusBottomRight(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineRadiusTopLeft(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineRadiusTopRight(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
|
||||
/*Marker Properties */
|
||||
nsresult GetMarkerOffset(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
|
|
|
@ -1372,6 +1372,34 @@ nsComputedDOMStyle::GetOutlineStyle(nsIFrame *aFrame,
|
|||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusBottomLeft(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
return GetOutlineRadiusFor(NS_SIDE_LEFT, aFrame, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusBottomRight(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
return GetOutlineRadiusFor(NS_SIDE_BOTTOM, aFrame, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusTopLeft(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
return GetOutlineRadiusFor(NS_SIDE_TOP, aFrame, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusTopRight(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
return GetOutlineRadiusFor(NS_SIDE_RIGHT, aFrame, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineColor(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
|
@ -1400,6 +1428,44 @@ nsComputedDOMStyle::GetOutlineColor(nsIFrame *aFrame,
|
|||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetOutlineRadiusFor(PRUint8 aSide, nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
{
|
||||
nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
const nsStyleOutline *outline = nsnull;
|
||||
GetStyleData(eStyleStruct_Outline, (const nsStyleStruct*&)outline, aFrame);
|
||||
|
||||
if (outline) {
|
||||
nsStyleCoord coord;
|
||||
outline->mOutlineRadius.Get(aSide, coord);
|
||||
|
||||
switch (coord.GetUnit()) {
|
||||
case eStyleUnit_Coord:
|
||||
val->SetTwips(coord.GetCoordValue());
|
||||
break;
|
||||
case eStyleUnit_Percent:
|
||||
if (aFrame) {
|
||||
val->SetTwips(coord.GetPercentValue() * aFrame->GetSize().width);
|
||||
} else {
|
||||
val->SetPercent(coord.GetPercentValue());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG_ComputedDOMStyle
|
||||
NS_WARNING("double check the outline radius");
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
val->SetTwips(0);
|
||||
}
|
||||
|
||||
return CallQueryInterface(val, aValue);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsComputedDOMStyle::GetZIndex(nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue)
|
||||
|
@ -3305,24 +3371,8 @@ nsComputedDOMStyle::GetBorderRadiusFor(PRUint8 aSide, nsIFrame *aFrame,
|
|||
|
||||
if (border) {
|
||||
nsStyleCoord coord;
|
||||
switch (aSide) {
|
||||
case NS_SIDE_TOP:
|
||||
border->mBorderRadius.GetTop(coord);
|
||||
break;
|
||||
case NS_SIDE_BOTTOM:
|
||||
border->mBorderRadius.GetBottom(coord);
|
||||
break;
|
||||
case NS_SIDE_LEFT:
|
||||
border->mBorderRadius.GetLeft(coord);
|
||||
break;
|
||||
case NS_SIDE_RIGHT:
|
||||
border->mBorderRadius.GetRight(coord);
|
||||
break;
|
||||
default:
|
||||
NS_WARNING("double check the side");
|
||||
break;
|
||||
}
|
||||
|
||||
border->mBorderRadius.Get(aSide, coord);
|
||||
|
||||
switch (coord.GetUnit()) {
|
||||
case eStyleUnit_Coord:
|
||||
val->SetTwips(coord.GetCoordValue());
|
||||
|
@ -3692,6 +3742,10 @@ nsComputedDOMStyle::GetQueryablePropertyMap(PRUint32* aLength)
|
|||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_color, OutlineColor),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_style, OutlineStyle),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_width, OutlineWidth),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_bottomLeft, OutlineRadiusBottomLeft),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_bottomRight,OutlineRadiusBottomRight),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_topLeft, OutlineRadiusTopLeft),
|
||||
COMPUTED_STYLE_MAP_ENTRY(_moz_outline_radius_topRight, OutlineRadiusTopRight),
|
||||
COMPUTED_STYLE_MAP_ENTRY(user_focus, UserFocus),
|
||||
COMPUTED_STYLE_MAP_ENTRY(user_input, UserInput),
|
||||
COMPUTED_STYLE_MAP_ENTRY(user_modify, UserModify),
|
||||
|
|
|
@ -128,6 +128,10 @@ private:
|
|||
nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue);
|
||||
|
||||
nsresult GetOutlineRadiusFor(PRUint8 aSide,
|
||||
nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue);
|
||||
|
||||
nsresult GetMarginWidthFor(PRUint8 aSide,
|
||||
nsIFrame *aFrame,
|
||||
nsIDOMCSSValue** aValue);
|
||||
|
@ -233,6 +237,10 @@ private:
|
|||
nsresult GetOutlineWidth(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineStyle(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineColor(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineRadiusBottomLeft(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineRadiusBottomRight(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineRadiusTopLeft(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
nsresult GetOutlineRadiusTopRight(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
|
||||
/*Marker Properties */
|
||||
nsresult GetMarkerOffset(nsIFrame *aFrame, nsIDOMCSSValue** aValue);
|
||||
|
|
Загрузка…
Ссылка в новой задаче