mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 529062 - [Mac] Bookmarks menu entries don't update correctly, r=mak
This commit is contained in:
parent
4ead986fb8
commit
7a31cb37fa
@ -624,8 +624,7 @@
|
||||
<parameter name="aParentPopup"/>
|
||||
<parameter name="aBefore"/>
|
||||
<body><![CDATA[
|
||||
var element = PlacesUIUtils.createMenuItemForNode(aChild);
|
||||
|
||||
let element = PlacesUIUtils.createMenuItemForNode(aChild);
|
||||
if (aBefore)
|
||||
aParentPopup.insertBefore(element, aBefore);
|
||||
else {
|
||||
@ -642,6 +641,28 @@
|
||||
|
||||
if (aParentPopup._endMarker != -1)
|
||||
aParentPopup._endMarker++;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// Bug 529062:
|
||||
// We rely on the menu* bindings, but those aren't never applied
|
||||
// in native mac menus, for elements which are added to the document
|
||||
// through appendChild / insertBefore.
|
||||
if (this.parentNode.parentNode.localName != "menubar")
|
||||
return;
|
||||
|
||||
function applyBinding(elm) {
|
||||
// getPropertyCSSValue is semi-deprecared, but there's no
|
||||
// alternative for parsing css_uri values reliably.
|
||||
let elmBindingURI = window.getComputedStyle(element, "")
|
||||
.getPropertyCSSValue("-moz-binding");
|
||||
if (elmBindingURI.primitiveType == CSSPrimitiveValue.CSS_URI)
|
||||
document.addBinding(elm, elmBindingURI.getStringValue());
|
||||
}
|
||||
|
||||
applyBinding(element);
|
||||
if (element.localName == "menu")
|
||||
applyBinding(element.firstChild);
|
||||
#endif
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user