/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; // This is loaded into all XUL windows. Wrap in a block to prevent // leaking to window scope. { const { AppConstants } = ChromeUtils.importESModule( "resource://gre/modules/AppConstants.sys.mjs" ); class MozDialog extends MozXULElement { constructor() { super(); } static get observedAttributes() { return super.observedAttributes.concat("subdialog"); } attributeChangedCallback(name, oldValue, newValue) { if (name == "subdialog") { console.assert( newValue, `Turning off subdialog style is not supported` ); if (this.isConnectedAndReady && !oldValue && newValue) { this.shadowRoot.appendChild( MozXULElement.parseXULToFragment(this.inContentStyle) ); } return; } super.attributeChangedCallback(name, oldValue, newValue); } static get inheritedAttributes() { return { ".dialog-button-box": "pack=buttonpack,align=buttonalign,dir=buttondir,orient=buttonorient", "[dlgtype='accept']": "disabled=buttondisabledaccept", }; } get inContentStyle() { return ` `; } get _markup() { let buttons = AppConstants.XP_UNIX ? `