Remove unneeded (and not present in the proposed CSS3 float-displace property) border-box and padding-box values of -moz-float-edge. (Bug 432891) r+sr=roc
authorL. David Baron <dbaron@dbaron.org>
Thu, 05 Jun 2008 16:06:34 -0700
changeset 15269 dd28fa11cb15b318dcb23382837d39e5397cf4ee
parent 15268 5bd70ded7000ee913049dfc288c38e179e0fe7c2
child 15270 e30af58993281d85f149b15929f8f27c80f3f7bb
push id93
push userdbaron@mozilla.com
push dateThu, 05 Jun 2008 23:21:18 +0000
treeherdermozilla-central@e30af5899328 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs432891
milestone1.9.1a1pre
Remove unneeded (and not present in the proposed CSS3 float-displace property) border-box and padding-box values of -moz-float-edge. (Bug 432891) r+sr=roc
layout/base/nsStyleConsts.h
layout/generic/nsBlockReflowState.cpp
layout/reftests/bugs/97777-2-ref.html
layout/reftests/bugs/97777-2.html
layout/style/nsCSSProps.cpp
layout/style/test/property_database.js
--- a/layout/base/nsStyleConsts.h
+++ b/layout/base/nsStyleConsts.h
@@ -62,19 +62,17 @@
 
 // box-sizing
 #define NS_STYLE_BOX_SIZING_CONTENT       0
 #define NS_STYLE_BOX_SIZING_PADDING       1
 #define NS_STYLE_BOX_SIZING_BORDER        2
 
 // float-edge
 #define NS_STYLE_FLOAT_EDGE_CONTENT       0
-#define NS_STYLE_FLOAT_EDGE_PADDING       1
-#define NS_STYLE_FLOAT_EDGE_BORDER        2
-#define NS_STYLE_FLOAT_EDGE_MARGIN        3
+#define NS_STYLE_FLOAT_EDGE_MARGIN        1
 
 // key-equivalent
 #define NS_STYLE_KEY_EQUIVALENT_NONE      0
 
 // user-focus
 #define NS_STYLE_USER_FOCUS_NONE            0
 #define NS_STYLE_USER_FOCUS_IGNORE          1
 #define NS_STYLE_USER_FOCUS_NORMAL          2
