Make nsBox more careful about accepting XUL attributes only on XUL elements. (Bug 102440) r=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Fri, 22 Apr 2011 18:36:24 -0700
changeset 68454 5b0b236704da24b5cd627d6d1146d783b38c1969
parent 68453 5e93d760e31de3249a82ef8c156e00c1f3401838
child 68455 b3d5c9a7a5e5dcf80cc4b64693998506d3ae1bb4
push id19647
push userdbaron@mozilla.com
push dateSat, 23 Apr 2011 01:41:58 +0000
treeherdermozilla-central@b7b5af018848 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs102440
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Make nsBox more careful about accepting XUL attributes only on XUL elements. (Bug 102440) r=bzbarsky
browser/base/content/urlbarBindings.xml
layout/reftests/flexbox/flexbox-attributes-no-box-horizontal-ref.xhtml
layout/reftests/flexbox/flexbox-attributes-no-box-horizontal.xhtml
layout/reftests/flexbox/flexbox-attributes-no-box-vertical-ref.xhtml
layout/reftests/flexbox/flexbox-attributes-no-box-vertical.xhtml
layout/reftests/flexbox/flexbox-attributes-no-input-horizontal-ref.xhtml
layout/reftests/flexbox/flexbox-attributes-no-input-horizontal.xhtml
layout/reftests/flexbox/flexbox-attributes-no-input-vertical-ref.xhtml
layout/reftests/flexbox/flexbox-attributes-no-input-vertical.xhtml
layout/reftests/flexbox/reftest.list
layout/reftests/reftest.list
layout/xul/base/src/nsBox.cpp
toolkit/content/menulist.css
toolkit/content/textbox.css
toolkit/content/widgets/autocomplete.xml
toolkit/content/widgets/datetimepicker.xml
toolkit/content/widgets/menulist.xml
toolkit/content/widgets/numberbox.xml
toolkit/content/widgets/textbox.xml
xpfe/components/autocomplete/resources/content/autocomplete.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -59,17 +59,17 @@
           <xul:image class="autocomplete-icon" allowevents="true"/>
         </children>
         <xul:hbox anonid="textbox-input-box"
                   class="textbox-input-box urlbar-input-box"
                   flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
           <children/>
           <html:input anonid="input"
                       class="autocomplete-textbox urlbar-input textbox-input uri-element-right-align"
