Skip to content

Commit

Permalink
Bug 619996, part g: Kill nsISelectElement; r=bz
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Apr 12, 2011
1 parent b867893 commit fbdb643
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 134 deletions.
1 change: 0 additions & 1 deletion content/html/content/public/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ MODULE = content
XPIDL_MODULE = content_html

XPIDLSRCS = \
nsISelectElement.idl \
nsIFormSubmitObserver.idl \
nsIPhonetic.idl \
$(NULL)
Expand Down
127 changes: 0 additions & 127 deletions content/html/content/public/nsISelectElement.idl

This file was deleted.

3 changes: 1 addition & 2 deletions content/html/content/src/nsHTMLSelectElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ DOMCI_NODE_DATA(HTMLSelectElement, nsHTMLSelectElement)

// QueryInterface implementation for nsHTMLSelectElement
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLSelectElement)
NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLSelectElement,
NS_HTML_CONTENT_INTERFACE_TABLE2(nsHTMLSelectElement,
nsIDOMHTMLSelectElement,
nsISelectElement,
nsIConstraintValidation)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLSelectElement,
nsGenericHTMLFormElement)
Expand Down
80 changes: 76 additions & 4 deletions content/html/content/src/nsHTMLSelectElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "nsCOMPtr.h"
#include "nsCOMArray.h"
#include "nsGenericHTMLElement.h"
#include "nsISelectElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLOptionElement.h"
Expand Down Expand Up @@ -243,7 +242,6 @@ class NS_STACK_CLASS nsSafeOptionListMutation
*/
class nsHTMLSelectElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLSelectElement,
public nsISelectElement,
public nsIConstraintValidation
{
public:
Expand Down Expand Up @@ -296,8 +294,82 @@ class nsHTMLSelectElement : public nsGenericHTMLFormElement,

nsEventStates IntrinsicState() const;

// nsISelectElement
NS_DECL_NSISELECTELEMENT
/**
* To be called when stuff is added under a child of the select--but *before*
* they are actually added.
*
* @param aOptions the content that was added (usually just an option, but
* could be an optgroup node with many child options)
* @param aParent the parent the options were added to (could be an optgroup)
* @param aContentIndex the index where the options are being added within the
* parent (if the parent is an optgroup, the index within the optgroup)
*/
NS_IMETHOD WillAddOptions(nsIContent* aOptions,
nsIContent* aParent,
PRInt32 aContentIndex,
PRBool aNotify);

/**
* To be called when stuff is removed under a child of the select--but
* *before* they are actually removed.
*
* @param aParent the parent the option(s) are being removed from
* @param aContentIndex the index of the option(s) within the parent (if the
* parent is an optgroup, the index within the optgroup)
*/
NS_IMETHOD WillRemoveOptions(nsIContent* aParent,
PRInt32 aContentIndex,
PRBool aNotify);

/**
* Checks whether an option is disabled (even if it's part of an optgroup)
*
* @param aIndex the index of the option to check
* @return whether the option is disabled
*/
NS_IMETHOD IsOptionDisabled(PRInt32 aIndex,
PRBool *aIsDisabled NS_OUTPARAM);

/**
* Sets multiple options (or just sets startIndex if select is single)
* and handles notifications and cleanup and everything under the sun.
* When this method exits, the select will be in a consistent state. i.e.
* if you set the last option to false, it will select an option anyway.
*
* @param aStartIndex the first index to set
* @param aEndIndex the last index to set (set same as first index for one
* option)
* @param aIsSelected whether to set the option(s) to true or false
* @param aClearAll whether to clear all other options (for example, if you
* are normal-clicking on the current option)
* @param aSetDisabled whether it is permissible to set disabled options
* (for JavaScript)
* @param aNotify whether to notify frames and such
* @return whether any options were actually changed
*/
NS_IMETHOD SetOptionsSelectedByIndex(PRInt32 aStartIndex,
PRInt32 aEndIndex,
PRBool aIsSelected,
PRBool aClearAll,
PRBool aSetDisabled,
PRBool aNotify,
PRBool* aChangedSomething NS_OUTPARAM);

/**
* Finds the index of a given option element
*
* @param aOption the option to get the index of
* @param aStartIndex the index to start looking at
* @param aForward TRUE to look forward, FALSE to look backward
* @return the option index
*/
NS_IMETHOD GetOptionIndex(nsIDOMHTMLOptionElement* aOption,
PRInt32 aStartIndex,
PRBool aForward,
PRInt32* aIndex NS_OUTPARAM);

/** Whether or not there are optgroups in this select */
NS_IMETHOD GetHasOptGroups(PRBool* aHasGroups);

/**
* Called when an attribute is about to be changed
Expand Down

0 comments on commit fbdb643

Please sign in to comment.