XUL RadioGroup element, not used in XUL. r=ben, a=jar

This commit is contained in:
hyatt%netscape.com 2000-03-02 10:00:09 +00:00
Родитель b0b39dc16e
Коммит d6796e3c65
28 изменённых файлов: 926 добавлений и 96 удалений

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

@ -146,19 +146,9 @@ XUL_ATOM(editor, "editor")
XUL_ATOM(checkbox, "checkbox")
XUL_ATOM(radio, "radio")
XUL_ATOM(radiogroup, "radiogroup")
XUL_ATOM(menulist, "menulist")
XUL_ATOM(menubutton, "menubutton")
XUL_ATOM(textfield, "textfield")
XUL_ATOM(textarea, "textarea")
XUL_ATOM(listbox, "listbox")
XUL_ATOM(listcaption, "listcaption") // The caption of a list view
XUL_ATOM(listhead, "listhead") // The header of the list view
XUL_ATOM(listrow, "listrow") // A row in the list view
XUL_ATOM(listcell, "listcell") // An item in the list view
XUL_ATOM(listitem, "listitem") // A cell in the list view
XUL_ATOM(listchildren, "listchildren") // The children of an item in the list view
XUL_ATOM(listindentation, "listindentation") // Specifies that the indentation for the level should occur here.
XUL_ATOM(listcol, "listcol") // A column in the list view
XUL_ATOM(listcolgroup, "listcolgroup") // A column group in the list view
XUL_ATOM(listfoot, "listfoot") // The footer of the list view

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

