Bug 451134 (2/2): switch to the official border-radius property names: by-hand changes. r=dbaron a2.0=blocking2.0:beta6
authorZack Weinberg <zweinberg@mozilla.com>
Thu, 09 Sep 2010 08:21:48 -0700
changeset 52298 c954983caff1ff7764e306fe6dc4ae957a8561e2
parent 52297 c1cc7b565dc740206b5b46b613f99da334195329
child 52299 8adb2f64c1380356d460983d514bad51b51ae634
push idunknown
push userunknown
push dateunknown
reviewersdbaron
bugs451134
milestone2.0b6pre
Bug 451134 (2/2): switch to the official border-radius property names: by-hand changes. r=dbaron a2.0=blocking2.0:beta6
dom/interfaces/css/nsIDOMCSS2Properties.idl
layout/style/nsCSSPropList.h
layout/style/nsCSSProps.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/test/property_database.js
--- a/dom/interfaces/css/nsIDOMCSS2Properties.idl
+++ b/dom/interfaces/css/nsIDOMCSS2Properties.idl
@@ -45,17 +45,17 @@
  * The nsIDOMCSS2Properties interface is a datatype for additional
  * reflection of data already provided in nsIDOMCSSStyleDeclaration in
  * the Document Object Model.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/DOM-Level-2-Style
  */
 