-                      flex="1" allowevents="true"
+                      allowevents="true"
                       xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
         </xul:hbox>
         <children includes="hbox"/>
       </xul:hbox>
       <xul:dropmarker anonid="historydropmarker"
                       class="autocomplete-history-dropmarker urlbar-history-dropmarker"
                       allowevents="true"
                       xbl:inherits="open,enablehistory,parentfocused=focused"/>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-attributes-no-box-horizontal-ref.xhtml
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Test that XUL attributes are not supported on non-XUL elements</title>
+<style type="text/css">
+<![CDATA[
+
+html, body {
+  display: -moz-box;
+  margin: 0; padding: 0;
+  width: 100%; height: 100%;
+}
+
+body > div {
+  display: -moz-box;
+  background: yellow;
+  -moz-box-flex: 1;
+  -moz-box-orient: horizontal;
+}
+
+div > div {
+  display: -moz-box;
+  -moz-box-flex: 1;
+  border: 1px solid blue;
+}
+
+]]>
+</style>
+</head>
+<body>
+<div>
+  <div>2</div>
+  <div>1</div>
+  <div>width</div>
+  <div>height</div>
+  <div>minwidth</div>
+  <div>minheight</div>
+  <div>maxwidth</div>
+  <div>maxheight</div>
+  <div>flex</div>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-attributes-no-box-horizontal.xhtml
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Test that XUL attributes are not supported on non-XUL elements</title>
+<style type="text/css">
+<![CDATA[
+
+html, body {
+  display: -moz-box;
+  margin: 0; padding: 0;
+  width: 100%; height: 100%;
+}
+
+body > div {
+  display: -moz-box;
+  background: yellow;
+  -moz-box-flex: 1;
+  -moz-box-orient: horizontal;
+}
+
+div > div {
+  display: -moz-box;
+  -moz-box-flex: 1;
+  border: 1px solid blue;
+}
+
+]]>
+</style>
+</head>
+<body>
+<div>
+  <div ordinal="2">2</div>
+  <div ordinal="1">1</div>
+  <div width="100">width</div>
+  <div height="100">height</div>
+  <div minwidth="100">minwidth</div>
+  <div minheight="100">minheight</div>
+  <div maxwidth="50">maxwidth</div>
+  <div maxheight="15">maxheight</div>
+  <div flex="100">flex</div>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-attributes-no-box-vertical-ref.xhtml
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Test that XUL attributes are not supported on non-XUL elements</title>
+<style type="text/css">
+<![CDATA[
+
+html, body {
+  display: -moz-box;
+  margin: 0; padding: 0;
+  width: 100%; height: 100%;
+}
+
+body > div {
+  display: -moz-box;
+  background: yellow;
+  -moz-box-flex: 1;
+  -moz-box-orient: vertical;
+}
+
+div > div {
+  display: -moz-box;
+  -moz-box-flex: 1;
+  border: 1px solid blue;
+}
+
+]]>
+</style>
+</head>
+<body>
+<div>
+  <div>2</div>
+  <div>1</div>
+  <div>width</div>
+  <div>height</div>
+  <div>minwidth</div>
+  <div>minheight</div>
+  <div>maxwidth</div>
+  <div>maxheight</div>
+  <div>flex</div>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-attributes-no-box-vertical.xhtml
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Test that XUL attributes are not supported on non-XUL elements</title>
+<style type="text/css">
+<![CDATA[
+
+html, body {
+  display: -moz-box;
+  margin: 0; padding: 0;
+  width: 100%; height: 100%;
+}
+
+body > div {
+  display: -moz-box;
+  background: yellow;
+  -moz-box-flex: 1;
+  -moz-box-orient: vertical;
+}
+
+div > div {
+  display: -moz-box;
+  -moz-box-flex: 1;
+  border: 1px solid blue;
+}
+
+]]>
+</style>
+</head>
+<body>
+<div>
+  <div ordinal="2">2</div>
+  <div ordinal="1">1</div>
+  <div width="100">width</div>
+  <div height="100">height</div>
+  <div minwidth="100">minwidth</div>
+  <div minheight="100">minheight</div>
+  <div maxwidth="50">maxwidth</div>
+  <div maxheight="15">maxheight</div>
+  <div flex="100">flex</div>
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-attributes-no-input-horizontal-ref.xhtml
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Test that XUL attributes are not supported on non-XUL elements</title>
+<style type="text/css">
+<![CDATA[
+
+html, body {
+  display: -moz-box;
+  margin: 0; padding: 0;
+  width: 100%; height: 100%;
+}
+
+body > div {
+  display: -moz-box;
+  background: yellow;
+  -moz-box-flex: 1;
+  -moz-box-orient: horizontal;
+}
+
+]]>
+</style>
+</head>
+<body>
+<div>
+  <input type="text" value="2" />
+  <input type="text" value="1" />
+  <input type="text" value="width" />
+  <input type="text" value="height" />
+  <input type="text" value="minwidth" />
+  <input type="text" value="minheight" />
+  <input type="text" value="maxwidth" />
+  <input type="text" value="maxheight" />
+  <input type="text" value="flex" />
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-attributes-no-input-horizontal.xhtml
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Test that XUL attributes are not supported on non-XUL elements</title>
+<style type="text/css">
+<![CDATA[
+
+html, body {
+  display: -moz-box;
+  margin: 0; padding: 0;
+  width: 100%; height: 100%;
+}
+
+body > div {
+  display: -moz-box;
+  background: yellow;
+  -moz-box-flex: 1;
+  -moz-box-orient: horizontal;
+}
+
+]]>
+</style>
+</head>
+<body>
+<div>
+  <input type="text" ordinal="2" value="2" />
+  <input type="text" ordinal="1" value="1" />
+  <input type="text" width="100" value="width" />
+  <input type="text" height="100" value="height" />
+  <input type="text" minwidth="100" value="minwidth" />
+  <input type="text" minheight="100" value="minheight" />
+  <input type="text" maxwidth="50" value="maxwidth" />
+  <input type="text" maxheight="15" value="maxheight" />
+  <input type="text" flex="100" value="flex" />
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-attributes-no-input-vertical-ref.xhtml
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Test that XUL attributes are not supported on non-XUL elements</title>
+<style type="text/css">
+<![CDATA[
+
+html, body {
+  display: -moz-box;
+  margin: 0; padding: 0;
+  width: 100%; height: 100%;
+}
+
+body > div {
+  display: -moz-box;
+  background: yellow;
+  -moz-box-flex: 1;
+  -moz-box-orient: vertical;
+}
+
+]]>
+</style>
+</head>
+<body>
+<div>
+  <input type="text" value="2" />
+  <input type="text" value="1" />
+  <input type="text" value="width" />
+  <input type="text" value="height" />
+  <input type="text" value="minwidth" />
+  <input type="text" value="minheight" />
+  <input type="text" value="maxwidth" />
+  <input type="text" value="maxheight" />
+  <input type="text" value="flex" />
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-attributes-no-input-vertical.xhtml
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Test that XUL attributes are not supported on non-XUL elements</title>
+<style type="text/css">
+<![CDATA[
+
+html, body {
+  display: -moz-box;
+  margin: 0; padding: 0;
+  width: 100%; height: 100%;
+}
+
+body > div {
+  display: -moz-box;
+  background: yellow;
+  -moz-box-flex: 1;
+  -moz-box-orient: vertical;
+}
+
+]]>
+</style>
+</head>
+<body>
+<div>
+  <input type="text" ordinal="2" value="2" />
+  <input type="text" ordinal="1" value="1" />
+  <input type="text" width="100" value="width" />
+  <input type="text" height="100" value="height" />
+  <input type="text" minwidth="100" value="minwidth" />
+  <input type="text" minheight="100" value="minheight" />
+  <input type="text" maxwidth="50" value="maxwidth" />
+  <input type="text" maxheight="5" value="maxheight" />
+  <input type="text" flex="100" value="flex" />
+</div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/flexbox/reftest.list
@@ -0,0 +1,4 @@
+== flexbox-attributes-no-box-horizontal.xhtml flexbox-attributes-no-box-horizontal-ref.xhtml
+== flexbox-attributes-no-box-vertical.xhtml flexbox-attributes-no-box-vertical-ref.xhtml
+== flexbox-attributes-no-input-horizontal.xhtml flexbox-attributes-no-input-horizontal-ref.xhtml
+== flexbox-attributes-no-input-vertical.xhtml flexbox-attributes-no-input-vertical-ref.xhtml
--- a/layout/reftests/reftest.list
+++ b/layout/reftests/reftest.list
@@ -129,16 +129,19 @@ include editor/reftest.list
 include generated-content/reftest.list
 
 # first-letter/
 skip-if(Android) include first-letter/reftest.list
 
 # first-line/
 include first-line/reftest.list
 
