[PALEMOON] [Frontend vs Backend] HTML - input - datetime

Issue #162
This commit is contained in:
janekptacijarabaci 2018-04-15 17:55:14 +02:00 • committed by Roy Tam
commit a422978746
5 changed files with 41 additions and 14 deletions

View file

@ -280,6 +280,10 @@ panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .a
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-rich-result-popup"); -moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-rich-result-popup");
} }
#DateTimePickerPanel[active="true"] {
-moz-binding: url("chrome://global/content/bindings/datetimepopup.xml#datetime-popup");
}
/* Pale Moon: Address bar: Feeds */ /* Pale Moon: Address bar: Feeds */
#ub-feed-button > .button-box > .box-inherit > .button-text, #ub-feed-button > .button-box > .box-inherit > .button-text,
#ub-feed-button > .button-box > .button-menu-dropmarker { #ub-feed-button > .button-box > .button-menu-dropmarker {
@ -542,11 +546,11 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(#nav-bar):not(
max-width: 280px; max-width: 280px;
} }
.form-validation-anchor { .popup-anchor {
/* should occupy space but not be visible */ /* should occupy space but not be visible */
opacity: 0; opacity: 0;
visibility: hidden;
pointer-events: none; pointer-events: none;
-moz-stack-sizing: ignore;
} }
#addon-progress-notification { #addon-progress-notification {

View file

@ -132,6 +132,20 @@
<!-- for url bar autocomplete --> <!-- for url bar autocomplete -->
<panel type="autocomplete-richlistbox" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/> <panel type="autocomplete-richlistbox" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/>
<!-- for date/time picker. consumeoutsideclicks is set to never, so that
clicks on the anchored input box are never consumed. -->
<panel id="DateTimePickerPanel"
type="arrow"
hidden="true"
orient="vertical"
noautofocus="true"
norolluponanchor="true"
consumeoutsideclicks="never"
level="parent"
tabspecific="true">
<iframe id="dateTimePopupFrame"/>
</panel>
<!-- for invalid form error message --> <!-- for invalid form error message -->
<panel id="invalid-form-popup" type="arrow" orient="vertical" noautofocus="true" hidden="true" level="parent"> <panel id="invalid-form-popup" type="arrow" orient="vertical" noautofocus="true" hidden="true" level="parent">
<description/> <description/>
@ -946,7 +960,8 @@
flex="1" contenttooltip="aHTMLTooltip" flex="1" contenttooltip="aHTMLTooltip"
tabcontainer="tabbrowser-tabs" tabcontainer="tabbrowser-tabs"
contentcontextmenu="contentAreaContextMenu" contentcontextmenu="contentAreaContextMenu"
autocompletepopup="PopupAutoComplete"/> autocompletepopup="PopupAutoComplete"
datetimepicker="DateTimePickerPanel"/>
<chatbar id="pinnedchats" layer="true" mousethrough="always" hidden="true"/> <chatbar id="pinnedchats" layer="true" mousethrough="always" hidden="true"/>
<statuspanel id="statusbar-display" inactive="true"/> <statuspanel id="statusbar-display" inactive="true"/>
</vbox> </vbox>

View file