--- a/layout/generic/nsBlockReflowState.cpp
+++ b/layout/generic/nsBlockReflowState.cpp
@@ -294,52 +294,16 @@ nsBlockReflowState::ComputeBlockAvailSpa
       switch (borderStyle->mFloatEdge) {
         default:
         case NS_STYLE_FLOAT_EDGE_CONTENT:  // content and only content does runaround of floats
           // The child block will flow around the float. Therefore
           // give it all of the available space.
           aResult.x = borderPadding.left;
           aResult.width = mContentArea.width;
           break;
-        case NS_STYLE_FLOAT_EDGE_BORDER: 
-        case NS_STYLE_FLOAT_EDGE_PADDING:
-          {
-            // The child block's border should be placed adjacent to,
-            // but not overlap the float(s).
-            nsMargin m(0, 0, 0, 0);
-            const nsStyleMargin* styleMargin = aFrame->GetStyleMargin();
-            styleMargin->GetMargin(m); // XXX percentage margins
-            if (NS_STYLE_FLOAT_EDGE_PADDING == borderStyle->mFloatEdge) {
-              // Add in border too
-              m += borderStyle->GetBorder();
-            }
-
-            // determine left edge
-            if (mBand.GetLeftFloatCount()) {
-              aResult.x = mAvailSpaceRect.x + borderPadding.left - m.left;
-            }
-            else {
-              aResult.x = borderPadding.left;
-            }
-
-            // determine width
-            if (mBand.GetRightFloatCount()) {
-              if (mBand.GetLeftFloatCount()) {
-                aResult.width = mAvailSpaceRect.width + m.left + m.right;
-              }
-              else {
-                aResult.width = mAvailSpaceRect.width + m.right;
-              }
-            }
-            else {
-              aResult.width = mAvailSpaceRect.width + m.left;
-            }
-          }
-          break;
-
         case NS_STYLE_FLOAT_EDGE_MARGIN:
           {
             // The child block's margins should be placed adjacent to,
             // but not overlap the float.
             aResult.x = mAvailSpaceRect.x + borderPadding.left;
             aResult.width = mAvailSpaceRect.width;
           }
           break;
--- a/layout/reftests/bugs/97777-2-ref.html
+++ b/layout/reftests/bugs/97777-2-ref.html
@@ -6,32 +6,16 @@
   <style type="text/css">
     table {position: absolute; border-collapse: collapse; background: #CCCCCC}
     div.sub {border: solid blue}
     p {border: solid red}
     td {padding: 0px; text-align: center}
   </style>
 </head>
 <body>
-<table style="top: 0.5em"><tr><td>
-  <p style="float: left">Float</p>
-  <div class="sub" style="-moz-float-edge: border-box">Should be shrink-wrapped [align="center", float-edge="border-box"]</div>
-</td></tr></table>
-<table style="top: 4.5em"><tr><td>
-  <p style="float: right">Float</p>
-  <div class="sub" style="-moz-float-edge: border-box">Should be shrink-wrapped [align="center", float-edge="border-box"]</div>
-</td></tr></table>
-<table style="top: 8.5em"><tr><td>
-  <p style="float: left">Float</p>
-  <div class="sub" style="-moz-float-edge: padding-box">Should be shrink-wrapped [align="center", float-edge="padding-box"]</div>
-</table>
-<table style="top: 12.5em"><tr><td>
-  <p style="float: right">Float</p>
-  <div class="sub" style="-moz-float-edge: padding-box">Should be shrink-wrapped [align="center", float-edge="padding-box"]</div>
-</table>
 <table style="top: 16.5em"><tr><td>
   <p style="float: left">Float</p>
   <div class="sub" style="-moz-float-edge: margin-box">Should be shrink-wrapped [align="center", float-edge="margin-box"]</div>
 </table>
 <table style="top: 20.5em"><tr><td>
   <p style="float: right">Float</p>
   <div class="sub" style="-moz-float-edge: margin-box">Should be shrink-wrapped [align="center", float-edge="margin-box"]</div>
 </table>
--- a/layout/reftests/bugs/97777-2.html
+++ b/layout/reftests/bugs/97777-2.html
@@ -5,32 +5,16 @@
   <title>Bug 97777-2</title>
   <style type="text/css">
     div.top {position: absolute; border: 0px; background: #CCCCCC}
     div.sub {border: solid blue}
     p {border: solid red}
   </style>
 </head>
 <body>
-<div class="top" style="top: 0.5em" align="center">
-  <p style="float: left">Float</p>
-  <div class="sub" style="-moz-float-edge: border-box">Should be shrink-wrapped [align="center", float-edge="border-box"]</div>
-</div>
-<div class="top" style="top: 4.5em" align="center">
-  <p style="float: right">Float</p>
-  <div class="sub" style="-moz-float-edge: border-box">Should be shrink-wrapped [align="center", float-edge="border-box"]</div>
-</div>
-<div class="top" style="top: 8.5em" align="center">
-  <p style="float: left">Float</p>
-  <div class="sub" style="-moz-float-edge: padding-box">Should be shrink-wrapped [align="center", float-edge="padding-box"]</div>
-</div>
-<div class="top" style="top: 12.5em" align="center">
-  <p style="float: right">Float</p>
-  <div class="sub" style="-moz-float-edge: padding-box">Should be shrink-wrapped [align="center", float-edge="padding-box"]</div>
-</div>
 <div class="top" style="top: 16.5em" align="center">
   <p style="float: left">Float</p>
   <div class="sub" style="-moz-float-edge: margin-box">Should be shrink-wrapped [align="center", float-edge="margin-box"]</div>
 </div>
 <div class="top" style="top: 20.5em" align="center">
   <p style="float: right">Float</p>
   <div class="sub" style="-moz-float-edge: margin-box">Should be shrink-wrapped [align="center", float-edge="margin-box"]</div>
 </div>
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -590,18 +590,16 @@ const PRInt32 nsCSSProps::kEmptyCellsKTa
 const PRInt32 nsCSSProps::kFloatKTable[] = {
   eCSSKeyword_left,  NS_STYLE_FLOAT_LEFT,
   eCSSKeyword_right, NS_STYLE_FLOAT_RIGHT,
   eCSSKeyword_UNKNOWN,-1
 };
 
 const PRInt32 nsCSSProps::kFloatEdgeKTable[] = {
   eCSSKeyword_content_box,  NS_STYLE_FLOAT_EDGE_CONTENT,
-  eCSSKeyword_border_box,  NS_STYLE_FLOAT_EDGE_BORDER,
-  eCSSKeyword_padding_box,  NS_STYLE_FLOAT_EDGE_PADDING,
   eCSSKeyword_margin_box,  NS_STYLE_FLOAT_EDGE_MARGIN,
   eCSSKeyword_UNKNOWN,-1
 };
 
 const PRInt32 nsCSSProps::kFontKTable[] = {
   // CSS2.
   eCSSKeyword_caption, NS_STYLE_FONT_CAPTION,
   eCSSKeyword_icon, NS_STYLE_FONT_ICON,
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -335,17 +335,17 @@ var gCSSProperties = {
 		other_values: [ "15px", "50%" ],
 		invalid_values: [ "20", "-1px" ]
 	},
 	"-moz-float-edge": {
 		domProp: "MozFloatEdge",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "content-box" ],
-		other_values: [ "border-box", "padding-box", "margin-box" ],
+		other_values: [ "margin-box" ],
 		invalid_values: [ "content", "padding", "border", "margin" ]
 	},
 	"-moz-force-broken-image-icon": {
 		domProp: "MozForceBrokenImageIcon",
 		inherited: false,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "0" ],
 		other_values: [ "1" ],