Bug 672254, allow content inside an arrowpanel to be flexible, r=neil
authorNeil Deakin <neil@mozilla.com>
Wed, 10 Aug 2011 15:51:25 -0400
changeset 74223 968dee8a144a3e7802a4ba551d912e44f3d3ded0
parent 74222 b7d5fd20d40a5807ef342c458e8cf6bfd40f9115
child 74224 e69bb10026f312104873d0ec112dc552c92257d5
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersneil
bugs672254
milestone8.0a1
Bug 672254, allow content inside an arrowpanel to be flexible, r=neil
toolkit/content/tests/chrome/test_arrowpanel.xul
toolkit/content/widgets/popup.xml
--- a/toolkit/content/tests/chrome/test_arrowpanel.xul
+++ b/toolkit/content/tests/chrome/test_arrowpanel.xul
@@ -22,16 +22,20 @@
   <iframe id="frame" type="content"
           src="data:text/html,&lt;input id='input'&gt;" width="100" height="100" left="225" top="120"/>
 </stack>
 
 <panel id="panel" type="arrow" onpopupshown="checkPanelPosition(this)" onpopuphidden="runNextTest.next()">
   <label id="panellabel" value="This is some text." height="65"/>
 </panel>
 
+<panel id="bigpanel" type="arrow" onpopupshown="checkBigPanel(this)" onpopuphidden="SimpleTest.finish()">
+  <button label="This is some text." height="3000"/>
+</panel>
+
 <script type="application/javascript">
 <![CDATA[
 
 SimpleTest.waitForExplicitFinish();
 
 var expectedAnchor = null;
 var expectedSide = "", expectedAnchorEdge = "";
 var zoomFactor = 1;
@@ -131,16 +135,19 @@ function nextTest()
 
   setScale(frames[0], 2.5);
   openPopup("before_start", frames[0].document.getElementById("input"), "bottom", "left");
   yield;
 
   setScale(frames[0], 1);
 */
 
+  $("bigpanel").openPopup($("topleft"), "after_start", 0, 0, false, false, null);
+  yield;
+
   SimpleTest.finish();
   yield;
 }
 
 function setScale(win, scale)
 {
   var wn = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
               .getInterface(Components.interfaces.nsIWebNavigation);
@@ -215,16 +222,22 @@ function checkPanelPosition(panel)
 
   var arrow = document.getAnonymousElementByAttribute(panel, "anonid", "arrow");
   is(arrow.getAttribute("side"), expectedSide, "panel arrow side");
   is(arrow.hidden, false, "panel hidden");
 
   panel.hidePopup();
 }
 
+function checkBigPanel(panel)
+{
+  ok(panel.firstChild.getBoundingClientRect().height < 2800, "big panel height");
+  panel.hidePopup();
+}
+
 SimpleTest.waitForFocus(startTest);
 
 ]]>
 </script>
 
 <body xmlns="http://www.w3.org/1999/xhtml"/>
 
 </window>
--- a/toolkit/content/widgets/popup.xml
+++ b/toolkit/content/widgets/popup.xml
@@ -297,22 +297,22 @@
           }
         }
       ]]></handler>
     </handlers>
   </binding>
 
   <binding id="arrowpanel" extends="chrome://global/content/bindings/popup.xml#panel">
     <content flip="both" side="top" position="bottomcenter topleft">
-      <xul:box anonid="container" class="panel-arrowcontainer">
+      <xul:box anonid="container" class="panel-arrowcontainer" flex="1">
         <xul:box anonid="arrowbox" class="panel-arrowbox">
           <xul:image anonid="arrow" class="panel-arrow"/>
         </xul:box>
-        <xul:box class="panel-arrowcontent">
-          <xul:box class="panel-inner-arrowcontent" xbl:inherits="align,dir,orient,pack">
+        <xul:box class="panel-arrowcontent" flex="1">
+          <xul:box class="panel-inner-arrowcontent" xbl:inherits="align,dir,orient,pack" flex="1">
             <children/>
             <xul:box class="panel-inner-arrowcontentfooter" xbl:inherits="footertype" hidden="true"/>
           </xul:box>
         </xul:box>
       </xul:box>
     </content>
     <implementation>
       <field name="_fadeTimer"/>