+# flexbox/
+include flexbox/reftest.list
+
 # floats/
 include floats/reftest.list
 
 # font-face
 include font-face/reftest.list
 
 # font features (opentype)
 include font-features/reftest.list
--- a/layout/xul/base/src/nsBox.cpp
+++ b/layout/xul/base/src/nsBox.cpp
@@ -513,17 +513,17 @@ nsBox::GetFlex(nsBoxLayoutState& aState)
 
 PRUint32
 nsIFrame::GetOrdinal(nsBoxLayoutState& aState)
 {
   PRUint32 ordinal = GetStyleXUL()->mBoxOrdinal;
 
   // When present, attribute value overrides CSS.
   nsIContent* content = GetContent();
-  if (content) {
+  if (content && content->IsXUL()) {
     PRInt32 error;
     nsAutoString value;
 
     content->GetAttr(kNameSpaceID_None, nsGkAtoms::ordinal, value);
     if (!value.IsEmpty()) {
       ordinal = value.ToInteger(&error);
     }
   }
@@ -807,17 +807,17 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& 
           "Non-zero percentage values not currently supported");
         aSize.height = 0;
         aHeightSet = PR_TRUE; // FIXME: should we really do this for
                               // nonzero values?
     }
     // calc() with percentage is treated like '0' (unset)
 
     nsIContent* content = aBox->GetContent();
