Bug 848939 - De-field videocontrols.xml. r=dao
☠☠ backed out by a58872e5c1bb ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Mon, 18 Mar 2013 20:32:01 -0700
changeset 125351 01207a5deca5dcd068639557e66709ed7b5c9ebd
parent 125350 34e30f1b46d86a2615f5e66e99f63c9a67a1c160
child 125352 254cde8d39744f5a785ff253e6d2fe077efd86d6
push id24886
push userbobbyholley@gmail.com
push dateTue, 19 Mar 2013 03:34:10 +0000
treeherdermozilla-inbound@254cde8d3974 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs848939
milestone22.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
Bug 848939 - De-field videocontrols.xml. r=dao
toolkit/content/widgets/videocontrols.xml
--- a/toolkit/content/widgets/videocontrols.xml
+++ b/toolkit/content/widgets/videocontrols.xml
@@ -21,17 +21,16 @@
       <xbl:content xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
           <xbl:children/>
           <hbox class="timeThumb" xbl:inherits="showhours">
               <label class="timeLabel"/>
           </hbox>
       </xbl:content>
       <implementation>
 
-      <field name="timeLabel">null</field>
       <constructor>
           <![CDATA[
           this.timeLabel = document.getAnonymousElementByAttribute(this, "class", "timeLabel");
           this.timeLabel.setAttribute("value", "0:00");
           ]]>
       </constructor>
 
       <property name="showHours">
@@ -94,28 +93,24 @@
           var currTime = this.thumb.timeLabel.getAttribute("value");
           var totalTime = this.durationValue;
 
           return this.scrubberNameFormat.replace(/#1/, currTime).
               replace(/#2/, totalTime);
         </getter>
       </property>
 
-      <!-- Public -->
-      <field name="scrubberNameFormat">"&scrubberScale.nameFormat;"</field>
-      <field name="durationValue">""</field>
-
-      <field name="thumb">null</field>
-      <field name="valueBar">null</field>
-      <field name="isDragging">false</field>
-      <field name="wasPausedBeforeDrag">true</field>
-      <field name="type">null</field>
-      <field name="Utils">null</field>
       <constructor>
           <![CDATA[
+          this.scrubberNameFormat = ]]>"&scrubberScale.nameFormat;"<![CDATA[;
+          this.durationValue = "";
+          this.valueBar = null;
+          this.isDragging = false;
+          this.wasPausedBeforeDrag = true;
+
           this.thumb = document.getAnonymousElementByAttribute(this, "class", "scale-thumb");
           this.type = this.getAttribute("class");
           this.Utils = document.getBindingParent(this.parentNode).Utils;
           if (this.type == "scrubber")
               this.valueBar = this.Utils.progressBar;
           ]]>
       </constructor>
 
@@ -307,24 +302,20 @@
             </vbox>
         </stack>
     </xbl:content>
 
     <implementation>
 
         <constructor>
             <![CDATA[
-            this.Utils.init(this);
-            ]]>
-        </constructor>
+            this.isTouchControl = false;
+            this.randomID = 0;
 
-        <field name="randomID">0</field>
-
-        <field name="Utils">
-            <![CDATA[ ({
+            this.Utils = {
                 debug : false,
                 video : null,
                 videocontrols : null,
                 controlBar : null,
                 playButton : null,
                 muteButton : null,
                 volumeStack    : null,
                 volumeControl  : null,
@@ -1431,20 +1422,29 @@
                     }
 
                     addListener(this.videocontrols, "transitionend", this.onTransitionEnd);
                     addListener(this.video.ownerDocument, "mozfullscreenchange", this.setFullscreenButtonState);
                     addListener(this.video, "keypress", this.keyHandler);
 
                     this.log("--- videocontrols initialized ---");
                 }
-            }) ]]>
-        </field>
-
-        <field readonly="true" name="isTouchControl">false</field>
+            };
+            this.Utils.init(this);
+            ]]>
+        </constructor>
+        <destructor>
+            <![CDATA[
+            // randomID used to be a <field>, which meant that the XBL machinery
+            // undefined the property when the element was unbound. The code in
+            // this file actually depends on this, so now that randomID is an
+            // expando, we need to make sure to explicitly delete it.
+            delete this.randomID;
+            ]]>
+        </destructor>
 
     </implementation>
 
     <handlers>
         <handler event="mouseover">
             if (!this.isTouchControl)
                 this.Utils.onMouseInOut(event);
         </handler>
@@ -1508,24 +1508,21 @@
                     </vbox>
                 </vbox>
             </vbox>
         </stack>
     </xbl:content>
 
     <implementation>
 
-        <field readonly="true" name="isTouchControl">true</field>
-
         <constructor>
+          <![CDATA[
+          this.isTouchControl = true;
           this.TouchUtils.init(this);
-        </constructor>
-
-        <field name="TouchUtils">
-          <![CDATA[ ({
+          this.TouchUtils = {
             videocontrols: null,
             controlsTimer : null,
             controlsTimeout : 5000,
             positionLabel: null,
 
             get Utils() {
               return this.videocontrols.Utils;
             },
@@ -1628,18 +1625,19 @@
               // If the video is not at the start, then we probably just
               // transitioned into or out of fullscreen mode, and we don't want
               // the controls to remain visible. this.controlsTimeout is a full
               // 5s, which feels too long after the transition.
               if (video.currentTime !== 0) {
                 this.delayHideControls(this.Utils.HIDE_CONTROLS_TIMEOUT_MS);
               }
             }
-          }) ]]>
-        </field>
+          };
+      ]]>
+      </constructor>
 
     </implementation>
 
     <handlers>
         <handler event="mouseup">
           if(event.originalTarget.nodeName == "vbox") {
             if (this.TouchUtils.firstShow)
               this.Utils.video.play();