227
229
primitiveValue->GetPrimitiveType(&primitiveType);
228
230
if (primitiveType == nsIDOMCSSPrimitiveValue::CSS_RECT) {
229
231
primitiveValue->GetRectValue(getter_AddRefs(domRect));
231
NS_WARNING("-moz-image-region has wrong primitive type");
457
457
// Synchronize the 'label' and 'accesskey' attributes on the DOM node
458
458
// with the 'label' property on the dbusmenu node
460
uGlobalMenuObject::SyncLabelFromContent(nsIContent *aContent)
460
uGlobalMenuObject::SyncLabelFromContent()
462
462
// Gecko stores the label and access key in separate attributes
463
463
// so we need to convert label="Foo"/accesskey="F" in to
464
464
// label="_Foo" for dbusmenu
466
466
nsAutoString label;
467
if (!aContent || !aContent->GetAttr(kNameSpaceID_None, uWidgetAtoms::label,
469
mContent->GetAttr(kNameSpaceID_None, uWidgetAtoms::label, label);
467
mContent->GetAttr(kNameSpaceID_None, uWidgetAtoms::label, label);
472
469
nsAutoString accesskey;
473
470
mContent->GetAttr(kNameSpaceID_None, uWidgetAtoms::accesskey, accesskey);
547
uGlobalMenuObject::SyncLabelFromContent()
549
SyncLabelFromContent(nsnull);
552
543
// Synchronize the 'hidden' attribute on the DOM node with the
553
544
// 'visible' property on the dbusmenu node
555
546
uGlobalMenuObject::SyncVisibilityFromContent()
557
548
mContentVisible = !IsHidden();
549
PRBool realVis = (!mMenuBar || !ShouldShowOnlyForKb() ||
550
mMenuBar->OpenedByKeyboard()) ?
551
mContentVisible : PR_FALSE;
558
553
dbusmenu_menuitem_property_set_bool(mDbusMenuItem,
559
554
DBUSMENU_MENUITEM_PROP_VISIBLE,
563
558
// Synchronize the 'disabled' attribute on the DOM node with the
564
559
// 'sensitivity' property on the dbusmenu node
566
uGlobalMenuObject::SyncSensitivityFromContent(nsIContent *aContent)
561
uGlobalMenuObject::SyncSensitivityFromContent()
575
563
dbusmenu_menuitem_property_set_bool(mDbusMenuItem,
576
564
DBUSMENU_MENUITEM_PROP_ENABLED,
577
!content->AttrValueIs(kNameSpaceID_None,
578
uWidgetAtoms::disabled,
584
uGlobalMenuObject::SyncSensitivityFromContent()
586
SyncSensitivityFromContent(nsnull);
565
!mContent->AttrValueIs(kNameSpaceID_None,
566
uWidgetAtoms::disabled,
589
571
// Synchronize the 'label' attribute on our content node with that from
661
uGlobalMenuObject::AboutToShowNotify()
647
uGlobalMenuObject::UpdateVisibility()
663
NS_WARN_IF_FALSE(!mHalted, "Showing a menuitem that should have been destroyed already");
669
PRBool newVis = (mShowOnlyForKb == PR_FALSE || mMenuBar->OpenedByKeyboard()) ?
653
PRBool newVis = (!ShouldShowOnlyForKb() || mMenuBar->OpenedByKeyboard()) ?
670
654
mContentVisible : PR_FALSE;
672
656
dbusmenu_menuitem_property_set_bool(mDbusMenuItem,