Bug 421351 - allow styling richlistitems with -moz-appearance:menuitem. r=neil

This commit is contained in:
Dão Gottwald 2009-07-25 15:10:17 +02:00
Родитель b4a8660825
Коммит 54947fe13c
3 изменённых файлов: 6 добавлений и 14 удалений

Просмотреть файл

@ -565,20 +565,6 @@
]]>
</setter>
</property>
<property name="selected" onget="return this.getAttribute('selected') == 'true';">
<setter><![CDATA[
if (val) {
this.setAttribute("selected", "true");
this.setAttribute("_moz-menuactive", "true");
} else {
this.removeAttribute("selected");
this.removeAttribute("_moz-menuactive");
}
return val;
]]></setter>
</property>
</implementation>
</binding>
</bindings>

Просмотреть файл

@ -387,6 +387,11 @@ nsNativeThemeWin::StandardGetState(nsIFrame* aFrame, PRUint8 aWidgetType,
PRBool
nsNativeThemeWin::IsMenuActive(nsIFrame *aFrame, PRUint8 aWidgetType)
{
nsIContent* content = aFrame->GetContent();
if (content->IsNodeOfType(nsINode::eXUL) &&
content->NodeInfo()->Equals(nsWidgetAtoms::richlistitem))
return CheckBooleanAttr(aFrame, nsWidgetAtoms::selected);
return CheckBooleanAttr(aFrame, nsWidgetAtoms::mozmenuactive);
}

Просмотреть файл

@ -105,6 +105,7 @@ WIDGET_ATOM(parentfocused, "parentfocused")
WIDGET_ATOM(radio, "radio")
WIDGET_ATOM(readonly, "readonly")
WIDGET_ATOM(Reload, "Reload")
WIDGET_ATOM(richlistitem, "richlistitem")
WIDGET_ATOM(sbattr, "sbattr")
WIDGET_ATOM(scrollbarFrame, "ScrollbarFrame")
WIDGET_ATOM(scrollbarDownBottom, "scrollbar-down-bottom")