-[scriptable, uuid(c8db3d5b-8e11-4219-84ea-d72b565ec738)]
+[scriptable, uuid(6e583050-7345-4623-9acf-44dc7136e09f)]
 interface nsIDOMCSS2Properties : nsISupports
 {
            attribute DOMString        azimuth;
                                         // raises(DOMException) on setting
 
            attribute DOMString        background;
                                         // raises(DOMException) on setting
 
@@ -135,16 +135,31 @@ interface nsIDOMCSS2Properties : nsISupp
                                         // raises(DOMException) on setting
 
            attribute DOMString        borderLeftWidth;
                                         // raises(DOMException) on setting
 
            attribute DOMString        borderWidth;
                                         // raises(DOMException) on setting
 
+           attribute DOMString        borderRadius;
+                                        // raises(DOMException) on setting
+
+           attribute DOMString        borderTopLeftRadius;
+                                        // raises(DOMException) on setting
+
+           attribute DOMString        borderTopRightRadius;
+                                        // raises(DOMException) on setting
+
+           attribute DOMString        borderBottomLeftRadius;
+                                        // raises(DOMException) on setting
+
+           attribute DOMString        borderBottomRightRadius;
+                                        // raises(DOMException) on setting
+
            attribute DOMString        bottom;
                                         // raises(DOMException) on setting
 
            attribute DOMString        captionSide;
                                         // raises(DOMException) on setting
 
            attribute DOMString        clear;
                                         // raises(DOMException) on setting
@@ -535,31 +550,16 @@ interface nsIDOMCSS2Properties : nsISupp
                                         // raises(DOMException) on setting
 
            attribute DOMString        MozBorderRightColors;
                                         // raises(DOMException) on setting
 
            attribute DOMString        MozBorderTopColors;
                                         // raises(DOMException) on setting
 
-           attribute DOMString        MozBorderRadius;
-                                        // raises(DOMException) on setting
-
-           attribute DOMString        MozBorderRadiusTopleft;
-                                        // raises(DOMException) on setting
-
-           attribute DOMString        MozBorderRadiusTopright;
-                                        // raises(DOMException) on setting
-
-           attribute DOMString        MozBorderRadiusBottomleft;
-                                        // raises(DOMException) on setting
-
-           attribute DOMString        MozBorderRadiusBottomright;
-                                        // raises(DOMException) on setting
-
            attribute DOMString        MozBoxAlign;
                                         // raises(DOMException) on setting
 
            attribute DOMString        MozBoxDirection;
                                         // raises(DOMException) on setting
 
            attribute DOMString        MozBoxFlex;
                                         // raises(DOMException) on setting
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -293,61 +293,16 @@ CSS_PROP_DISPLAY(
     MozAppearance,
     0,
     Display,
     mAppearance,
     kAppearanceKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 CSS_PROP_SHORTHAND(
-    border-radius,
-    border_radius,
-    MozBorderRadius,
-    0)
-CSS_PROP_BORDER(
-    border-top-left-radius,
-    border_top_left_radius,
-    MozBorderRadiusTopleft,
-    CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
-    Margin,
-    mBorderRadius.mTopLeft,
-    nsnull,
-    offsetof(nsStyleBorder, mBorderRadius),
-    eStyleAnimType_Corner_TopLeft)
-CSS_PROP_BORDER(
-    border-top-right-radius,
-    border_top_right_radius,
-    MozBorderRadiusTopright,
-    CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
-    Margin,
-    mBorderRadius.mTopRight,
-    nsnull,
-    offsetof(nsStyleBorder, mBorderRadius),
-    eStyleAnimType_Corner_TopRight)
-CSS_PROP_BORDER(
-    border-bottom-right-radius,
-    border_bottom_right_radius,
-    MozBorderRadiusBottomright,
-    CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
-    Margin,
-    mBorderRadius.mBottomRight,
-    nsnull,
-    offsetof(nsStyleBorder, mBorderRadius),
-    eStyleAnimType_Corner_BottomRight)
-CSS_PROP_BORDER(
-    border-bottom-left-radius,
-    border_bottom_left_radius,
-    MozBorderRadiusBottomleft,
-    CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
-    Margin,
-    mBorderRadius.mBottomLeft,
-    nsnull,
-    offsetof(nsStyleBorder, mBorderRadius),
-    eStyleAnimType_Corner_BottomLeft)
-CSS_PROP_SHORTHAND(
     -moz-outline-radius,
     _moz_outline_radius,
     MozOutlineRadius,
     0)
 CSS_PROP_OUTLINE(
     -moz-outline-radius-topleft,
     _moz_outline_radius_topLeft,
     MozOutlineRadiusTopleft,
@@ -1063,16 +1018,61 @@ CSS_PROP_BORDER(
     kBorderWidthKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_Custom)
 CSS_PROP_SHORTHAND(
     border-width,
     border_width,
     BorderWidth,
     0)
+CSS_PROP_SHORTHAND(
+    border-radius,
+    border_radius,
+    BorderRadius,
+    0)
+CSS_PROP_BORDER(
+    border-top-left-radius,
+    border_top_left_radius,
+    BorderTopLeftRadius,
+    CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
+    Margin,
+    mBorderRadius.mTopLeft,
+    nsnull,
+    offsetof(nsStyleBorder, mBorderRadius),
+    eStyleAnimType_Corner_TopLeft)
+CSS_PROP_BORDER(
+    border-top-right-radius,
+    border_top_right_radius,
+    BorderTopRightRadius,
+    CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
+    Margin,
+    mBorderRadius.mTopRight,
+    nsnull,
+    offsetof(nsStyleBorder, mBorderRadius),
+    eStyleAnimType_Corner_TopRight)
+CSS_PROP_BORDER(
+    border-bottom-right-radius,
+    border_bottom_right_radius,
+    BorderBottomRightRadius,
+    CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
+    Margin,
+    mBorderRadius.mBottomRight,
+    nsnull,
+    offsetof(nsStyleBorder, mBorderRadius),
+    eStyleAnimType_Corner_BottomRight)
+CSS_PROP_BORDER(
+    border-bottom-left-radius,
+    border_bottom_left_radius,
+    BorderBottomLeftRadius,
+    CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
+    Margin,
+    mBorderRadius.mBottomLeft,
+    nsnull,
+    offsetof(nsStyleBorder, mBorderRadius),
+    eStyleAnimType_Corner_BottomLeft)
 CSS_PROP_POSITION(
     bottom,
     bottom,
     Bottom,
     0,
     Position,
     mOffset.mBottom,
     nsnull,
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1562,17 +1562,17 @@ const PRUint32 nsCSSProps::kFlagsTable[e
   flags_,
 #include "nsCSSPropList.h"
 #undef CSS_PROP
 #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_) flags_,
 #include "nsCSSPropList.h"
 #undef CSS_PROP_SHORTHAND
 };
 
-static const nsCSSProperty gMozBorderRadiusSubpropTable[] = {
+static const nsCSSProperty gBorderRadiusSubpropTable[] = {
   // Code relies on these being in topleft-topright-bottomright-bottomleft
   // order.
   eCSSProperty_border_top_left_radius,
   eCSSProperty_border_top_right_radius,
   eCSSProperty_border_bottom_right_radius,
   eCSSProperty_border_bottom_left_radius,
   eCSSProperty_UNKNOWN
 };
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -2000,38 +2000,38 @@ nsComputedDOMStyle::DoGetBorderRightColo
 
 nsresult
 nsComputedDOMStyle::DoGetBorderTopColors(nsIDOMCSSValue** aValue)
 {
   return GetBorderColorsFor(NS_SIDE_TOP, aValue);
 }
 
 nsresult
-nsComputedDOMStyle::DoGetBorderRadiusBottomLeft(nsIDOMCSSValue** aValue)
+nsComputedDOMStyle::DoGetBorderBottomLeftRadius(nsIDOMCSSValue** aValue)
 {
   return GetEllipseRadii(GetStyleBorder()->mBorderRadius,
                          NS_CORNER_BOTTOM_LEFT, aValue);
 }
 
 nsresult
-nsComputedDOMStyle::DoGetBorderRadiusBottomRight(nsIDOMCSSValue** aValue)
+nsComputedDOMStyle::DoGetBorderBottomRightRadius(nsIDOMCSSValue** aValue)
 {
   return GetEllipseRadii(GetStyleBorder()->mBorderRadius,
                          NS_CORNER_BOTTOM_RIGHT, aValue);
 }
 
 nsresult
-nsComputedDOMStyle::DoGetBorderRadiusTopLeft(nsIDOMCSSValue** aValue)
+nsComputedDOMStyle::DoGetBorderTopLeftRadius(nsIDOMCSSValue** aValue)
 {
   return GetEllipseRadii(GetStyleBorder()->mBorderRadius,
                          NS_CORNER_TOP_LEFT, aValue);
 }
 
 nsresult
-nsComputedDOMStyle::DoGetBorderRadiusTopRight(nsIDOMCSSValue** aValue)
+nsComputedDOMStyle::DoGetBorderTopRightRadius(nsIDOMCSSValue** aValue)
 {
   return GetEllipseRadii(GetStyleBorder()->mBorderRadius,
                          NS_CORNER_TOP_RIGHT, aValue);
 }
 
 nsresult
 nsComputedDOMStyle::DoGetBorderWidth(nsIDOMCSSValue** aValue)
 {
@@ -4839,20 +4839,20 @@ nsComputedDOMStyle::GetQueryableProperty
     COMPUTED_STYLE_MAP_ENTRY(background_origin,             BackgroundOrigin),
     COMPUTED_STYLE_MAP_ENTRY(background_size,               MozBackgroundSize),
     COMPUTED_STYLE_MAP_ENTRY(binding,                       Binding),
     COMPUTED_STYLE_MAP_ENTRY(border_bottom_colors,          BorderBottomColors),
     COMPUTED_STYLE_MAP_ENTRY(border_image,                  BorderImage),
     COMPUTED_STYLE_MAP_ENTRY(border_left_colors,            BorderLeftColors),
     COMPUTED_STYLE_MAP_ENTRY(border_right_colors,           BorderRightColors),
     COMPUTED_STYLE_MAP_ENTRY(border_top_colors,             BorderTopColors),
-    COMPUTED_STYLE_MAP_ENTRY_LAYOUT(border_bottom_left_radius, BorderRadiusBottomLeft),
-    COMPUTED_STYLE_MAP_ENTRY_LAYOUT(border_bottom_right_radius,BorderRadiusBottomRight),
-    COMPUTED_STYLE_MAP_ENTRY_LAYOUT(border_top_left_radius,    BorderRadiusTopLeft),
-    COMPUTED_STYLE_MAP_ENTRY_LAYOUT(border_top_right_radius,   BorderRadiusTopRight),
+    COMPUTED_STYLE_MAP_ENTRY_LAYOUT(border_bottom_left_radius, BorderBottomLeftRadius),
+    COMPUTED_STYLE_MAP_ENTRY_LAYOUT(border_bottom_right_radius,BorderBottomRightRadius),
+    COMPUTED_STYLE_MAP_ENTRY_LAYOUT(border_top_left_radius,    BorderTopLeftRadius),
+    COMPUTED_STYLE_MAP_ENTRY_LAYOUT(border_top_right_radius,   BorderTopRightRadius),
     COMPUTED_STYLE_MAP_ENTRY(box_align,                     BoxAlign),
     COMPUTED_STYLE_MAP_ENTRY(box_direction,                 BoxDirection),
     COMPUTED_STYLE_MAP_ENTRY(box_flex,                      BoxFlex),
     COMPUTED_STYLE_MAP_ENTRY(box_ordinal_group,             BoxOrdinalGroup),
     COMPUTED_STYLE_MAP_ENTRY(box_orient,                    BoxOrient),
     COMPUTED_STYLE_MAP_ENTRY(box_pack,                      BoxPack),
     COMPUTED_STYLE_MAP_ENTRY(box_shadow,                    BoxShadow),
     COMPUTED_STYLE_MAP_ENTRY(box_sizing,                    BoxSizing),
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -247,20 +247,20 @@ private:
   nsresult DoGetBorderTopColor(nsIDOMCSSValue** aValue);
   nsresult DoGetBorderBottomColor(nsIDOMCSSValue** aValue);
   nsresult DoGetBorderLeftColor(nsIDOMCSSValue** aValue);
   nsresult DoGetBorderRightColor(nsIDOMCSSValue** aValue);
   nsresult DoGetBorderBottomColors(nsIDOMCSSValue** aValue);
   nsresult DoGetBorderLeftColors(nsIDOMCSSValue** aValue);
   nsresult DoGetBorderRightColors(nsIDOMCSSValue** aValue);
   nsresult DoGetBorderTopColors(nsIDOMCSSValue** aValue);
-  nsresult DoGetBorderRadiusBottomLeft(nsIDOMCSSValue** aValue);
-  nsresult DoGetBorderRadiusBottomRight(nsIDOMCSSValue** aValue);
-  nsresult DoGetBorderRadiusTopLeft(nsIDOMCSSValue** aValue);
-  nsresult DoGetBorderRadiusTopRight(nsIDOMCSSValue** aValue);
+  nsresult DoGetBorderBottomLeftRadius(nsIDOMCSSValue** aValue);
+  nsresult DoGetBorderBottomRightRadius(nsIDOMCSSValue** aValue);
+  nsresult DoGetBorderTopLeftRadius(nsIDOMCSSValue** aValue);
+  nsresult DoGetBorderTopRightRadius(nsIDOMCSSValue** aValue);
   nsresult DoGetFloatEdge(nsIDOMCSSValue** aValue);
   nsresult DoGetBorderImage(nsIDOMCSSValue** aValue);
 
   /* Box Shadow */
   nsresult DoGetBoxShadow(nsIDOMCSSValue** aValue);
 
   /* Window Shadow */
   nsresult DoGetWindowShadow(nsIDOMCSSValue** aValue);
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -164,17 +164,17 @@ var gCSSProperties = {
 		domProp: "MozBorderLeftColors",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "none" ],
 		other_values: [ "red green", "red #fc3", "#ff00cc", "currentColor", "blue currentColor orange currentColor" ],
 		invalid_values: [ "red none", "red inherit", "red, green", "none red", "inherit red" ]
 	},
 	"border-radius": {
-		domProp: "MozBorderRadius",
+		domProp: "borderRadius",
 		inherited: false,
 		type: CSS_TYPE_TRUE_SHORTHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		subproperties: [ "border-bottom-left-radius", "border-bottom-right-radius", "border-top-left-radius", "border-top-right-radius" ],
 		initial_values: [ "0", "0px", "0%", "0px 0 0 0px", "-moz-calc(-2px)", "-moz-calc(-1%)", "-moz-calc(0px) -moz-calc(0pt) -moz-calc(0%) -moz-calc(0em)" ],
 		other_values: [ "3%", "1px", "2em", "3em 2px", "2pt 3% 4em", "2px 2px 2px 2px", // circular
 						"3% / 2%", "1px / 4px", "2em / 1em", "3em 2px / 2px 3em", "2pt 3% 4em / 4pt 1% 5em", "2px 2px 2px 2px / 4px 4px 4px 4px", "1pt / 2pt 3pt", "4pt 5pt / 3pt", // elliptical
 			"-moz-calc(2px)",
@@ -187,17 +187,17 @@ var gCSSProperties = {
 			"-moz-calc(3*25px + 50%)",
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 			"2px 2px -moz-calc(2px + 1%) 2px",
 			"1px 2px 2px 2px / 2px 2px -moz-calc(2px + 1%) 2px",
 					  ],
 		invalid_values: [ "2px -2px", "inherit 2px", "inherit / 2px", "2px inherit", "2px / inherit", "2px 2px 2px 2px 2px", "1px / 2px 2px 2px 2px 2px" ]
 	},
 	"border-bottom-left-radius": {
-		domProp: "MozBorderRadiusBottomleft",
+		domProp: "borderBottomLeftRadius",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "-moz-calc(-2px)", "-moz-calc(-1%)" ],
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
@@ -207,17 +207,17 @@ var gCSSProperties = {
 			"-moz-calc(20%) -moz-calc(3*25px)",
 			"-moz-calc(25px*3)",
 			"-moz-calc(3*25px + 50%)",
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 					  ],
 		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
 	},
 	"border-bottom-right-radius": {
-		domProp: "MozBorderRadiusBottomright",
+		domProp: "borderBottomRightRadius",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "-moz-calc(-2px)", "-moz-calc(-1%)" ],
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
@@ -227,17 +227,17 @@ var gCSSProperties = {
 			"-moz-calc(20%) -moz-calc(3*25px)",
 			"-moz-calc(25px*3)",
 			"-moz-calc(3*25px + 50%)",
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 					  ],
 		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
 	},
 	"border-top-left-radius": {
-		domProp: "MozBorderRadiusTopleft",
+		domProp: "borderTopLeftRadius",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "-moz-calc(-2px)", "-moz-calc(-1%)" ],
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",
@@ -247,17 +247,17 @@ var gCSSProperties = {
 			"-moz-calc(20%) -moz-calc(3*25px)",
 			"-moz-calc(25px*3)",
 			"-moz-calc(3*25px + 50%)",
 			"-moz-min(30%, 30em,200px, min(500px ,40em))",
 					  ],
 		invalid_values: [ "-1px", "4px -2px", "inherit 2px", "2px inherit" ]
 	},
 	"border-top-right-radius": {
-		domProp: "MozBorderRadiusTopright",
+		domProp: "borderTopRightRadius",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		prerequisites: { "width": "200px", "height": "100px", "display": "inline-block"},
 		initial_values: [ "0", "0px", "0%", "-moz-calc(-2px)", "-moz-calc(-1%)" ],
 		other_values: [ "3%", "1px", "2em", // circular
 						"3% 2%", "1px 4px", "2em 2pt", // elliptical
 			"-moz-calc(2px)",
 			"-moz-calc(50%)",