Bug 1542844 - All wizards displays [Done] button from the point where they open on OS X, r=bgrins

Differential Revision: https://phabricator.services.mozilla.com/D26734
This commit is contained in:
Alexander Surkov
2019-04-09 21:16:07 +00:00
parent 516004c5ef
commit db46369850
3 changed files with 29 additions and 5 deletions

View File

@@ -90,7 +90,7 @@ MozElements.MozElementMixin = Base => class MozElement extends Base {
* based on the static `inheritedAttributes` Object. This can be overridden by callers.
*/
attributeChangedCallback(name, oldValue, newValue) {
if (!this.isConnectedAndReady || oldValue === newValue || !this.inheritedAttributesCache) {
if (oldValue === newValue || !this.inheritedAttributesCache) {
return;
}

View File

@@ -19,7 +19,33 @@
<inherited-element-declarative foo="fuagra"></inherited-element-declarative>
<inherited-element-shadowdom-declarative foo="fuagra"></inherited-element-shadowdom-declarative>
<inherited-element-imperative foo="fuagra"></inherited-element-imperative>
<inherited-element-beforedomloaded foo="fuagra"></inherited-element-beforedomloaded>
<!-- test code running before page load goes here -->
<script type="application/javascript"><![CDATA[
class InheritAttrsChangeBeforDOMLoaded extends MozXULElement {
static get inheritedAttributes() {
return {
"label": "foo",
};
}
connectedCallback() {
this.append(MozXULElement.parseXULToFragment(`<label />`));
this.label = this.querySelector("label");
this.initializeAttributeInheritance();
is(this.label.getAttribute("foo"), "fuagra",
"InheritAttrsChangeBeforDOMLoaded: attribute should be propagated #1");
this.setAttribute("foo", "chuk&gek");
is(this.label.getAttribute("foo"), "chuk&gek",
"InheritAttrsChangeBeforDOMLoaded: attribute should be propagated #2");
}
}
customElements.define("inherited-element-beforedomloaded",
InheritAttrsChangeBeforDOMLoaded);
]]>
</script>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[

View File

@@ -61,8 +61,7 @@ class MozWizardButtons extends MozXULElement {
static get inheritedAttributes() {
return AppConstants.platform == "macosx" ? {
"[dlgtype='finish']": "hidefinishbutton",
"[dlgtype='next']": "lastpage",
"[dlgtype='next']": "hidden=lastpage",
} : null;
}
@@ -144,8 +143,7 @@ class MozWizardButtons extends MozXULElement {
onPageChange() {
if (AppConstants.platform == "macosx") {
this.setAttribute("hidefinishbutton",
!(this.getAttribute("lastpage") == "true"));
this.getButton("finish").hidden = !(this.getAttribute("lastpage") == "true");
} else if (this.getAttribute("lastpage") == "true") {
this._wizardButtonDeck.setAttribute("selectedIndex", 0);
} else {