@ -361,15 +361,15 @@ nsXBLEventHandler::MouseEventMatched(nsIDOMUIEvent* aMouseEvent)
NS_IMETHODIMP
nsXBLEventHandler::ExecuteHandler(const nsString& aEventName, nsIDOMEvent* aEvent)
{
// We are the default action for this command.
// Stop any other default action from executing.
aEvent->PreventDefault();
// This is a special-case optimization to make command handling fast.
// It isn't really a part of XBL, but it helps speed things up.
nsAutoString command;
mHandlerElement->GetAttribute(kNameSpaceID_None, kCommandAtom, command);
if (!command.IsEmpty()) {
// We are the default action for this command.
// Stop any other default action from executing.
aEvent->PreventDefault();
// Instead of executing JS, let's get the controller for the bound
// element and call doCommand on it.
nsCOMPtr<nsIController> controller;

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

@ -96,6 +96,7 @@
#include "nsXULTitledButtonElement.h"
#include "nsXULCheckboxElement.h"
#include "nsXULRadioElement.h"
#include "nsXULRadioGroupElement.h"
#include "nsXULMenuListElement.h"
#include "prlog.h"
@ -296,6 +297,7 @@ nsIAtom* nsXULElement::kWindowAtom;
nsIAtom* nsXULElement::kNullAtom;
nsIAtom* nsXULElement::kCheckboxAtom;
nsIAtom* nsXULElement::kRadioAtom;
nsIAtom* nsXULElement::kRadioGroupAtom;
nsIAtom* nsXULElement::kMenuListAtom;
nsIAtom* nsXULElement::kMenuButtonAtom;
@ -367,6 +369,7 @@ nsXULElement::Init()
kWindowAtom = NS_NewAtom("window");
kCheckboxAtom = NS_NewAtom("checkbox");
kRadioAtom = NS_NewAtom("radio");
kRadioGroupAtom = NS_NewAtom("radiogroup");
kMenuListAtom = NS_NewAtom("menulist");
kMenuButtonAtom = NS_NewAtom("menubutton");
kNullAtom = NS_NewAtom("");
@ -449,6 +452,7 @@ nsXULElement::~nsXULElement()
NS_IF_RELEASE(kWindowAtom);
NS_IF_RELEASE(kCheckboxAtom);
NS_IF_RELEASE(kRadioAtom);
NS_IF_RELEASE(kRadioGroupAtom);
NS_IF_RELEASE(kMenuListAtom);
NS_IF_RELEASE(kMenuButtonAtom);
NS_IF_RELEASE(kNullAtom);
@ -722,6 +726,20 @@ nsXULElement::QueryInterface(REFNSIID iid, void** result)
return InnerXULElement()->QueryInterface(iid, result);
}
else if (iid.Equals(NS_GET_IID(nsIDOMXULRadioGroupElement)) &&
(NameSpaceID() == kNameSpaceID_XUL) &&
(Tag() == kRadioGroupAtom)) {
// We delegate XULRadioElement APIs to an aggregate object
if (! InnerXULElement()) {
rv = EnsureSlots();
if (NS_FAILED(rv)) return rv;
if ((mSlots->mInnerXULElement = new nsXULRadioGroupElement(this)) == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
}
return InnerXULElement()->QueryInterface(iid, result);
}
else if (iid.Equals(NS_GET_IID(nsIDOMXULMenuListElement)) &&
(NameSpaceID() == kNameSpaceID_XUL) &&
(Tag() == kMenuListAtom)) {
@ -1788,6 +1806,10 @@ nsXULElement::GetScriptObject(nsIScriptContext* aContext, void** aScriptObject)
fn = NS_NewScriptXULRadioElement;
rootname = "nsXULRadioElement::mScriptObject";
}
else if (Tag() == kRadioGroupAtom) {
fn = NS_NewScriptXULRadioGroupElement;
rootname = "nsXULRadioGroupElement::mScriptObject";
}
else if (Tag() == kMenuListAtom) {
fn = NS_NewScriptXULMenuListElement;
rootname = "nsXULMenuListElement::mScriptObject";

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

@ -344,6 +344,7 @@ protected:
static nsIAtom* kTitledButtonAtom;
static nsIAtom* kCheckboxAtom;
static nsIAtom* kRadioAtom;
static nsIAtom* kRadioGroupAtom;
static nsIAtom* kTooltipAtom;
static nsIAtom* kTreeAtom;
static nsIAtom* kTreeCellAtom;

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

@ -935,6 +935,7 @@ enum nsDOMProp {
NS_DOM_PROP_XULMENULISTELEMENT_VALUE,
NS_DOM_PROP_XULPOPUPELEMENT_OPENPOPUP,
NS_DOM_PROP_XULPOPUPELEMENT_CLOSEPOPUP,
NS_DOM_PROP_XULRADIOGROUPELEMENT_SELECTEDITEM,
NS_DOM_PROP_XULRADIOELEMENT_ACCESSKEY,
NS_DOM_PROP_XULRADIOELEMENT_CHECKED,
NS_DOM_PROP_XULRADIOELEMENT_CROP,

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

@ -934,6 +934,7 @@
"xulmenulistelement.value", \
"xulpopupelement.openpopup", \
"xulpopupelement.closepopup", \
"xulradiogroupelement.selecteditem", \
"xulradioelement.accesskey", \
"xulradioelement.checked", \
"xulradioelement.crop", \

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

@ -2095,18 +2095,7 @@ nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext,
(nsXULAtoms::menulist == tag.get()) ||
(nsXULAtoms::menubutton == tag.get()) ||
(nsXULAtoms::textfield == tag.get()) ||
(nsXULAtoms::textarea == tag.get()) ||
(nsXULAtoms::listbox == tag.get()) ||
(nsXULAtoms::listcaption == tag.get()) ||
(nsXULAtoms::listhead == tag.get()) ||
(nsXULAtoms::listrow == tag.get()) ||
(nsXULAtoms::listcell == tag.get()) ||
(nsXULAtoms::listitem == tag.get()) ||
(nsXULAtoms::listchildren == tag.get()) ||
(nsXULAtoms::listindentation == tag.get()) ||
(nsXULAtoms::listcol == tag.get()) ||
(nsXULAtoms::listcolgroup == tag.get()) ||
(nsXULAtoms::listfoot == tag.get())
(nsXULAtoms::textarea == tag.get())
) {
return PR_TRUE;
}
@ -4366,7 +4355,130 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
rv = NS_NewProgressMeterFrame(aPresShell, &newFrame);
}
// End of PROGRESS METER CONSTRUCTION logic
// Menu Construction
else if (aTag == nsXULAtoms::menu ||
aTag == nsXULAtoms::menuitem ||
aTag == nsXULAtoms::menulist ||
aTag == nsXULAtoms::menubutton) {
// A derived class box frame
// that has custom reflow to prevent menu children
// from becoming part of the flow.
processChildren = PR_TRUE; // Will need this to be custom.
isReplaced = PR_TRUE;
rv = NS_NewMenuFrame(aPresShell, &newFrame, (aTag != nsXULAtoms::menuitem));
}
else if (aTag == nsXULAtoms::menubar) {
#ifdef XP_MAC // The Mac uses its native menu bar.
aHaltProcessing = PR_TRUE;
return NS_OK;
#else
processChildren = PR_TRUE;
rv = NS_NewMenuBarFrame(aPresShell, &newFrame);
#endif
}
else if (aTag == nsXULAtoms::popupset) {
// This frame contains child popups
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewPopupSetFrame(aPresShell, &newFrame);
}
else if (aTag == nsXULAtoms::menupopup || aTag == nsXULAtoms::popup) {
// This is its own frame that derives from
// box.
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewMenuPopupFrame(aPresShell, &newFrame);
}
// BOX CONSTRUCTION
else if (aTag == nsXULAtoms::box || aTag == nsXULAtoms::tabbox ||
aTag == nsXULAtoms::tabpage || aTag == nsXULAtoms::tabcontrol ||
aTag == nsXULAtoms::radiogroup) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewBoxFrame(aPresShell, &newFrame);
const nsStyleDisplay* display = (const nsStyleDisplay*)
aStyleContext->GetStyleData(eStyleStruct_Display);
// Boxes can scroll.
if (IsScrollable(aPresContext, display)) {
// set the top to be the newly created scrollframe
BuildScrollFrame(aPresShell, aPresContext, aState, aContent, aStyleContext, newFrame, aParentFrame,
topFrame, aStyleContext);
// we have a scrollframe so the parent becomes the scroll frame.
newFrame->GetParent(&aParentFrame);
primaryFrameSet = PR_TRUE;
frameHasBeenInitialized = PR_TRUE;
}
} // End of BOX CONSTRUCTION logic
else if (aTag == nsXULAtoms::title) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewTitleFrame(aPresShell, &newFrame);
const nsStyleDisplay* display = (const nsStyleDisplay*)
aStyleContext->GetStyleData(eStyleStruct_Display);
// Boxes can scroll.
if (IsScrollable(aPresContext, display)) {
// set the top to be the newly created scrollframe
BuildScrollFrame(aPresShell, aPresContext, aState, aContent, aStyleContext, newFrame, aParentFrame,
topFrame, aStyleContext);
// we have a scrollframe so the parent becomes the scroll frame.
newFrame->GetParent(&aParentFrame);
primaryFrameSet = PR_TRUE;
frameHasBeenInitialized = PR_TRUE;
}
} // End of BOX CONSTRUCTION logic
else if (aTag == nsXULAtoms::titledbox) {
ConstructTitledBoxFrame(aPresShell, aPresContext, aState, aContent, aParentFrame, aTag, aStyleContext, newFrame);
processChildren = PR_FALSE;
isReplaced = PR_TRUE;
const nsStyleDisplay* display = (const nsStyleDisplay*)
aStyleContext->GetStyleData(eStyleStruct_Display);
// Boxes can scroll.
if (IsScrollable(aPresContext, display)) {
// set the top to be the newly created scrollframe
BuildScrollFrame(aPresShell, aPresContext, aState, aContent, aStyleContext, newFrame, aParentFrame,
topFrame, aStyleContext);
// we have a scrollframe so the parent becomes the scroll frame.
newFrame->GetParent(&aParentFrame);
primaryFrameSet = PR_TRUE;
frameHasBeenInitialized = PR_TRUE;
}
}
// TITLED BUTTON CONSTRUCTION
else if (aTag == nsXULAtoms::titledbutton ||
aTag == nsXULAtoms::image) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewTitledButtonFrame(aPresShell, &newFrame);
}
// End of TITLED BUTTON CONSTRUCTION logic
// XULCHECKBOX CONSTRUCTION
else if (aTag == nsXULAtoms::checkbox ||
aTag == nsXULAtoms::radio) {

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

@ -2095,18 +2095,7 @@ nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext,
(nsXULAtoms::menulist == tag.get()) ||
(nsXULAtoms::menubutton == tag.get()) ||
(nsXULAtoms::textfield == tag.get()) ||
(nsXULAtoms::textarea == tag.get()) ||
(nsXULAtoms::listbox == tag.get()) ||
(nsXULAtoms::listcaption == tag.get()) ||
(nsXULAtoms::listhead == tag.get()) ||
(nsXULAtoms::listrow == tag.get()) ||
(nsXULAtoms::listcell == tag.get()) ||
(nsXULAtoms::listitem == tag.get()) ||
(nsXULAtoms::listchildren == tag.get()) ||
(nsXULAtoms::listindentation == tag.get()) ||
(nsXULAtoms::listcol == tag.get()) ||
(nsXULAtoms::listcolgroup == tag.get()) ||
(nsXULAtoms::listfoot == tag.get())
(nsXULAtoms::textarea == tag.get())
) {
return PR_TRUE;
}
@ -4366,7 +4355,130 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
rv = NS_NewProgressMeterFrame(aPresShell, &newFrame);
}
// End of PROGRESS METER CONSTRUCTION logic
// Menu Construction
else if (aTag == nsXULAtoms::menu ||
aTag == nsXULAtoms::menuitem ||
aTag == nsXULAtoms::menulist ||
aTag == nsXULAtoms::menubutton) {
// A derived class box frame
// that has custom reflow to prevent menu children
// from becoming part of the flow.
processChildren = PR_TRUE; // Will need this to be custom.
isReplaced = PR_TRUE;
rv = NS_NewMenuFrame(aPresShell, &newFrame, (aTag != nsXULAtoms::menuitem));
}
else if (aTag == nsXULAtoms::menubar) {
#ifdef XP_MAC // The Mac uses its native menu bar.
aHaltProcessing = PR_TRUE;
return NS_OK;
#else
processChildren = PR_TRUE;
rv = NS_NewMenuBarFrame(aPresShell, &newFrame);
#endif
}
else if (aTag == nsXULAtoms::popupset) {
// This frame contains child popups
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewPopupSetFrame(aPresShell, &newFrame);
}
else if (aTag == nsXULAtoms::menupopup || aTag == nsXULAtoms::popup) {
// This is its own frame that derives from
// box.
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewMenuPopupFrame(aPresShell, &newFrame);
}
// BOX CONSTRUCTION
else if (aTag == nsXULAtoms::box || aTag == nsXULAtoms::tabbox ||
aTag == nsXULAtoms::tabpage || aTag == nsXULAtoms::tabcontrol ||
aTag == nsXULAtoms::radiogroup) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewBoxFrame(aPresShell, &newFrame);
const nsStyleDisplay* display = (const nsStyleDisplay*)
aStyleContext->GetStyleData(eStyleStruct_Display);
// Boxes can scroll.
if (IsScrollable(aPresContext, display)) {
// set the top to be the newly created scrollframe
BuildScrollFrame(aPresShell, aPresContext, aState, aContent, aStyleContext, newFrame, aParentFrame,
topFrame, aStyleContext);
// we have a scrollframe so the parent becomes the scroll frame.
newFrame->GetParent(&aParentFrame);
primaryFrameSet = PR_TRUE;
frameHasBeenInitialized = PR_TRUE;
}
} // End of BOX CONSTRUCTION logic
else if (aTag == nsXULAtoms::title) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewTitleFrame(aPresShell, &newFrame);
const nsStyleDisplay* display = (const nsStyleDisplay*)
aStyleContext->GetStyleData(eStyleStruct_Display);
// Boxes can scroll.
if (IsScrollable(aPresContext, display)) {
// set the top to be the newly created scrollframe
BuildScrollFrame(aPresShell, aPresContext, aState, aContent, aStyleContext, newFrame, aParentFrame,
topFrame, aStyleContext);
// we have a scrollframe so the parent becomes the scroll frame.
newFrame->GetParent(&aParentFrame);
primaryFrameSet = PR_TRUE;
frameHasBeenInitialized = PR_TRUE;
}
} // End of BOX CONSTRUCTION logic
else if (aTag == nsXULAtoms::titledbox) {
ConstructTitledBoxFrame(aPresShell, aPresContext, aState, aContent, aParentFrame, aTag, aStyleContext, newFrame);
processChildren = PR_FALSE;
isReplaced = PR_TRUE;
const nsStyleDisplay* display = (const nsStyleDisplay*)
aStyleContext->GetStyleData(eStyleStruct_Display);
// Boxes can scroll.
if (IsScrollable(aPresContext, display)) {
// set the top to be the newly created scrollframe
BuildScrollFrame(aPresShell, aPresContext, aState, aContent, aStyleContext, newFrame, aParentFrame,
topFrame, aStyleContext);
// we have a scrollframe so the parent becomes the scroll frame.
newFrame->GetParent(&aParentFrame);
primaryFrameSet = PR_TRUE;
frameHasBeenInitialized = PR_TRUE;
}
}
// TITLED BUTTON CONSTRUCTION
else if (aTag == nsXULAtoms::titledbutton ||
aTag == nsXULAtoms::image) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewTitledButtonFrame(aPresShell, &newFrame);
}
// End of TITLED BUTTON CONSTRUCTION logic
// XULCHECKBOX CONSTRUCTION
else if (aTag == nsXULAtoms::checkbox ||
aTag == nsXULAtoms::radio) {

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

@ -361,15 +361,15 @@ nsXBLEventHandler::MouseEventMatched(nsIDOMUIEvent* aMouseEvent)
NS_IMETHODIMP
nsXBLEventHandler::ExecuteHandler(const nsString& aEventName, nsIDOMEvent* aEvent)
{
// We are the default action for this command.
// Stop any other default action from executing.
aEvent->PreventDefault();
// This is a special-case optimization to make command handling fast.
// It isn't really a part of XBL, but it helps speed things up.
nsAutoString command;
mHandlerElement->GetAttribute(kNameSpaceID_None, kCommandAtom, command);
if (!command.IsEmpty()) {
// We are the default action for this command.
// Stop any other default action from executing.
aEvent->PreventDefault();
// Instead of executing JS, let's get the controller for the bound
// element and call doCommand on it.
nsCOMPtr<nsIController> controller;

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

@ -23,6 +23,13 @@
#include "nsXULCheckboxFrame.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsIContent.h"
#include "nsIDOMXULRadioElement.h"
#include "nsIDocument.h"
#include "nsIDOMXULDocument.h"
#include "nsIDOMNodeList.h"
#include "nsHTMLAtoms.h"
#include "nsINameSpaceManager.h"
//
// NS_NewXULCheckboxFrame
@ -46,41 +53,6 @@ NS_NewXULCheckboxFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame )
} // NS_NewXULCheckboxFrame
void nsXULCheckboxFrame::ToggleCheckState()
{
nsCOMPtr<nsIDOMXULCheckboxElement> element = do_QueryInterface(mContent);
if(element) {
PRBool disabled;
element->GetDisabled(&disabled);
if(!disabled) {
PRBool checked;
element->GetChecked(&checked);
element->SetChecked(!checked);
}
}
}
NS_IMETHODIMP nsXULCheckboxFrame::HandleEvent(
nsIPresContext* aPresContext,
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus)
{
switch (aEvent->message) {
case NS_MOUSE_LEFT_BUTTON_UP:
ToggleCheckState();
break;
case NS_KEY_PRESS:
if (NS_KEY_EVENT == aEvent->eventStructType) {
nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
if (NS_VK_SPACE == keyEvent->keyCode)
ToggleCheckState();
}
break;
}
return nsTitledButtonFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
PRIntn nsXULCheckboxFrame::GetDefaultAlignment()
{
return NS_SIDE_LEFT;

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

@ -30,12 +30,7 @@ public:
friend nsresult NS_NewXULCheckboxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
NS_IMETHOD HandleEvent(nsIPresContext* aPresContext,
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus);
PRIntn GetDefaultAlignment();
void ToggleCheckState();
}; // class nsXULCheckboxFrame

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

@ -146,19 +146,9 @@ XUL_ATOM(editor, "editor")
XUL_ATOM(checkbox, "checkbox")
XUL_ATOM(radio, "radio")
XUL_ATOM(radiogroup, "radiogroup")
XUL_ATOM(menulist, "menulist")
XUL_ATOM(menubutton, "menubutton")
XUL_ATOM(textfield, "textfield")
XUL_ATOM(textarea, "textarea")
XUL_ATOM(listbox, "listbox")
XUL_ATOM(listcaption, "listcaption") // The caption of a list view
XUL_ATOM(listhead, "listhead") // The header of the list view
XUL_ATOM(listrow, "listrow") // A row in the list view
XUL_ATOM(listcell, "listcell") // An item in the list view
XUL_ATOM(listitem, "listitem") // A cell in the list view
XUL_ATOM(listchildren, "listchildren") // The children of an item in the list view
XUL_ATOM(listindentation, "listindentation") // Specifies that the indentation for the level should occur here.
XUL_ATOM(listcol, "listcol") // A column in the list view
XUL_ATOM(listcolgroup, "listcolgroup") // A column group in the list view
XUL_ATOM(listfoot, "listfoot") // The footer of the list view

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

@ -18,6 +18,7 @@ nsIXULContent.h
nsIDOMXULTitledButtonElement.h
nsIDOMXULCheckboxElement.h
nsIDOMXULRadioElement.h
nsIDOMXULRadioGroupElement.h
nsIDOMXULMenuListElement.h

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

@ -49,6 +49,7 @@ EXPORTS = \
nsIDOMXULTitledButtonElement.h \
nsIDOMXULCheckboxElement.h \
nsIDOMXULRadioElement.h \
nsIDOMXULRadioGroupElement.h \
nsIDOMXULMenuListElement.h \
$(NULL)

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

@ -0,0 +1,7 @@
interface XULRadioGroupElement : XULElement {
/* IID: { 0xc2dd83e1, 0xef22, 0x11d3, \
{ 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } } */
attribute XULRadioElement selectedItem;
};

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

@ -36,6 +36,7 @@ IDLSRCS = \
XULTitledButtonElement.idl \
XULCheckboxElement.idl \
XULRadioElement.idl \
XULRadioGroupElement.idl \
XULMenuListElement.idl \
$(NULL)

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

@ -45,6 +45,7 @@ EXPORTS = \
nsIDOMXULTitledButtonElement.h \
nsIDOMXULCheckboxElement.h \
nsIDOMXULRadioElement.h \
nsIDOMXULRadioGroupElement.h \
nsIDOMXULMenuListElement.h \
$(NULL)

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

@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/* AUTO-GENERATED. DO NOT EDIT!!! */
#ifndef nsIDOMXULRadioGroupElement_h__
#define nsIDOMXULRadioGroupElement_h__
#include "nsISupports.h"
#include "nsString.h"
#include "nsIScriptContext.h"
#include "nsIDOMXULElement.h"
class nsIDOMXULRadioElement;
#define NS_IDOMXULRADIOGROUPELEMENT_IID \
{ 0xc2dd83e1, 0xef22, 0x11d3, \
{ 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } }
class nsIDOMXULRadioGroupElement : public nsIDOMXULElement {
public:
static const nsIID& GetIID() { static nsIID iid = NS_IDOMXULRADIOGROUPELEMENT_IID; return iid; }
NS_IMETHOD GetSelectedItem(nsIDOMXULRadioElement** aSelectedItem)=0;
NS_IMETHOD SetSelectedItem(nsIDOMXULRadioElement* aSelectedItem)=0;
};
#define NS_DECL_IDOMXULRADIOGROUPELEMENT \
NS_IMETHOD GetSelectedItem(nsIDOMXULRadioElement** aSelectedItem); \
NS_IMETHOD SetSelectedItem(nsIDOMXULRadioElement* aSelectedItem); \
#define NS_FORWARD_IDOMXULRADIOGROUPELEMENT(_to) \
NS_IMETHOD GetSelectedItem(nsIDOMXULRadioElement** aSelectedItem) { return _to GetSelectedItem(aSelectedItem); } \
NS_IMETHOD SetSelectedItem(nsIDOMXULRadioElement* aSelectedItem) { return _to SetSelectedItem(aSelectedItem); } \
extern "C" NS_DOM nsresult NS_InitXULRadioGroupElementClass(nsIScriptContext *aContext, void **aPrototype);
extern "C" NS_DOM nsresult NS_NewScriptXULRadioGroupElement(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn);
#endif // nsIDOMXULRadioGroupElement_h__

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

@ -45,6 +45,7 @@ CPPSRCS = \
nsJSXULTitledButtonElement.cpp \
nsJSXULCheckboxElement.cpp \
nsJSXULRadioElement.cpp \
nsJSXULRadioGroupElement.cpp \
nsJSXULMenuListElement.cpp \
nsRDFDOMNodeList.cpp \
nsXULElement.cpp \
@ -68,6 +69,7 @@ CPPSRCS = \
nsXULTitledButtonElement.cpp \
nsXULCheckboxElement.cpp \
nsXULRadioElement.cpp \
nsXULRadioGroupElement.cpp \
nsXULMenuListElement.cpp \
$(NULL)

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

@ -51,6 +51,7 @@ CPP_OBJS=\
.\$(OBJDIR)\nsJSXULTitledButtonElement.obj \
.\$(OBJDIR)\nsJSXULCheckboxElement.obj \
.\$(OBJDIR)\nsJSXULRadioElement.obj \
.\$(OBJDIR)\nsJSXULRadioGroupElement.obj \
.\$(OBJDIR)\nsJSXULMenuListElement.obj \
.\$(OBJDIR)\nsRDFDOMNodeList.obj \
.\$(OBJDIR)\nsXULElement.obj \
@ -68,6 +69,7 @@ CPP_OBJS=\
.\$(OBJDIR)\nsXULMenuListElement.obj \
.\$(OBJDIR)\nsXULCheckboxElement.obj \
.\$(OBJDIR)\nsXULRadioElement.obj \
.\$(OBJDIR)\nsXULRadioGroupElement.obj \
$(NULL)
# XXX we are including layout\html\base\src to get HTML elements

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

@ -0,0 +1,333 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/* AUTO-GENERATED. DO NOT EDIT!!! */
#include "jsapi.h"
#include "nsJSUtils.h"
#include "nsDOMError.h"
#include "nscore.h"
#include "nsIServiceManager.h"
#include "nsIScriptContext.h"
#include "nsIScriptSecurityManager.h"
#include "nsIJSScriptObject.h"
#include "nsIScriptObjectOwner.h"
#include "nsIScriptGlobalObject.h"
#include "nsCOMPtr.h"
#include "nsDOMPropEnums.h"
#include "nsString.h"
#include "nsIDOMXULRadioGroupElement.h"
#include "nsIDOMXULRadioElement.h"
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
static NS_DEFINE_IID(kIJSScriptObjectIID, NS_IJSSCRIPTOBJECT_IID);
static NS_DEFINE_IID(kIScriptGlobalObjectIID, NS_ISCRIPTGLOBALOBJECT_IID);
static NS_DEFINE_IID(kIXULRadioGroupElementIID, NS_IDOMXULRADIOGROUPELEMENT_IID);
static NS_DEFINE_IID(kIXULRadioElementIID, NS_IDOMXULRADIOELEMENT_IID);
//
// XULRadioGroupElement property ids
//
enum XULRadioGroupElement_slots {
XULRADIOGROUPELEMENT_SELECTEDITEM = -1
};
/***********************************************************************/
//
// XULRadioGroupElement Properties Getter
//
PR_STATIC_CALLBACK(JSBool)
GetXULRadioGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsIDOMXULRadioGroupElement *a = (nsIDOMXULRadioGroupElement*)nsJSUtils::nsGetNativeThis(cx, obj);
// If there's no private data, this must be the prototype, so ignore
if (nsnull == a) {
return JS_TRUE;
}
if (JSVAL_IS_INT(id)) {
nsresult rv;
NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,
NS_SCRIPTSECURITYMANAGER_PROGID, &rv);
if (NS_FAILED(rv)) {
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_SECMAN_ERR);
}
switch(JSVAL_TO_INT(id)) {
case XULRADIOGROUPELEMENT_SELECTEDITEM:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULRADIOGROUPELEMENT_SELECTEDITEM, PR_FALSE);
if (NS_FAILED(rv)) {
return nsJSUtils::nsReportError(cx, obj, rv);
}
nsIDOMXULRadioElement* prop;
nsresult result = NS_OK;
result = a->GetSelectedItem(&prop);
if (NS_SUCCEEDED(result)) {
// get the js object
nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp);
}
else {
return nsJSUtils::nsReportError(cx, obj, result);
}
break;
}
default:
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, obj, id, vp);
}
}
else {
return nsJSUtils::nsCallJSScriptObjectGetProperty(a, cx, obj, id, vp);
}
return PR_TRUE;
}
/***********************************************************************/
//
// XULRadioGroupElement Properties Setter
//
PR_STATIC_CALLBACK(JSBool)
SetXULRadioGroupElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
{
nsIDOMXULRadioGroupElement *a = (nsIDOMXULRadioGroupElement*)nsJSUtils::nsGetNativeThis(cx, obj);
// If there's no private data, this must be the prototype, so ignore
if (nsnull == a) {
return JS_TRUE;
}
if (JSVAL_IS_INT(id)) {
nsresult rv;
NS_WITH_SERVICE(nsIScriptSecurityManager, secMan,
NS_SCRIPTSECURITYMANAGER_PROGID, &rv);
if (NS_FAILED(rv)) {
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_SECMAN_ERR);
}
switch(JSVAL_TO_INT(id)) {
case XULRADIOGROUPELEMENT_SELECTEDITEM:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULRADIOGROUPELEMENT_SELECTEDITEM, PR_TRUE);
if (NS_FAILED(rv)) {
return nsJSUtils::nsReportError(cx, obj, rv);
}
nsIDOMXULRadioElement* prop;
if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop,
kIXULRadioElementIID, "XULRadioElement",
cx, *vp)) {
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
}
a->SetSelectedItem(prop);
NS_IF_RELEASE(prop);
break;
}
default:
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, obj, id, vp);
}
}
else {
return nsJSUtils::nsCallJSScriptObjectSetProperty(a, cx, obj, id, vp);
}
return PR_TRUE;
}
//
// XULRadioGroupElement finalizer
//
PR_STATIC_CALLBACK(void)
FinalizeXULRadioGroupElement(JSContext *cx, JSObject *obj)
{
nsJSUtils::nsGenericFinalize(cx, obj);
}
//
// XULRadioGroupElement enumerate
//
PR_STATIC_CALLBACK(JSBool)
EnumerateXULRadioGroupElement(JSContext *cx, JSObject *obj)
{
return nsJSUtils::nsGenericEnumerate(cx, obj);
}
//
// XULRadioGroupElement resolve
//
PR_STATIC_CALLBACK(JSBool)
ResolveXULRadioGroupElement(JSContext *cx, JSObject *obj, jsval id)
{
return nsJSUtils::nsGenericResolve(cx, obj, id);
}
/***********************************************************************/
//
// class for XULRadioGroupElement
//
JSClass XULRadioGroupElementClass = {
"XULRadioGroupElement",
JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
JS_PropertyStub,
JS_PropertyStub,
GetXULRadioGroupElementProperty,
SetXULRadioGroupElementProperty,
EnumerateXULRadioGroupElement,
ResolveXULRadioGroupElement,
JS_ConvertStub,
FinalizeXULRadioGroupElement,
nsnull,
nsJSUtils::nsCheckAccess
};
//
// XULRadioGroupElement class properties
//
static JSPropertySpec XULRadioGroupElementProperties[] =
{
{"selectedItem", XULRADIOGROUPELEMENT_SELECTEDITEM, JSPROP_ENUMERATE},
{0}
};
//
// XULRadioGroupElement class methods
//
static JSFunctionSpec XULRadioGroupElementMethods[] =
{
{0}
};
//
// XULRadioGroupElement constructor
//
PR_STATIC_CALLBACK(JSBool)
XULRadioGroupElement(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
return JS_FALSE;
}
//
// XULRadioGroupElement class initialization
//
extern "C" NS_DOM nsresult NS_InitXULRadioGroupElementClass(nsIScriptContext *aContext, void **aPrototype)
{
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
JSObject *proto = nsnull;
JSObject *constructor = nsnull;
JSObject *parent_proto = nsnull;
JSObject *global = JS_GetGlobalObject(jscontext);
jsval vp;
if ((PR_TRUE != JS_LookupProperty(jscontext, global, "XULRadioGroupElement", &vp)) ||
!JSVAL_IS_OBJECT(vp) ||
((constructor = JSVAL_TO_OBJECT(vp)) == nsnull) ||
(PR_TRUE != JS_LookupProperty(jscontext, JSVAL_TO_OBJECT(vp), "prototype", &vp)) ||
!JSVAL_IS_OBJECT(vp)) {
if (NS_OK != NS_InitXULElementClass(aContext, (void **)&parent_proto)) {
return NS_ERROR_FAILURE;
}
proto = JS_InitClass(jscontext, // context
global, // global object
parent_proto, // parent proto
&XULRadioGroupElementClass, // JSClass
XULRadioGroupElement, // JSNative ctor
0, // ctor args
XULRadioGroupElementProperties, // proto props
XULRadioGroupElementMethods, // proto funcs
nsnull, // ctor props (static)
nsnull); // ctor funcs (static)
if (nsnull == proto) {
return NS_ERROR_FAILURE;
}
}
else if ((nsnull != constructor) && JSVAL_IS_OBJECT(vp)) {
proto = JSVAL_TO_OBJECT(vp);
}
else {
return NS_ERROR_FAILURE;
}
if (aPrototype) {
*aPrototype = proto;
}
return NS_OK;
}
//
// Method for creating a new XULRadioGroupElement JavaScript object
//
extern "C" NS_DOM nsresult NS_NewScriptXULRadioGroupElement(nsIScriptContext *aContext, nsISupports *aSupports, nsISupports *aParent, void **aReturn)
{
NS_PRECONDITION(nsnull != aContext && nsnull != aSupports && nsnull != aReturn, "null argument to NS_NewScriptXULRadioGroupElement");
JSObject *proto;
JSObject *parent;
nsIScriptObjectOwner *owner;
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
nsresult result = NS_OK;
nsIDOMXULRadioGroupElement *aXULRadioGroupElement;
if (nsnull == aParent) {
parent = nsnull;
}
else if (NS_OK == aParent->QueryInterface(kIScriptObjectOwnerIID, (void**)&owner)) {
if (NS_OK != owner->GetScriptObject(aContext, (void **)&parent)) {
NS_RELEASE(owner);
return NS_ERROR_FAILURE;
}
NS_RELEASE(owner);
}
else {
return NS_ERROR_FAILURE;
}
if (NS_OK != NS_InitXULRadioGroupElementClass(aContext, (void **)&proto)) {
return NS_ERROR_FAILURE;
}
result = aSupports->QueryInterface(kIXULRadioGroupElementIID, (void **)&aXULRadioGroupElement);
if (NS_OK != result) {
return result;
}
// create a js object for this class
*aReturn = JS_NewObject(jscontext, &XULRadioGroupElementClass, proto, parent);
if (nsnull != *aReturn) {
// connect the native object to the js object
JS_SetPrivate(jscontext, (JSObject *)*aReturn, aXULRadioGroupElement);
}
else {
NS_RELEASE(aXULRadioGroupElement);
return NS_ERROR_FAILURE;
}
return NS_OK;
}

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