-    if (content) {
+    if (content && content->IsXUL()) {
         nsAutoString value;
         PRInt32 error;
 
         content->GetAttr(kNameSpaceID_None, nsGkAtoms::minwidth, value);
         if (!value.IsEmpty())
         {
             value.Trim("%");
 
@@ -870,17 +870,17 @@ nsIBox::AddCSSMaxSize(nsIBox* aBox, nsSi
     const nsStyleCoord &maxHeight = position->mMaxHeight;
     if (maxHeight.ConvertsToLength()) {
         aSize.height = nsRuleNode::ComputeCoordPercentCalc(maxHeight, 0);
         aHeightSet = PR_TRUE;
     }
     // percentages and calc() with percentages are treated like 'none'
 
     nsIContent* content = aBox->GetContent();
-    if (content) {
+    if (content && content->IsXUL()) {
         nsAutoString value;
         PRInt32 error;
 
         content->GetAttr(kNameSpaceID_None, nsGkAtoms::maxwidth, value);
         if (!value.IsEmpty()) {
             value.Trim("%");
 
             nscoord val =
@@ -905,44 +905,38 @@ nsIBox::AddCSSMaxSize(nsIBox* aBox, nsSi
 }
 
 PRBool
 nsIBox::AddCSSFlex(nsBoxLayoutState& aState, nsIBox* aBox, nscoord& aFlex)
 {
     PRBool flexSet = PR_FALSE;
 
     // get the flexibility
+    aFlex = aBox->GetStyleXUL()->mBoxFlex;
+
+    // attribute value overrides CSS
     nsIContent* content = aBox->GetContent();
-    if (content) {
+    if (content && content->IsXUL()) {
         PRInt32 error;
         nsAutoString value;
 
         content->GetAttr(kNameSpaceID_None, nsGkAtoms::flex, value);
         if (!value.IsEmpty()) {
             value.Trim("%");
             aFlex = value.ToInteger(&error);
             flexSet = PR_TRUE;
         }
-        else {
-          // No attribute value.  Check CSS.
-          const nsStyleXUL* boxInfo = aBox->GetStyleXUL();
-          if (boxInfo->mBoxFlex > 0.0f) {
-            // The flex was defined in CSS.
-            aFlex = (nscoord)boxInfo->mBoxFlex;
-            flexSet = PR_TRUE;
-          }
-        }
     }
 
     if (aFlex < 0)
       aFlex = 0;
     if (aFlex >= nscoord_MAX)
       aFlex = nscoord_MAX - 1;
 
-    return flexSet;
+    return flexSet || aFlex > 0;
 }
 
 void
 nsBox::AddBorderAndPadding(nsSize& aSize)
 {
   AddBorderAndPadding(this, aSize);
 }
 
--- a/toolkit/content/menulist.css
+++ b/toolkit/content/menulist.css
@@ -1,6 +1,7 @@
 @namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */
 
 html|*.menulist-editable-input {
   -moz-appearance: none !important;
   background: transparent ! important;
+  -moz-box-flex: 1;
 }
--- a/toolkit/content/textbox.css
+++ b/toolkit/content/textbox.css
@@ -1,22 +1,24 @@
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
 @namespace html url("http://www.w3.org/1999/xhtml"); /* namespace for HTML elements */
 
 html|*.textbox-input {
   -moz-appearance: none !important;
   text-align: inherit;
   text-shadow: inherit;
   -moz-box-sizing: border-box;
+  -moz-box-flex: 1;
 }
 
 html|*.textbox-textarea {
   -moz-appearance: none !important;
   text-shadow: inherit;
   -moz-box-sizing: border-box;
+  -moz-box-flex: 1;
 }
 
 /*
 html|*.textbox-input:-moz-placeholder,
 html|*.textbox-textarea:-moz-placeholder {
   text-align: left;
   direction: ltr;
 }
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -64,17 +64,17 @@
       <xul:hbox class="autocomplete-textbox-container" flex="1" xbl:inherits="focused">
         <children includes="image|deck|stack|box">
           <xul:image class="autocomplete-icon" allowevents="true"/>
         </children>
 
         <xul:hbox anonid="textbox-input-box" class="textbox-input-box" flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
           <children/>
           <html:input anonid="input" class="autocomplete-textbox textbox-input"
-                      flex="1" allowevents="true"
+                      allowevents="true"
                       xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint"/>
         </xul:hbox>
         <children includes="hbox"/>
       </xul:hbox>
 
       <xul:dropmarker anonid="historydropmarker" class="autocomplete-history-dropmarker"
                       allowevents="true"
                       xbl:inherits="open,enablehistory,parentfocused=focused"/>
--- a/toolkit/content/widgets/datetimepicker.xml
+++ b/toolkit/content/widgets/datetimepicker.xml
@@ -57,34 +57,34 @@
       <stylesheet src="chrome://global/skin/datetimepicker.css"/>
     </resources>
 
     <content align="center">
       <xul:hbox class="datetimepicker-input-box" align="center"
                 xbl:inherits="context">
         <xul:hbox class="textbox-input-box datetimepicker-input-subbox" align="center">
           <html:input class="datetimepicker-input textbox-input" anonid="input-one"
-                      size="2" maxlength="2" flex="1"
+                      size="2" maxlength="2"
                       xbl:inherits="disabled,readonly"/>
         </xul:hbox>
         <xul:label anonid="sep-first" class="datetimepicker-separator" value=":"/>
         <xul:hbox class="textbox-input-box datetimepicker-input-subbox" align="center">
           <html:input class="datetimepicker-input textbox-input" anonid="input-two"
-                      size="2" maxlength="2" flex="1"
+                      size="2" maxlength="2"
                       xbl:inherits="disabled,readonly"/>
         </xul:hbox>
         <xul:label anonid="sep-second" class="datetimepicker-separator" value=":"/>
         <xul:hbox class="textbox-input-box datetimepicker-input-subbox" align="center">
           <html:input class="datetimepicker-input textbox-input" anonid="input-three"
-                      size="2" maxlength="2" flex="1"
+                      size="2" maxlength="2"
                       xbl:inherits="disabled,readonly"/>
         </xul:hbox>
         <xul:hbox class="textbox-input-box datetimepicker-input-subbox" align="center">
           <html:input class="datetimepicker-input textbox-input" anonid="input-ampm"
-                      size="2" maxlength="2" flex="1"
+                      size="2" maxlength="2"
                       xbl:inherits="disabled,readonly"/>
         </xul:hbox>
       </xul:hbox>
       <xul:spinbuttons anonid="buttons" xbl:inherits="disabled"
                        onup="this.parentNode._increaseOrDecrease(1);"
                        ondown="this.parentNode._increaseOrDecrease(-1);"/>
     </content>
 
@@ -1239,34 +1239,34 @@
 
   <binding id="datepicker-popup" display="xul:menu"
            extends="chrome://global/content/bindings/datetimepicker.xml#datepicker">
     <content align="center">
       <xul:hbox class="textbox-input-box datetimepicker-input-box" align="center"
                 allowevents="true" xbl:inherits="context">
         <xul:hbox class="datetimepicker-input-subbox" align="baseline">
           <html:input class="datetimepicker-input textbox-input" anonid="input-one"
-                      size="2" maxlength="2" flex="1"
+                      size="2" maxlength="2"
                       xbl:inherits="disabled,readonly"/>
         </xul:hbox>
         <xul:label anonid="sep-first" class="datetimepicker-separator" value=":"/>
         <xul:hbox class="datetimepicker-input-subbox" align="baseline">
           <html:input class="datetimepicker-input textbox-input" anonid="input-two"
-                      size="2" maxlength="2" flex="1"
+                      size="2" maxlength="2"
                       xbl:inherits="disabled,readonly"/>
         </xul:hbox>
         <xul:label anonid="sep-second" class="datetimepicker-separator" value=":"/>
         <xul:hbox class="datetimepicker-input-subbox" align="center">
           <html:input class="datetimepicker-input textbox-input" anonid="input-three"
-                      size="2" maxlength="2" flex="1"
+                      size="2" maxlength="2"
                       xbl:inherits="disabled,readonly"/>
         </xul:hbox>
         <xul:hbox class="datetimepicker-input-subbox" align="center">
           <html:input class="datetimepicker-input textbox-input" anonid="input-ampm"
-                      size="2" maxlength="2" flex="1"
+                      size="2" maxlength="2"
                       xbl:inherits="disabled,readonly"/>
         </xul:hbox>
       </xul:hbox>
       <xul:spinbuttons anonid="buttons" xbl:inherits="disabled" allowevents="true"
                        onup="this.parentNode._increaseOrDecrease(1);"
                        ondown="this.parentNode._increaseOrDecrease(-1);"/>
       <xul:dropmarker class="datepicker-dropmarker" xbl:inherits="disabled"/>
       <xul:panel onpopupshown="this.firstChild.focus();" level="top">
--- a/toolkit/content/widgets/menulist.xml
+++ b/toolkit/content/widgets/menulist.xml
@@ -406,17 +406,17 @@
         ]]>
       </destructor>
     </implementation>
   </binding>
 
   <binding id="menulist-editable" extends="chrome://global/content/bindings/menulist.xml#menulist">
     <content sizetopopup="pref">
       <xul:hbox class="menulist-editable-box textbox-input-box" xbl:inherits="context,disabled,readonly,focused" flex="1">
-        <html:input class="menulist-editable-input" flex="1" anonid="input" allowevents="true"
+        <html:input class="menulist-editable-input" anonid="input" allowevents="true"
                     xbl:inherits="value=label,value,disabled,tabindex,readonly,placeholder"/>
       </xul:hbox>
       <xul:dropmarker class="menulist-dropmarker" type="menu"
                       xbl:inherits="open,disabled,parentfocused=focused"/>
       <children includes="menupopup"/>
     </content>
 
     <implementation>
--- a/toolkit/content/widgets/numberbox.xml
+++ b/toolkit/content/widgets/numberbox.xml
@@ -10,17 +10,17 @@
            extends="chrome://global/content/bindings/textbox.xml#textbox">
 
     <resources>
       <stylesheet src="chrome://global/skin/numberbox.css"/>
     </resources>
 
     <content>
       <xul:hbox class="textbox-input-box numberbox-input-box" flex="1" xbl:inherits="context,disabled,focused">
-        <html:input class="numberbox-input textbox-input" flex="1" anonid="input"
+        <html:input class="numberbox-input textbox-input" anonid="input"
                     xbl:inherits="onfocus,onblur,value,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
       </xul:hbox>
       <xul:spinbuttons anonid="buttons" xbl:inherits="disabled,hidden=hidespinbuttons"/>
     </content>
 
     <implementation>
       <field name="_valueEntered">false</field>
       <field name="_spinButtons">null</field>
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -15,17 +15,17 @@
     <resources>
       <stylesheet src="chrome://global/content/textbox.css"/>
       <stylesheet src="chrome://global/skin/textbox.css"/>
     </resources>
 
     <content>
       <children/>
       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck">
-        <html:input class="textbox-input" flex="1" anonid="input"
+        <html:input class="textbox-input" anonid="input"
                     xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,noinitialfocus,mozactionhint,spellcheck"/>
       </xul:hbox>
     </content>
 
     <implementation implements="nsIAccessibleProvider, nsIDOMXULTextBoxElement, nsIDOMXULLabeledControlElement">
       <property name="accessibleType" readonly="true">
         <getter>
           <![CDATA[
@@ -302,17 +302,17 @@
       </handler>
     </handlers>
   </binding>
 
   <binding id="search-textbox" extends="chrome://global/content/bindings/textbox.xml#textbox">
     <content>
       <children/>
       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck" align="center">
-        <html:input class="textbox-input" flex="1" anonid="input" mozactionhint="search"
+        <html:input class="textbox-input" anonid="input" mozactionhint="search"
                     xbl:inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint,spellcheck"/>
         <xul:deck class="textbox-search-icons" anonid="search-icons">
           <xul:image class="textbox-search-icon"
                      onclick="document.getBindingParent(this)._iconClick();"
                      xbl:inherits="src=image,searchbutton,disabled"/>
           <xul:image class="textbox-search-clear"
                      onclick="document.getBindingParent(this)._clearSearch();"
                      xbl:inherits="disabled"/>
@@ -429,17 +429,17 @@
         ]]>
       </handler>
     </handlers>
   </binding>
 
   <binding id="textarea" extends="chrome://global/content/bindings/textbox.xml#textbox">
     <content>
       <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,spellcheck">
-        <html:textarea class="textbox-textarea" flex="1" anonid="input"
+        <html:textarea class="textbox-textarea" anonid="input"
                        xbl:inherits="onfocus,onblur,xbl:text=value,disabled,tabindex,rows,cols,readonly,wrap,placeholder,mozactionhint,spellcheck"><children/></html:textarea>
       </xul:hbox>
     </content>
   </binding>
 
   <binding id="input-box">
     <content context="_child">
       <children/>
--- a/xpfe/components/autocomplete/resources/content/autocomplete.xml
+++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml
@@ -17,17 +17,17 @@
       <xul:hbox class="autocomplete-textbox-container" flex="1" align="center">
         <children includes="image|deck|stack|box">
           <xul:image class="autocomplete-icon" allowevents="true"/>
         </children>
 
         <xul:hbox class="textbox-input-box" flex="1" xbl:inherits="context,tooltiptext=inputtooltiptext">
           <children/>
           <html:input anonid="input" class="autocomplete-textbox textbox-input"
-                      flex="1" allowevents="true"
+                      allowevents="true"
                       xbl:inherits="tooltiptext=inputtooltiptext,onfocus,onblur,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint,userAction"/>
         </xul:hbox>
         <children includes="hbox"/>
       </xul:hbox>
 
       <xul:dropmarker class="autocomplete-history-dropmarker" allowevents="true"
                       xbl:inherits="open,enablehistory" anonid="historydropmarker"/>