mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-11 14:28:42 +00:00
Allow setting "open" property on all sorts of buttons, since people do.... Bug
282359, r=mconnor, sr=neil
This commit is contained in:
parent
e1a7049710
commit
c79b003bca
@ -30,12 +30,17 @@
|
||||
|
||||
<property name="open" onget="return this.hasAttribute('open');">
|
||||
<setter><![CDATA[
|
||||
// Note that the QI may throw if we're not a menu, but we want that
|
||||
// to happen, since in that case setting our "open" property is
|
||||
// somewhat bogus
|
||||
this.boxObject
|
||||
.QueryInterface(Components.interfaces.nsIMenuBoxObject)
|
||||
.openMenu(val);
|
||||
if (this.boxObject instanceof
|
||||
Components.interfaces.nsIMenuBoxObject) {
|
||||
this.boxObject.openMenu(val);
|
||||
} else {
|
||||
// Fall back to just setting the attribute
|
||||
if (val) {
|
||||
this.setAttribute('open', 'true');
|
||||
} else {
|
||||
this.removeAttribute('open');
|
||||
}
|
||||
}
|
||||
return val;
|
||||
]]></setter>
|
||||
</property>
|
||||
|
@ -30,12 +30,17 @@
|
||||
|
||||
<property name="open" onget="return this.hasAttribute('open');">
|
||||
<setter><![CDATA[
|
||||
// Note that the QI may throw if we're not a menu, but we want that
|
||||
// to happen, since in that case setting our "open" property is
|
||||
// somewhat bogus
|
||||
this.boxObject
|
||||
.QueryInterface(Components.interfaces.nsIMenuBoxObject)
|
||||
.openMenu(val);
|
||||
if (this.boxObject instanceof
|
||||
Components.interfaces.nsIMenuBoxObject) {
|
||||
this.boxObject.openMenu(val);
|
||||
} else {
|
||||
// Fall back to just setting the attribute
|
||||
if (val) {
|
||||
this.setAttribute('open', 'true');
|
||||
} else {
|
||||
this.removeAttribute('open');
|
||||
}
|
||||
}
|
||||
return val;
|
||||
]]></setter>
|
||||
</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user