@ -96,6 +96,7 @@
#include "nsXULTitledButtonElement.h"
#include "nsXULCheckboxElement.h"
#include "nsXULRadioElement.h"
#include "nsXULRadioGroupElement.h"
#include "nsXULMenuListElement.h"
#include "prlog.h"
@ -296,6 +297,7 @@ nsIAtom* nsXULElement::kWindowAtom;
nsIAtom* nsXULElement::kNullAtom;
nsIAtom* nsXULElement::kCheckboxAtom;
nsIAtom* nsXULElement::kRadioAtom;
nsIAtom* nsXULElement::kRadioGroupAtom;
nsIAtom* nsXULElement::kMenuListAtom;
nsIAtom* nsXULElement::kMenuButtonAtom;
@ -367,6 +369,7 @@ nsXULElement::Init()
kWindowAtom = NS_NewAtom("window");
kCheckboxAtom = NS_NewAtom("checkbox");
kRadioAtom = NS_NewAtom("radio");
kRadioGroupAtom = NS_NewAtom("radiogroup");
kMenuListAtom = NS_NewAtom("menulist");
kMenuButtonAtom = NS_NewAtom("menubutton");
kNullAtom = NS_NewAtom("");
@ -449,6 +452,7 @@ nsXULElement::~nsXULElement()
NS_IF_RELEASE(kWindowAtom);
NS_IF_RELEASE(kCheckboxAtom);
NS_IF_RELEASE(kRadioAtom);
NS_IF_RELEASE(kRadioGroupAtom);
NS_IF_RELEASE(kMenuListAtom);
NS_IF_RELEASE(kMenuButtonAtom);
NS_IF_RELEASE(kNullAtom);
@ -722,6 +726,20 @@ nsXULElement::QueryInterface(REFNSIID iid, void** result)
return InnerXULElement()->QueryInterface(iid, result);
}
else if (iid.Equals(NS_GET_IID(nsIDOMXULRadioGroupElement)) &&
(NameSpaceID() == kNameSpaceID_XUL) &&
(Tag() == kRadioGroupAtom)) {
// We delegate XULRadioElement APIs to an aggregate object
if (! InnerXULElement()) {
rv = EnsureSlots();
if (NS_FAILED(rv)) return rv;
if ((mSlots->mInnerXULElement = new nsXULRadioGroupElement(this)) == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
}
return InnerXULElement()->QueryInterface(iid, result);
}
else if (iid.Equals(NS_GET_IID(nsIDOMXULMenuListElement)) &&
(NameSpaceID() == kNameSpaceID_XUL) &&
(Tag() == kMenuListAtom)) {
@ -1788,6 +1806,10 @@ nsXULElement::GetScriptObject(nsIScriptContext* aContext, void** aScriptObject)
fn = NS_NewScriptXULRadioElement;
rootname = "nsXULRadioElement::mScriptObject";
}
else if (Tag() == kRadioGroupAtom) {
fn = NS_NewScriptXULRadioGroupElement;
rootname = "nsXULRadioGroupElement::mScriptObject";
}
else if (Tag() == kMenuListAtom) {
fn = NS_NewScriptXULMenuListElement;
rootname = "nsXULMenuListElement::mScriptObject";

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

@ -344,6 +344,7 @@ protected:
static nsIAtom* kTitledButtonAtom;
static nsIAtom* kCheckboxAtom;
static nsIAtom* kRadioAtom;
static nsIAtom* kRadioGroupAtom;
static nsIAtom* kTooltipAtom;
static nsIAtom* kTreeAtom;
static nsIAtom* kTreeCellAtom;

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

@ -0,0 +1,92 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
Implementation methods for the XUL radio element APIs.
*/
#include "nsCOMPtr.h"
#include "nsRDFCID.h"
#include "nsXULRadioGroupElement.h"
#include "nsIContent.h"
#include "nsIDocument.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsINameSpaceManager.h"
#include "nsIServiceManager.h"
#include "nsString.h"
//#include "nsIPopupSetFrame.h"
//#include "nsIMenuFrame.h"
//#include "nsIFrame.h"
NS_IMPL_ADDREF_INHERITED(nsXULRadioGroupElement, nsXULAggregateElement);
NS_IMPL_RELEASE_INHERITED(nsXULRadioGroupElement, nsXULAggregateElement);
nsresult
nsXULRadioGroupElement::QueryInterface(REFNSIID aIID, void** aResult)
{
NS_PRECONDITION(aResult != nsnull, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(NS_GET_IID(nsIDOMXULRadioGroupElement))) {
*aResult = NS_STATIC_CAST(nsIDOMXULRadioGroupElement*, this);
}
else {
return nsXULAggregateElement::QueryInterface(aIID, aResult);
}
NS_ADDREF(NS_REINTERPRET_CAST(nsISupports*, *aResult));
return NS_OK;
}
MOZ_DECL_CTOR_COUNTER(RDF_nsXULRadioGroupElement);
nsXULRadioGroupElement::nsXULRadioGroupElement(nsIDOMXULElement* aOuter)
: nsXULAggregateElement(aOuter)
{
}
nsXULRadioGroupElement::~nsXULRadioGroupElement()
{
}
NS_IMETHODIMP
nsXULRadioGroupElement::GetSelectedItem(nsIDOMXULRadioElement** aResult)
{
*aResult = mSelectedItem;
NS_IF_ADDREF(*aResult);
return NS_OK;
}
NS_IMETHODIMP
nsXULRadioGroupElement::SetSelectedItem(nsIDOMXULRadioElement* aItem)
{
if (mSelectedItem)
mSelectedItem->SetChecked(PR_FALSE);
mSelectedItem = aItem;
if (mSelectedItem)
mSelectedItem->SetChecked(PR_TRUE);
return NS_OK;
}

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

@ -0,0 +1,63 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
An aggregate object that implements the XUL Radio widget APIs
*/
#ifndef nsXULRadioGroupElement_h__
#define nsXULRadioGroupElement_h__
#include "nsXULElement.h"
#include "nsIDOMXULRadioGroupElement.h"
#include "nsIDOMXULRadioElement.h"
#include "nsCOMPtr.h"
class nsXULRadioGroupElement : public nsXULAggregateElement,
public nsIDOMXULRadioGroupElement
{
public:
nsXULRadioGroupElement(nsIDOMXULElement* aOuter);
~nsXULRadioGroupElement();
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode interface
NS_FORWARD_IDOMNODE(mOuter->);
// nsIDOMElement interface
NS_FORWARD_IDOMELEMENT(mOuter->);
// nsIDOMXULElement interface
NS_FORWARD_IDOMXULELEMENT(mOuter->);
// nsIDOMXULRadioGroupElement interface
NS_DECL_IDOMXULRADIOGROUPELEMENT;
protected:
nsCOMPtr<nsIDOMXULRadioElement> mSelectedItem;
};
#endif // nsXULRadioGroupElement_h__

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

@ -1610,6 +1610,27 @@ html|input[type=radio][disabled] {
/********** checkbox **********/
checkbox {
list-style-image: url(chrome://global/skin/scroll-up.gif);
}
checkbox[checked="true"] {
list-style-image: url(chrome://global/skin/scroll-down.gif);
}
radio {
list-style-image: url(chrome://global/skin/scroll-up.gif);
}
radio[checked="true"] {
list-style-image: url(chrome://global/skin/scroll-down.gif);
}
radiogroup {
border: 1px solid black;
}
html|input[type=checkbox] {
padding: 0px 1px 1px 0px;
margin: 3px 5px 4px 3px;

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

@ -450,3 +450,13 @@ grippy {
display: block;
}
/********** checkbox **********/
checkbox {
behavior: url(resource:/chrome/xulBindings.xml#checkbox);
}
radiogroup {
behavior: url(resource:/chrome/xulBindings.xml#radiogroup);
}

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

@ -83,4 +83,19 @@
</content>
</binding>
<binding name="checkbox">
<handlers>
<handler type="mouseup" value="this.checked = !this.checked;"/>
<handler type="keypress" key=" " value="this.checked = !this.checked;"/>
</handlers>
</binding>
<binding name="radiogroup">
<handlers>
<handler type="mouseup" value="try { this.selectedItem = event.target; } catch (e) {}"/>
<handler type="keypress" key=" " value="this.checked = !this.checked;"/>
</handlers>
</binding>
</bindings>