@ -30,7 +30,7 @@
<xul:vbox flex="1" class="browserContainer"> <xul:vbox flex="1" class="browserContainer">
<xul:stack flex="1" class="browserStack" anonid="browserStack"> <xul:stack flex="1" class="browserStack" anonid="browserStack">
<xul:browser anonid="initialBrowser" type="content-primary" message="true" disablehistory="true" <xul:browser anonid="initialBrowser" type="content-primary" message="true" disablehistory="true"
xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup"/> xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,datetimepicker"/>
</xul:stack> </xul:stack>
</xul:vbox> </xul:vbox>
</xul:hbox> </xul:hbox>
@ -138,19 +138,19 @@
]]></getter> ]]></getter>
</property> </property>
<property name="formValidationAnchor" readonly="true"> <property name="popupAnchor" readonly="true">
<getter><![CDATA[ <getter><![CDATA[
if (this.mCurrentTab._formValidationAnchor) { if (this.mCurrentTab._popupAnchor) {
return this.mCurrentTab._formValidationAnchor; return this.mCurrentTab._popupAnchor;
} }
let stack = this.mCurrentBrowser.parentNode; let stack = this.mCurrentBrowser.parentNode;
// Create an anchor for the form validation popup // Create an anchor for the popup
const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
let formValidationAnchor = document.createElementNS(NS_XUL, "hbox"); let popupAnchor = document.createElementNS(NS_XUL, "hbox");
formValidationAnchor.className = "form-validation-anchor"; popupAnchor.className = "popup-anchor";
formValidationAnchor.hidden = true; popupAnchor.hidden = true;
stack.appendChild(formValidationAnchor); stack.appendChild(popupAnchor);
return this.mCurrentTab._formValidationAnchor = formValidationAnchor; return this.mCurrentTab._popupAnchor = popupAnchor;
]]></getter> ]]></getter>
</property> </property>
@ -1451,6 +1451,10 @@
b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup")); b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup"));
b.setAttribute("autoscrollpopup", this._autoScrollPopup.id); b.setAttribute("autoscrollpopup", this._autoScrollPopup.id);
if (this.hasAttribute("datetimepicker")) {
b.setAttribute("datetimepicker", this.getAttribute("datetimepicker"));
}
// Create the browserStack container // Create the browserStack container
var stack = document.createElementNS(NS_XUL, "stack"); var stack = document.createElementNS(NS_XUL, "stack");
stack.className = "browserStack"; stack.className = "browserStack";

View file

@ -35,6 +35,7 @@ Cu.import("resource://gre/modules/Services.jsm");
["OS", "resource://gre/modules/osfile.jsm"], ["OS", "resource://gre/modules/osfile.jsm"],
["LoginManagerParent", "resource://gre/modules/LoginManagerParent.jsm"], ["LoginManagerParent", "resource://gre/modules/LoginManagerParent.jsm"],
["FormValidationHandler", "resource:///modules/FormValidationHandler.jsm"], ["FormValidationHandler", "resource:///modules/FormValidationHandler.jsm"],
["DateTimePickerHelper", "resource://gre/modules/DateTimePickerHelper.jsm"],
].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource)); ].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource));
const PREF_PLUGINS_NOTIFYUSER = "plugins.update.notifyUser"; const PREF_PLUGINS_NOTIFYUSER = "plugins.update.notifyUser";
@ -167,6 +168,7 @@ BrowserGlue.prototype = {
} catch (e) { } catch (e) {
Cu.reportError("Could not end startup crash tracking in quit-application-granted: " + e); Cu.reportError("Could not end startup crash tracking in quit-application-granted: " + e);
} }
DateTimePickerHelper.uninit();
break; break;
#ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS #ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS
case "browser-lastwindow-close-requested": case "browser-lastwindow-close-requested":
@ -496,6 +498,8 @@ BrowserGlue.prototype = {
} }
#endif #endif
DateTimePickerHelper.init();
this._trackSlowStartup(); this._trackSlowStartup();
}, },

View file

@ -122,7 +122,7 @@ var FormValidationHandler =
this._panel.hidden = false; this._panel.hidden = false;
let tabBrowser = aWindow.gBrowser; let tabBrowser = aWindow.gBrowser;
this._anchor = tabBrowser.formValidationAnchor; this._anchor = tabBrowser.popupAnchor;
this._anchor.left = aPanelData.contentRect.left; this._anchor.left = aPanelData.contentRect.left;
this._anchor.top = aPanelData.contentRect.top; this._anchor.top = aPanelData.contentRect.top;
this._anchor.width = aPanelData.contentRect.width; this._anchor.width = aPanelData.contentRect.width;