Bug 1370294 - Lazily create the iframe for the date time picker;r=mconley
authorBrian Grinstead <bgrinstead@mozilla.com>
Mon, 05 Jun 2017 20:53:54 -0700
changeset 410869 8117f05e2a2017bf4c3e67f5145b14bf2cf07b81
parent 410729 f6320f91851c2cede08b0fb54a6d0525b870310e
child 410870 949533a9e987b90b9951d3aee4084af83baa262d
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1370294
milestone55.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 1370294 - Lazily create the iframe for the date time picker;r=mconley MozReview-Commit-ID: Cn99obd86RB
browser/base/content/browser.xul
toolkit/content/widgets/datetimepopup.xml
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -164,17 +164,16 @@
            type="arrow"
            hidden="true"
            orient="vertical"
            noautofocus="true"
            noautohide="true"
            consumeoutsideclicks="false"
            level="parent"
            tabspecific="true">
-      <iframe id="dateTimePopupFrame"/>
     </panel>
 
     <!-- for select dropdowns. The menupopup is what shows the list of options,
          and the popuponly menulist makes things like the menuactive attributes
          work correctly on the menupopup. ContentSelectDropdown expects the
          popuponly menulist to be its immediate parent. -->
     <menulist popuponly="true" id="ContentSelectDropdown" hidden="true">
       <menupopup rolluponmousewheel="true"
--- a/toolkit/content/widgets/datetimepopup.xml
+++ b/toolkit/content/widgets/datetimepopup.xml
@@ -10,19 +10,27 @@
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:xbl="http://www.mozilla.org/xbl">
   <binding id="datetime-popup"
            extends="chrome://global/content/bindings/popup.xml#arrowpanel">
     <resources>
       <stylesheet src="chrome://global/skin/datetimepopup.css"/>
     </resources>
     <implementation>
-      <field name="dateTimePopupFrame">
-        this.querySelector("#dateTimePopupFrame");
-      </field>
+      <property name="dateTimePopupFrame">
+        <getter>
+          let frame = this.querySelector("#dateTimePopupFrame");
+          if (!frame) {
+            frame = this.ownerDocument.createElement("iframe");
+            frame.id = "dateTimePopupFrame";
+            this.appendChild(frame);
+          }
+          return frame;
+        </getter>
+      </property>
       <field name="TIME_PICKER_WIDTH" readonly="true">"12em"</field>
       <field name="TIME_PICKER_HEIGHT" readonly="true">"21em"</field>
       <field name="DATE_PICKER_WIDTH" readonly="true">"23.1em"</field>
       <field name="DATE_PICKER_HEIGHT" readonly="true">"20.7em"</field>
       <constructor><![CDATA[
         this.mozIntl = Components.classes["@mozilla.org/mozintl;1"]
                                  .getService(Components.interfaces.mozIMozIntl);
         // Notify DateTimePickerHelper.jsm that binding is ready.