Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit e163a0e

Browse files
committed
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 --HG-- extra : moz-landing-system : lando
1 parent 0ce32c1 commit e163a0e

3 files changed

Lines changed: 29 additions & 5 deletions

File tree

toolkit/content/customElements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ MozElements.MozElementMixin = Base => class MozElement extends Base {
9090
* based on the static `inheritedAttributes` Object. This can be overridden by callers.
9191
*/
9292
attributeChangedCallback(name, oldValue, newValue) {
93-
if (!this.isConnectedAndReady || oldValue === newValue || !this.inheritedAttributesCache) {
93+
if (oldValue === newValue || !this.inheritedAttributesCache) {
9494
return;
9595
}
9696

toolkit/content/tests/chrome/test_custom_element_base.xul

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,33 @@
1919
<inherited-element-declarative foo="fuagra"></inherited-element-declarative>
2020
<inherited-element-shadowdom-declarative foo="fuagra"></inherited-element-shadowdom-declarative>
2121
<inherited-element-imperative foo="fuagra"></inherited-element-imperative>
22+
<inherited-element-beforedomloaded foo="fuagra"></inherited-element-beforedomloaded>
2223

24+
<!-- test code running before page load goes here -->
25+
<script type="application/javascript"><![CDATA[
26+
class InheritAttrsChangeBeforDOMLoaded extends MozXULElement {
27+
static get inheritedAttributes() {
28+
return {
29+
"label": "foo",
30+
};
31+
}
32+
connectedCallback() {
33+
this.append(MozXULElement.parseXULToFragment(`<label />`));
34+
this.label = this.querySelector("label");
35+
36+
this.initializeAttributeInheritance();
37+
is(this.label.getAttribute("foo"), "fuagra",
38+
"InheritAttrsChangeBeforDOMLoaded: attribute should be propagated #1");
39+
40+
this.setAttribute("foo", "chuk&gek");
41+
is(this.label.getAttribute("foo"), "chuk&gek",
42+
"InheritAttrsChangeBeforDOMLoaded: attribute should be propagated #2");
43+
}
44+
}
45+
customElements.define("inherited-element-beforedomloaded",
46+
InheritAttrsChangeBeforDOMLoaded);
47+
]]>
48+
</script>
2349

2450
<!-- test code goes here -->
2551
<script type="application/javascript"><![CDATA[

toolkit/content/widgets/wizard.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ class MozWizardButtons extends MozXULElement {
6161

6262
static get inheritedAttributes() {
6363
return AppConstants.platform == "macosx" ? {
64-
"[dlgtype='finish']": "hidefinishbutton",
65-
"[dlgtype='next']": "lastpage",
64+
"[dlgtype='next']": "hidden=lastpage",
6665
} : null;
6766
}
6867

@@ -144,8 +143,7 @@ class MozWizardButtons extends MozXULElement {
144143

145144
onPageChange() {
146145
if (AppConstants.platform == "macosx") {
147-
this.setAttribute("hidefinishbutton",
148-
!(this.getAttribute("lastpage") == "true"));
146+
this.getButton("finish").hidden = !(this.getAttribute("lastpage") == "true");
149147
} else if (this.getAttribute("lastpage") == "true") {
150148
this._wizardButtonDeck.setAttribute("selectedIndex", 0);
151149
} else {

0 commit comments

Comments
 (0)