зеркало из https://github.com/mozilla/gecko-dev.git
Bug 24676 ("Need -moz-outline-radius feature"). Added the 'outline_radius' similarly to the 'border_radius'.
This commit is contained in:
Родитель
6962364ebd
Коммит
0ff017366d
|
@ -567,6 +567,7 @@ void StyleSpacingImpl::ResetFrom(const nsStyleSpacing* aParent, nsIPresContext*
|
|||
mBorderColor[3] = NS_RGB(0, 0, 0);
|
||||
|
||||
mBorderRadius.Reset();
|
||||
mOutlineRadius.Reset();
|
||||
|
||||
mOutlineWidth = medium;
|
||||
mOutlineStyle = NS_STYLE_BORDER_STYLE_NONE;
|
||||
|
@ -762,7 +763,8 @@ PRInt32 StyleSpacingImpl::CalcDifference(const StyleSpacingImpl& aOther) const
|
|||
}
|
||||
if ((mOutlineWidth != aOther.mOutlineWidth) ||
|
||||
(mOutlineStyle != aOther.mOutlineStyle) ||
|
||||
(mOutlineColor != aOther.mOutlineColor)) {
|
||||
(mOutlineColor != aOther.mOutlineColor) ||
|
||||
(mOutlineRadius != aOther.mOutlineRadius)) {
|
||||
return NS_STYLE_HINT_REFLOW; // XXX: should be VISUAL: see bugs 9809 and 9816
|
||||
}
|
||||
return NS_STYLE_HINT_NONE;
|
||||
|
|
|
@ -374,13 +374,13 @@ void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const
|
|||
|
||||
nsCSSMargin::nsCSSMargin(void)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull)
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull),
|
||||
mOutlineWidth(aCopy.mOutlineWidth),
|
||||
mOutlineColor(aCopy.mOutlineColor),
|
||||
mOutlineStyle(aCopy.mOutlineStyle),
|
||||
|
@ -392,6 +392,7 @@ nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
|||
CSS_IF_COPY(mBorderColor, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderStyle, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderRadius, nsCSSRect);
|
||||
CSS_IF_COPY(mOutlineRadius, nsCSSRect);
|
||||
}
|
||||
|
||||
nsCSSMargin::~nsCSSMargin(void)
|
||||
|
@ -402,6 +403,7 @@ nsCSSMargin::~nsCSSMargin(void)
|
|||
CSS_IF_DELETE(mBorderColor);
|
||||
CSS_IF_DELETE(mBorderStyle);
|
||||
CSS_IF_DELETE(mBorderRadius);
|
||||
CSS_IF_DELETE(mOutlineRadius);
|
||||
}
|
||||
|
||||
const nsID& nsCSSMargin::GetID(void)
|
||||
|
@ -460,6 +462,15 @@ void nsCSSMargin::List(FILE* out, PRInt32 aIndent) const
|
|||
mOutlineWidth.AppendToString(buffer, eCSSProperty_outline_width);
|
||||
mOutlineColor.AppendToString(buffer, eCSSProperty_outline_color);
|
||||
mOutlineStyle.AppendToString(buffer, eCSSProperty_outline_style);
|
||||
if (nsnull != mOutlineRadius) {
|
||||
static const nsCSSProperty trbl[] = {
|
||||
eCSSProperty__moz_outline_radius_topLeft,
|
||||
eCSSProperty__moz_outline_radius_topRight,
|
||||
eCSSProperty__moz_outline_radius_bottomRight,
|
||||
eCSSProperty__moz_outline_radius_bottomLeft
|
||||
};
|
||||
mOutlineRadius->List(out, aIndent, trbl);
|
||||
}
|
||||
mFloatEdge.AppendToString(buffer, eCSSProperty_float_edge);
|
||||
fputs(buffer, out);
|
||||
}
|
||||
|
@ -1390,6 +1401,23 @@ CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValu
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
CSS_ENSURE(Margin) {
|
||||
CSS_ENSURE_RECT(mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: mMargin->mOutlineRadius->mTop = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: mMargin->mOutlineRadius->mRight = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: mMargin->mOutlineRadius->mBottom = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: mMargin->mOutlineRadius->mLeft = aValue; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2065,6 +2093,27 @@ CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if (nsnull != mMargin) {
|
||||
if (nsnull != mMargin->mOutlineRadius) {
|
||||
CSS_ENSURE_IMPORTANT(Margin) {
|
||||
CSS_ENSURE_RECT(mImportant->mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topLeft, mMargin->mOutlineRadius->mTop);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topRight, mMargin->mOutlineRadius->mRight);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomRight, mMargin->mOutlineRadius->mBottom);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomLeft, mMargin->mOutlineRadius->mLeft);
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2765,6 +2814,24 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if ((nsnull != mMargin) && (nsnull != mMargin->mOutlineRadius)) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: aValue = mMargin->mOutlineRadius->mTop; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: aValue = mMargin->mOutlineRadius->mRight; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: aValue = mMargin->mOutlineRadius->mBottom; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: aValue = mMargin->mOutlineRadius->mLeft; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
else {
|
||||
aValue.Reset();
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -3428,6 +3495,14 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsString& aValue)
|
|||
AppendValueToString(eCSSProperty__moz_border_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty__moz_outline_radius:
|
||||
if (HAS_RECT(mMargin,mOutlineRadius)) {
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topLeft, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty_border_width:
|
||||
if (HAS_RECT(mMargin,mBorderWidth)) {
|
||||
AppendValueToString(eCSSProperty_border_top_width, aValue); aValue.Append(' ');
|
||||
|
|
|
@ -206,6 +206,7 @@ protected:
|
|||
PRBool ParseBorderStyle(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseBorderWidth(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseBorderRadius(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseOutlineRadius(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseClip(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseContent(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseCounterData(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
|
@ -2677,6 +2678,8 @@ PRBool CSSParserImpl::ParseProperty(PRInt32& aErrorCode,
|
|||
return ParseBorderWidth(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty__moz_border_radius:
|
||||
return ParseBorderRadius(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty__moz_outline_radius:
|
||||
return ParseOutlineRadius(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty_clip:
|
||||
return ParseClip(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty_content:
|
||||
|
@ -3346,6 +3349,12 @@ static const nsCSSProperty kBorderRadiusIDs[] = {
|
|||
eCSSProperty__moz_border_radius_bottomRight,
|
||||
eCSSProperty__moz_border_radius_bottomLeft
|
||||
};
|
||||
static const nsCSSProperty kOutlineRadiusIDs[] = {
|
||||
eCSSProperty__moz_outline_radius_topLeft,
|
||||
eCSSProperty__moz_outline_radius_topRight,
|
||||
eCSSProperty__moz_outline_radius_bottomRight,
|
||||
eCSSProperty__moz_outline_radius_bottomLeft
|
||||
};
|
||||
|
||||
PRBool CSSParserImpl::ParseBorder(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
|
@ -3468,6 +3477,12 @@ PRBool CSSParserImpl::ParseBorderRadius(PRInt32& aErrorCode, nsICSSDeclaration*
|
|||
return ParseBoxProperties(aErrorCode, aDeclaration, kBorderRadiusIDs, aChangeHint);
|
||||
}
|
||||
|
||||
PRBool CSSParserImpl::ParseOutlineRadius(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
{
|
||||
return ParseBoxProperties(aErrorCode, aDeclaration, kOutlineRadiusIDs, aChangeHint);
|
||||
}
|
||||
|
||||
|
||||
PRBool CSSParserImpl::ParseClip(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
|
|
|
@ -47,6 +47,11 @@ CSS_PROP(_moz_border_radius_topLeft, VISUAL)
|
|||
CSS_PROP(_moz_border_radius_topRight, VISUAL)
|
||||
CSS_PROP(_moz_border_radius_bottomLeft, VISUAL)
|
||||
CSS_PROP(_moz_border_radius_bottomRight, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_topLeft, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_topRight, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_bottomLeft, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_bottomRight, VISUAL)
|
||||
CSS_PROP(azimuth, AURAL)
|
||||
CSS_PROP(background, VISUAL)
|
||||
CSS_PROP(background_attachment, VISUAL)
|
||||
|
|
|
@ -374,13 +374,13 @@ void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const
|
|||
|
||||
nsCSSMargin::nsCSSMargin(void)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull)
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull),
|
||||
mOutlineWidth(aCopy.mOutlineWidth),
|
||||
mOutlineColor(aCopy.mOutlineColor),
|
||||
mOutlineStyle(aCopy.mOutlineStyle),
|
||||
|
@ -392,6 +392,7 @@ nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
|||
CSS_IF_COPY(mBorderColor, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderStyle, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderRadius, nsCSSRect);
|
||||
CSS_IF_COPY(mOutlineRadius, nsCSSRect);
|
||||
}
|
||||
|
||||
nsCSSMargin::~nsCSSMargin(void)
|
||||
|
@ -402,6 +403,7 @@ nsCSSMargin::~nsCSSMargin(void)
|
|||
CSS_IF_DELETE(mBorderColor);
|
||||
CSS_IF_DELETE(mBorderStyle);
|
||||
CSS_IF_DELETE(mBorderRadius);
|
||||
CSS_IF_DELETE(mOutlineRadius);
|
||||
}
|
||||
|
||||
const nsID& nsCSSMargin::GetID(void)
|
||||
|
@ -460,6 +462,15 @@ void nsCSSMargin::List(FILE* out, PRInt32 aIndent) const
|
|||
mOutlineWidth.AppendToString(buffer, eCSSProperty_outline_width);
|
||||
mOutlineColor.AppendToString(buffer, eCSSProperty_outline_color);
|
||||
mOutlineStyle.AppendToString(buffer, eCSSProperty_outline_style);
|
||||
if (nsnull != mOutlineRadius) {
|
||||
static const nsCSSProperty trbl[] = {
|
||||
eCSSProperty__moz_outline_radius_topLeft,
|
||||
eCSSProperty__moz_outline_radius_topRight,
|
||||
eCSSProperty__moz_outline_radius_bottomRight,
|
||||
eCSSProperty__moz_outline_radius_bottomLeft
|
||||
};
|
||||
mOutlineRadius->List(out, aIndent, trbl);
|
||||
}
|
||||
mFloatEdge.AppendToString(buffer, eCSSProperty_float_edge);
|
||||
fputs(buffer, out);
|
||||
}
|
||||
|
@ -1390,6 +1401,23 @@ CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValu
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
CSS_ENSURE(Margin) {
|
||||
CSS_ENSURE_RECT(mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: mMargin->mOutlineRadius->mTop = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: mMargin->mOutlineRadius->mRight = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: mMargin->mOutlineRadius->mBottom = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: mMargin->mOutlineRadius->mLeft = aValue; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2065,6 +2093,27 @@ CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if (nsnull != mMargin) {
|
||||
if (nsnull != mMargin->mOutlineRadius) {
|
||||
CSS_ENSURE_IMPORTANT(Margin) {
|
||||
CSS_ENSURE_RECT(mImportant->mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topLeft, mMargin->mOutlineRadius->mTop);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topRight, mMargin->mOutlineRadius->mRight);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomRight, mMargin->mOutlineRadius->mBottom);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomLeft, mMargin->mOutlineRadius->mLeft);
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2765,6 +2814,24 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if ((nsnull != mMargin) && (nsnull != mMargin->mOutlineRadius)) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: aValue = mMargin->mOutlineRadius->mTop; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: aValue = mMargin->mOutlineRadius->mRight; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: aValue = mMargin->mOutlineRadius->mBottom; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: aValue = mMargin->mOutlineRadius->mLeft; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
else {
|
||||
aValue.Reset();
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -3428,6 +3495,14 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsString& aValue)
|
|||
AppendValueToString(eCSSProperty__moz_border_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty__moz_outline_radius:
|
||||
if (HAS_RECT(mMargin,mOutlineRadius)) {
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topLeft, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty_border_width:
|
||||
if (HAS_RECT(mMargin,mBorderWidth)) {
|
||||
AppendValueToString(eCSSProperty_border_top_width, aValue); aValue.Append(' ');
|
||||
|
|
|
@ -2022,6 +2022,28 @@ MapDeclarationMarginInto(nsICSSDeclaration* aDeclaration,
|
|||
}
|
||||
}
|
||||
|
||||
// -moz-outline-radius: length, percent, inherit
|
||||
if (nsnull != ourMargin->mOutlineRadius) {
|
||||
nsStyleCoord coord;
|
||||
nsStyleCoord parentCoord;
|
||||
parentSpacing->mOutlineRadius.GetLeft(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mLeft, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetLeft(coord);
|
||||
}
|
||||
parentSpacing->mOutlineRadius.GetTop(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mTop, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetTop(coord);
|
||||
}
|
||||
parentSpacing->mOutlineRadius.GetRight(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mRight, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetRight(coord);
|
||||
}
|
||||
parentSpacing->mOutlineRadius.GetBottom(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mBottom, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetBottom(coord);
|
||||
}
|
||||
}
|
||||
|
||||
// outline-width: length, enum, inherit
|
||||
if (! SetCoord(ourMargin->mOutlineWidth, spacing->mOutlineWidth, parentSpacing->mOutlineWidth,
|
||||
SETCOORD_LEH, aFont->mFont, aPresContext)) {
|
||||
|
|
|
@ -219,6 +219,7 @@ struct nsCSSMargin : public nsCSSStruct {
|
|||
nsCSSValue mOutlineWidth;
|
||||
nsCSSValue mOutlineColor;
|
||||
nsCSSValue mOutlineStyle;
|
||||
nsCSSRect* mOutlineRadius; // (extension)
|
||||
nsCSSValue mFloatEdge; // NEW
|
||||
};
|
||||
|
||||
|
|
|
@ -47,6 +47,11 @@ CSS_PROP(_moz_border_radius_topLeft, VISUAL)
|
|||
CSS_PROP(_moz_border_radius_topRight, VISUAL)
|
||||
CSS_PROP(_moz_border_radius_bottomLeft, VISUAL)
|
||||
CSS_PROP(_moz_border_radius_bottomRight, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_topLeft, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_topRight, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_bottomLeft, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_bottomRight, VISUAL)
|
||||
CSS_PROP(azimuth, AURAL)
|
||||
CSS_PROP(background, VISUAL)
|
||||
CSS_PROP(background_attachment, VISUAL)
|
||||
|
|
|
@ -85,6 +85,7 @@ struct nsStyleSpacing: public nsStyleStruct {
|
|||
nsStyleSides mBorder; // [reset] length, enum (see nsStyleConsts.h)
|
||||
|
||||
nsStyleSides mBorderRadius; // [reset] length, percent, inherit
|
||||
nsStyleSides mOutlineRadius; // [reset] length, percent, inherit
|
||||
// (top=topLeft, right=topRight, bottom=bottomRight, left=bottomLeft)
|
||||
|
||||
nsStyleCoord mOutlineWidth; // [reset] length, enum (see nsStyleConsts.h)
|
||||
|
|
|
@ -567,6 +567,7 @@ void StyleSpacingImpl::ResetFrom(const nsStyleSpacing* aParent, nsIPresContext*
|
|||
mBorderColor[3] = NS_RGB(0, 0, 0);
|
||||
|
||||
mBorderRadius.Reset();
|
||||
mOutlineRadius.Reset();
|
||||
|
||||
mOutlineWidth = medium;
|
||||
mOutlineStyle = NS_STYLE_BORDER_STYLE_NONE;
|
||||
|
@ -762,7 +763,8 @@ PRInt32 StyleSpacingImpl::CalcDifference(const StyleSpacingImpl& aOther) const
|
|||
}
|
||||
if ((mOutlineWidth != aOther.mOutlineWidth) ||
|
||||
(mOutlineStyle != aOther.mOutlineStyle) ||
|
||||
(mOutlineColor != aOther.mOutlineColor)) {
|
||||
(mOutlineColor != aOther.mOutlineColor) ||
|
||||
(mOutlineRadius != aOther.mOutlineRadius)) {
|
||||
return NS_STYLE_HINT_REFLOW; // XXX: should be VISUAL: see bugs 9809 and 9816
|
||||
}
|
||||
return NS_STYLE_HINT_NONE;
|
||||
|
|
|
@ -374,13 +374,13 @@ void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const
|
|||
|
||||
nsCSSMargin::nsCSSMargin(void)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull)
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull),
|
||||
mOutlineWidth(aCopy.mOutlineWidth),
|
||||
mOutlineColor(aCopy.mOutlineColor),
|
||||
mOutlineStyle(aCopy.mOutlineStyle),
|
||||
|
@ -392,6 +392,7 @@ nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
|||
CSS_IF_COPY(mBorderColor, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderStyle, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderRadius, nsCSSRect);
|
||||
CSS_IF_COPY(mOutlineRadius, nsCSSRect);
|
||||
}
|
||||
|
||||
nsCSSMargin::~nsCSSMargin(void)
|
||||
|
@ -402,6 +403,7 @@ nsCSSMargin::~nsCSSMargin(void)
|
|||
CSS_IF_DELETE(mBorderColor);
|
||||
CSS_IF_DELETE(mBorderStyle);
|
||||
CSS_IF_DELETE(mBorderRadius);
|
||||
CSS_IF_DELETE(mOutlineRadius);
|
||||
}
|
||||
|
||||
const nsID& nsCSSMargin::GetID(void)
|
||||
|
@ -460,6 +462,15 @@ void nsCSSMargin::List(FILE* out, PRInt32 aIndent) const
|
|||
mOutlineWidth.AppendToString(buffer, eCSSProperty_outline_width);
|
||||
mOutlineColor.AppendToString(buffer, eCSSProperty_outline_color);
|
||||
mOutlineStyle.AppendToString(buffer, eCSSProperty_outline_style);
|
||||
if (nsnull != mOutlineRadius) {
|
||||
static const nsCSSProperty trbl[] = {
|
||||
eCSSProperty__moz_outline_radius_topLeft,
|
||||
eCSSProperty__moz_outline_radius_topRight,
|
||||
eCSSProperty__moz_outline_radius_bottomRight,
|
||||
eCSSProperty__moz_outline_radius_bottomLeft
|
||||
};
|
||||
mOutlineRadius->List(out, aIndent, trbl);
|
||||
}
|
||||
mFloatEdge.AppendToString(buffer, eCSSProperty_float_edge);
|
||||
fputs(buffer, out);
|
||||
}
|
||||
|
@ -1390,6 +1401,23 @@ CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValu
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
CSS_ENSURE(Margin) {
|
||||
CSS_ENSURE_RECT(mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: mMargin->mOutlineRadius->mTop = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: mMargin->mOutlineRadius->mRight = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: mMargin->mOutlineRadius->mBottom = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: mMargin->mOutlineRadius->mLeft = aValue; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2065,6 +2093,27 @@ CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if (nsnull != mMargin) {
|
||||
if (nsnull != mMargin->mOutlineRadius) {
|
||||
CSS_ENSURE_IMPORTANT(Margin) {
|
||||
CSS_ENSURE_RECT(mImportant->mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topLeft, mMargin->mOutlineRadius->mTop);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topRight, mMargin->mOutlineRadius->mRight);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomRight, mMargin->mOutlineRadius->mBottom);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomLeft, mMargin->mOutlineRadius->mLeft);
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2765,6 +2814,24 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if ((nsnull != mMargin) && (nsnull != mMargin->mOutlineRadius)) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: aValue = mMargin->mOutlineRadius->mTop; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: aValue = mMargin->mOutlineRadius->mRight; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: aValue = mMargin->mOutlineRadius->mBottom; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: aValue = mMargin->mOutlineRadius->mLeft; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
else {
|
||||
aValue.Reset();
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -3428,6 +3495,14 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsString& aValue)
|
|||
AppendValueToString(eCSSProperty__moz_border_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty__moz_outline_radius:
|
||||
if (HAS_RECT(mMargin,mOutlineRadius)) {
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topLeft, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty_border_width:
|
||||
if (HAS_RECT(mMargin,mBorderWidth)) {
|
||||
AppendValueToString(eCSSProperty_border_top_width, aValue); aValue.Append(' ');
|
||||
|
|
|
@ -206,6 +206,7 @@ protected:
|
|||
PRBool ParseBorderStyle(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseBorderWidth(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseBorderRadius(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseOutlineRadius(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseClip(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseContent(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseCounterData(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
|
@ -2677,6 +2678,8 @@ PRBool CSSParserImpl::ParseProperty(PRInt32& aErrorCode,
|
|||
return ParseBorderWidth(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty__moz_border_radius:
|
||||
return ParseBorderRadius(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty__moz_outline_radius:
|
||||
return ParseOutlineRadius(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty_clip:
|
||||
return ParseClip(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty_content:
|
||||
|
@ -3346,6 +3349,12 @@ static const nsCSSProperty kBorderRadiusIDs[] = {
|
|||
eCSSProperty__moz_border_radius_bottomRight,
|
||||
eCSSProperty__moz_border_radius_bottomLeft
|
||||
};
|
||||
static const nsCSSProperty kOutlineRadiusIDs[] = {
|
||||
eCSSProperty__moz_outline_radius_topLeft,
|
||||
eCSSProperty__moz_outline_radius_topRight,
|
||||
eCSSProperty__moz_outline_radius_bottomRight,
|
||||
eCSSProperty__moz_outline_radius_bottomLeft
|
||||
};
|
||||
|
||||
PRBool CSSParserImpl::ParseBorder(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
|
@ -3468,6 +3477,12 @@ PRBool CSSParserImpl::ParseBorderRadius(PRInt32& aErrorCode, nsICSSDeclaration*
|
|||
return ParseBoxProperties(aErrorCode, aDeclaration, kBorderRadiusIDs, aChangeHint);
|
||||
}
|
||||
|
||||
PRBool CSSParserImpl::ParseOutlineRadius(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
{
|
||||
return ParseBoxProperties(aErrorCode, aDeclaration, kOutlineRadiusIDs, aChangeHint);
|
||||
}
|
||||
|
||||
|
||||
PRBool CSSParserImpl::ParseClip(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
|
|
|
@ -47,6 +47,11 @@ CSS_PROP(_moz_border_radius_topLeft, VISUAL)
|
|||
CSS_PROP(_moz_border_radius_topRight, VISUAL)
|
||||
CSS_PROP(_moz_border_radius_bottomLeft, VISUAL)
|
||||
CSS_PROP(_moz_border_radius_bottomRight, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_topLeft, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_topRight, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_bottomLeft, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_bottomRight, VISUAL)
|
||||
CSS_PROP(azimuth, AURAL)
|
||||
CSS_PROP(background, VISUAL)
|
||||
CSS_PROP(background_attachment, VISUAL)
|
||||
|
|
|
@ -2022,6 +2022,28 @@ MapDeclarationMarginInto(nsICSSDeclaration* aDeclaration,
|
|||
}
|
||||
}
|
||||
|
||||
// -moz-outline-radius: length, percent, inherit
|
||||
if (nsnull != ourMargin->mOutlineRadius) {
|
||||
nsStyleCoord coord;
|
||||
nsStyleCoord parentCoord;
|
||||
parentSpacing->mOutlineRadius.GetLeft(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mLeft, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetLeft(coord);
|
||||
}
|
||||
parentSpacing->mOutlineRadius.GetTop(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mTop, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetTop(coord);
|
||||
}
|
||||
parentSpacing->mOutlineRadius.GetRight(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mRight, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetRight(coord);
|
||||
}
|
||||
parentSpacing->mOutlineRadius.GetBottom(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mBottom, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetBottom(coord);
|
||||
}
|
||||
}
|
||||
|
||||
// outline-width: length, enum, inherit
|
||||
if (! SetCoord(ourMargin->mOutlineWidth, spacing->mOutlineWidth, parentSpacing->mOutlineWidth,
|
||||
SETCOORD_LEH, aFont->mFont, aPresContext)) {
|
||||
|
|
|
@ -219,6 +219,7 @@ struct nsCSSMargin : public nsCSSStruct {
|
|||
nsCSSValue mOutlineWidth;
|
||||
nsCSSValue mOutlineColor;
|
||||
nsCSSValue mOutlineStyle;
|
||||
nsCSSRect* mOutlineRadius; // (extension)
|
||||
nsCSSValue mFloatEdge; // NEW
|
||||
};
|
||||
|
||||
|
|
|
@ -374,13 +374,13 @@ void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const
|
|||
|
||||
nsCSSMargin::nsCSSMargin(void)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull)
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull),
|
||||
mOutlineWidth(aCopy.mOutlineWidth),
|
||||
mOutlineColor(aCopy.mOutlineColor),
|
||||
mOutlineStyle(aCopy.mOutlineStyle),
|
||||
|
@ -392,6 +392,7 @@ nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
|||
CSS_IF_COPY(mBorderColor, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderStyle, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderRadius, nsCSSRect);
|
||||
CSS_IF_COPY(mOutlineRadius, nsCSSRect);
|
||||
}
|
||||
|
||||
nsCSSMargin::~nsCSSMargin(void)
|
||||
|
@ -402,6 +403,7 @@ nsCSSMargin::~nsCSSMargin(void)
|
|||
CSS_IF_DELETE(mBorderColor);
|
||||
CSS_IF_DELETE(mBorderStyle);
|
||||
CSS_IF_DELETE(mBorderRadius);
|
||||
CSS_IF_DELETE(mOutlineRadius);
|
||||
}
|
||||
|
||||
const nsID& nsCSSMargin::GetID(void)
|
||||
|
@ -460,6 +462,15 @@ void nsCSSMargin::List(FILE* out, PRInt32 aIndent) const
|
|||
mOutlineWidth.AppendToString(buffer, eCSSProperty_outline_width);
|
||||
mOutlineColor.AppendToString(buffer, eCSSProperty_outline_color);
|
||||
mOutlineStyle.AppendToString(buffer, eCSSProperty_outline_style);
|
||||
if (nsnull != mOutlineRadius) {
|
||||
static const nsCSSProperty trbl[] = {
|
||||
eCSSProperty__moz_outline_radius_topLeft,
|
||||
eCSSProperty__moz_outline_radius_topRight,
|
||||
eCSSProperty__moz_outline_radius_bottomRight,
|
||||
eCSSProperty__moz_outline_radius_bottomLeft
|
||||
};
|
||||
mOutlineRadius->List(out, aIndent, trbl);
|
||||
}
|
||||
mFloatEdge.AppendToString(buffer, eCSSProperty_float_edge);
|
||||
fputs(buffer, out);
|
||||
}
|
||||
|
@ -1390,6 +1401,23 @@ CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValu
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
CSS_ENSURE(Margin) {
|
||||
CSS_ENSURE_RECT(mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: mMargin->mOutlineRadius->mTop = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: mMargin->mOutlineRadius->mRight = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: mMargin->mOutlineRadius->mBottom = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: mMargin->mOutlineRadius->mLeft = aValue; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2065,6 +2093,27 @@ CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if (nsnull != mMargin) {
|
||||
if (nsnull != mMargin->mOutlineRadius) {
|
||||
CSS_ENSURE_IMPORTANT(Margin) {
|
||||
CSS_ENSURE_RECT(mImportant->mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topLeft, mMargin->mOutlineRadius->mTop);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topRight, mMargin->mOutlineRadius->mRight);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomRight, mMargin->mOutlineRadius->mBottom);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomLeft, mMargin->mOutlineRadius->mLeft);
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2765,6 +2814,24 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if ((nsnull != mMargin) && (nsnull != mMargin->mOutlineRadius)) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: aValue = mMargin->mOutlineRadius->mTop; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: aValue = mMargin->mOutlineRadius->mRight; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: aValue = mMargin->mOutlineRadius->mBottom; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: aValue = mMargin->mOutlineRadius->mLeft; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
else {
|
||||
aValue.Reset();
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -3428,6 +3495,14 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsString& aValue)
|
|||
AppendValueToString(eCSSProperty__moz_border_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty__moz_outline_radius:
|
||||
if (HAS_RECT(mMargin,mOutlineRadius)) {
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topLeft, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty_border_width:
|
||||
if (HAS_RECT(mMargin,mBorderWidth)) {
|
||||
AppendValueToString(eCSSProperty_border_top_width, aValue); aValue.Append(' ');
|
||||
|
|
|
@ -206,6 +206,7 @@ protected:
|
|||
PRBool ParseBorderStyle(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseBorderWidth(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseBorderRadius(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseOutlineRadius(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseClip(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseContent(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration, PRInt32& aChangeHint);
|
||||
PRBool ParseCounterData(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
|
@ -2677,6 +2678,8 @@ PRBool CSSParserImpl::ParseProperty(PRInt32& aErrorCode,
|
|||
return ParseBorderWidth(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty__moz_border_radius:
|
||||
return ParseBorderRadius(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty__moz_outline_radius:
|
||||
return ParseOutlineRadius(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty_clip:
|
||||
return ParseClip(aErrorCode, aDeclaration, aChangeHint);
|
||||
case eCSSProperty_content:
|
||||
|
@ -3346,6 +3349,12 @@ static const nsCSSProperty kBorderRadiusIDs[] = {
|
|||
eCSSProperty__moz_border_radius_bottomRight,
|
||||
eCSSProperty__moz_border_radius_bottomLeft
|
||||
};
|
||||
static const nsCSSProperty kOutlineRadiusIDs[] = {
|
||||
eCSSProperty__moz_outline_radius_topLeft,
|
||||
eCSSProperty__moz_outline_radius_topRight,
|
||||
eCSSProperty__moz_outline_radius_bottomRight,
|
||||
eCSSProperty__moz_outline_radius_bottomLeft
|
||||
};
|
||||
|
||||
PRBool CSSParserImpl::ParseBorder(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
|
@ -3468,6 +3477,12 @@ PRBool CSSParserImpl::ParseBorderRadius(PRInt32& aErrorCode, nsICSSDeclaration*
|
|||
return ParseBoxProperties(aErrorCode, aDeclaration, kBorderRadiusIDs, aChangeHint);
|
||||
}
|
||||
|
||||
PRBool CSSParserImpl::ParseOutlineRadius(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
{
|
||||
return ParseBoxProperties(aErrorCode, aDeclaration, kOutlineRadiusIDs, aChangeHint);
|
||||
}
|
||||
|
||||
|
||||
PRBool CSSParserImpl::ParseClip(PRInt32& aErrorCode, nsICSSDeclaration* aDeclaration,
|
||||
PRInt32& aChangeHint)
|
||||
|
|
|
@ -47,6 +47,11 @@ CSS_PROP(_moz_border_radius_topLeft, VISUAL)
|
|||
CSS_PROP(_moz_border_radius_topRight, VISUAL)
|
||||
CSS_PROP(_moz_border_radius_bottomLeft, VISUAL)
|
||||
CSS_PROP(_moz_border_radius_bottomRight, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_topLeft, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_topRight, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_bottomLeft, VISUAL)
|
||||
CSS_PROP(_moz_outline_radius_bottomRight, VISUAL)
|
||||
CSS_PROP(azimuth, AURAL)
|
||||
CSS_PROP(background, VISUAL)
|
||||
CSS_PROP(background_attachment, VISUAL)
|
||||
|
|
|
@ -374,13 +374,13 @@ void nsCSSDisplay::List(FILE* out, PRInt32 aIndent) const
|
|||
|
||||
nsCSSMargin::nsCSSMargin(void)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull)
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
||||
: mMargin(nsnull), mPadding(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull),
|
||||
mBorderWidth(nsnull), mBorderColor(nsnull), mBorderStyle(nsnull), mBorderRadius(nsnull), mOutlineRadius(nsnull),
|
||||
mOutlineWidth(aCopy.mOutlineWidth),
|
||||
mOutlineColor(aCopy.mOutlineColor),
|
||||
mOutlineStyle(aCopy.mOutlineStyle),
|
||||
|
@ -392,6 +392,7 @@ nsCSSMargin::nsCSSMargin(const nsCSSMargin& aCopy)
|
|||
CSS_IF_COPY(mBorderColor, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderStyle, nsCSSRect);
|
||||
CSS_IF_COPY(mBorderRadius, nsCSSRect);
|
||||
CSS_IF_COPY(mOutlineRadius, nsCSSRect);
|
||||
}
|
||||
|
||||
nsCSSMargin::~nsCSSMargin(void)
|
||||
|
@ -402,6 +403,7 @@ nsCSSMargin::~nsCSSMargin(void)
|
|||
CSS_IF_DELETE(mBorderColor);
|
||||
CSS_IF_DELETE(mBorderStyle);
|
||||
CSS_IF_DELETE(mBorderRadius);
|
||||
CSS_IF_DELETE(mOutlineRadius);
|
||||
}
|
||||
|
||||
const nsID& nsCSSMargin::GetID(void)
|
||||
|
@ -460,6 +462,15 @@ void nsCSSMargin::List(FILE* out, PRInt32 aIndent) const
|
|||
mOutlineWidth.AppendToString(buffer, eCSSProperty_outline_width);
|
||||
mOutlineColor.AppendToString(buffer, eCSSProperty_outline_color);
|
||||
mOutlineStyle.AppendToString(buffer, eCSSProperty_outline_style);
|
||||
if (nsnull != mOutlineRadius) {
|
||||
static const nsCSSProperty trbl[] = {
|
||||
eCSSProperty__moz_outline_radius_topLeft,
|
||||
eCSSProperty__moz_outline_radius_topRight,
|
||||
eCSSProperty__moz_outline_radius_bottomRight,
|
||||
eCSSProperty__moz_outline_radius_bottomLeft
|
||||
};
|
||||
mOutlineRadius->List(out, aIndent, trbl);
|
||||
}
|
||||
mFloatEdge.AppendToString(buffer, eCSSProperty_float_edge);
|
||||
fputs(buffer, out);
|
||||
}
|
||||
|
@ -1390,6 +1401,23 @@ CSSDeclarationImpl::AppendValue(nsCSSProperty aProperty, const nsCSSValue& aValu
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
CSS_ENSURE(Margin) {
|
||||
CSS_ENSURE_RECT(mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: mMargin->mOutlineRadius->mTop = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: mMargin->mOutlineRadius->mRight = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: mMargin->mOutlineRadius->mBottom = aValue; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: mMargin->mOutlineRadius->mLeft = aValue; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2065,6 +2093,27 @@ CSSDeclarationImpl::SetValueImportant(nsCSSProperty aProperty)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if (nsnull != mMargin) {
|
||||
if (nsnull != mMargin->mOutlineRadius) {
|
||||
CSS_ENSURE_IMPORTANT(Margin) {
|
||||
CSS_ENSURE_RECT(mImportant->mMargin->mOutlineRadius) {
|
||||
switch (aProperty) {
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topLeft, mMargin->mOutlineRadius->mTop);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_topRight, mMargin->mOutlineRadius->mRight);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomRight, mMargin->mOutlineRadius->mBottom);
|
||||
CSS_CASE_IMPORTANT(eCSSProperty__moz_outline_radius_bottomLeft, mMargin->mOutlineRadius->mLeft);
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -2765,6 +2814,24 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
|
|||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty__moz_outline_radius_topLeft:
|
||||
case eCSSProperty__moz_outline_radius_topRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomRight:
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft:
|
||||
if ((nsnull != mMargin) && (nsnull != mMargin->mOutlineRadius)) {
|
||||
switch (aProperty) {
|
||||
case eCSSProperty__moz_outline_radius_topLeft: aValue = mMargin->mOutlineRadius->mTop; break;
|
||||
case eCSSProperty__moz_outline_radius_topRight: aValue = mMargin->mOutlineRadius->mRight; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomRight: aValue = mMargin->mOutlineRadius->mBottom; break;
|
||||
case eCSSProperty__moz_outline_radius_bottomLeft: aValue = mMargin->mOutlineRadius->mLeft; break;
|
||||
CSS_BOGUS_DEFAULT; // make compiler happy
|
||||
}
|
||||
}
|
||||
else {
|
||||
aValue.Reset();
|
||||
}
|
||||
break;
|
||||
|
||||
case eCSSProperty_outline_width:
|
||||
case eCSSProperty_outline_color:
|
||||
case eCSSProperty_outline_style:
|
||||
|
@ -3428,6 +3495,14 @@ CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsString& aValue)
|
|||
AppendValueToString(eCSSProperty__moz_border_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty__moz_outline_radius:
|
||||
if (HAS_RECT(mMargin,mOutlineRadius)) {
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topLeft, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_topRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomRight, aValue); aValue.Append(' ');
|
||||
AppendValueToString(eCSSProperty__moz_outline_radius_bottomLeft, aValue);
|
||||
}
|
||||
break;
|
||||
case eCSSProperty_border_width:
|
||||
if (HAS_RECT(mMargin,mBorderWidth)) {
|
||||
AppendValueToString(eCSSProperty_border_top_width, aValue); aValue.Append(' ');
|
||||
|
|
|
@ -2022,6 +2022,28 @@ MapDeclarationMarginInto(nsICSSDeclaration* aDeclaration,
|
|||
}
|
||||
}
|
||||
|
||||
// -moz-outline-radius: length, percent, inherit
|
||||
if (nsnull != ourMargin->mOutlineRadius) {
|
||||
nsStyleCoord coord;
|
||||
nsStyleCoord parentCoord;
|
||||
parentSpacing->mOutlineRadius.GetLeft(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mLeft, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetLeft(coord);
|
||||
}
|
||||
parentSpacing->mOutlineRadius.GetTop(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mTop, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetTop(coord);
|
||||
}
|
||||
parentSpacing->mOutlineRadius.GetRight(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mRight, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetRight(coord);
|
||||
}
|
||||
parentSpacing->mOutlineRadius.GetBottom(parentCoord);
|
||||
if (SetCoord(ourMargin->mOutlineRadius->mBottom, coord, parentCoord, SETCOORD_LPH, aFont->mFont, aPresContext)) {
|
||||
spacing->mOutlineRadius.SetBottom(coord);
|
||||
}
|
||||
}
|
||||
|
||||
// outline-width: length, enum, inherit
|
||||
if (! SetCoord(ourMargin->mOutlineWidth, spacing->mOutlineWidth, parentSpacing->mOutlineWidth,
|
||||
SETCOORD_LEH, aFont->mFont, aPresContext)) {
|
||||
|
|
|
@ -567,6 +567,7 @@ void StyleSpacingImpl::ResetFrom(const nsStyleSpacing* aParent, nsIPresContext*
|
|||
mBorderColor[3] = NS_RGB(0, 0, 0);
|
||||
|
||||
mBorderRadius.Reset();
|
||||
mOutlineRadius.Reset();
|
||||
|
||||
mOutlineWidth = medium;
|
||||
mOutlineStyle = NS_STYLE_BORDER_STYLE_NONE;
|
||||
|
@ -762,7 +763,8 @@ PRInt32 StyleSpacingImpl::CalcDifference(const StyleSpacingImpl& aOther) const
|
|||
}
|
||||
if ((mOutlineWidth != aOther.mOutlineWidth) ||
|
||||
(mOutlineStyle != aOther.mOutlineStyle) ||
|
||||
(mOutlineColor != aOther.mOutlineColor)) {
|
||||
(mOutlineColor != aOther.mOutlineColor) ||
|
||||
(mOutlineRadius != aOther.mOutlineRadius)) {
|
||||
return NS_STYLE_HINT_REFLOW; // XXX: should be VISUAL: see bugs 9809 and 9816
|
||||
}
|
||||
return NS_STYLE_HINT_NONE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче