Bug 680077 - Define documenttab dimensions on constructor (r=mbrubeck)
☠☠ backed out by 4be2da039559 ☠ ☠
authorLucas Rocha <lucasr@mozilla.com>
Wed, 07 Sep 2011 13:47:37 -0700
changeset 76650 84c0fbc1cf1d72b08db5a7bca29a2e2696b51d24
parent 76649 8d3475475a0be3a6ff752e6f9d4cda7469734863
child 76651 b7d269a291b6f91a20958011d610cf8d443bd685
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmbrubeck
bugs680077
milestone9.0a1
Bug 680077 - Define documenttab dimensions on constructor (r=mbrubeck) So that they can be dynamically defined for different modes (e.g. tablets).
mobile/chrome/content/tabs.xml
--- a/mobile/chrome/content/tabs.xml
+++ b/mobile/chrome/content/tabs.xml
@@ -4,29 +4,45 @@
     xmlns="http://www.mozilla.org/xbl"
     xmlns:xbl="http://www.mozilla.org/xbl"
     xmlns:html="http://www.w3.org/1999/xhtml"
     xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <binding id="documenttab">
     <content>
       <xul:stack anonid="page" class="documenttab-container" flex="1">
-        <html:canvas anonid="thumbnail" class="documenttab-thumbnail" left="0" width="104" height="65" moz-opaque="true" empty="true"
+        <html:canvas anonid="thumbnail" class="documenttab-thumbnail" left="0" moz-opaque="true" empty="true"
           onclick="document.getBindingParent(this)._onClick()"/>
-        <xul:hbox class="documenttab-reload" left="0" top="0" width="104" height="65" onclick="document.getBindingParent(this)._onUndo();"/>
-        <xul:hbox class="documenttab-close-container" start="-16" top="0" height="65" width="55" align="center" onclick="document.getBindingParent(this)._onClose()">
+        <xul:hbox anonid="reload" class="documenttab-reload" left="0" top="0" onclick="document.getBindingParent(this)._onUndo();"/>
+        <xul:hbox anonid="close-container" class="documenttab-close-container" start="-16" top="0" align="center" onclick="document.getBindingParent(this)._onClose()">
           <xul:image anonid="close" class="documenttab-close" mousethrough="always"/>
         </xul:hbox>
       </xul:stack>
     </content>
 
     <implementation>
       <field name="ignoreUndo">false</field>
-      <field name="thumbnail">document.getAnonymousElementByAttribute(this, "anonid", "thumbnail");</field>
-      <field name="_container">this.parentNode.parentNode;</field>
+      <field name="thumbnail" readonly="true">document.getAnonymousElementByAttribute(this, "anonid", "thumbnail");</field>
+      <field name="_reload" readonly="true">document.getAnonymousElementByAttribute(this, "anonid", "reload");</field>
+      <field name="_closeContainer" readonly="true">document.getAnonymousElementByAttribute(this, "anonid", "close-container");</field>
+      <field name="_container" readonly="true">this.parentNode.parentNode;</field>
+
+      <constructor>
+        <![CDATA[
+          let thumbnail = this.thumbnail;
+          let reload = this._reload;
+          let closeContainer = this._closeContainer;
+
+          thumbnail.width = reload.width = 104;
+          thumbnail.height = reload.height = 65;
+          closeContainer.width = 55;
+          closeContainer.height = 65;
+        ]]>
+      </constructor>
+
       <method name="_onClick">
         <body>
           <![CDATA[
             this._container.selectedTab = this;
 
             let selectFn = new Function("event", this._container.parentNode.getAttribute("onselect"));
             selectFn.call(this);
           ]]>