Bug 751035 - Remove various unused nsHTML*Element related methods. r=jst

This commit is contained in:
Ehren Metcalfe 2012-05-09 18:55:56 -04:00
Родитель cee11da7bb
Коммит 909473a2aa
16 изменённых файлов: 2 добавлений и 215 удалений

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

@ -6530,31 +6530,6 @@ nsDocument::GetCurrentRadioButton(const nsAString& aName,
return NS_OK;
}
NS_IMETHODIMP
nsDocument::GetPositionInGroup(nsIDOMHTMLInputElement *aRadio,
PRInt32 *aPositionIndex,
PRInt32 *aItemsInGroup)
{
*aPositionIndex = 0;
*aItemsInGroup = 1;
nsAutoString name;
aRadio->GetName(name);
if (name.IsEmpty()) {
return NS_OK;
}
nsRadioGroupStruct* radioGroup = GetRadioGroup(name);
NS_ENSURE_TRUE(radioGroup, NS_ERROR_OUT_OF_MEMORY);
nsCOMPtr<nsIFormControl> radioControl(do_QueryInterface(aRadio));
NS_ASSERTION(radioControl, "Radio button should implement nsIFormControl");
*aPositionIndex = radioGroup->mRadioButtons.IndexOf(radioControl);
NS_ASSERTION(*aPositionIndex >= 0, "Radio button not found in its own group");
*aItemsInGroup = radioGroup->mRadioButtons.Count();
return NS_OK;
}
NS_IMETHODIMP
nsDocument::GetNextRadioButton(const nsAString& aName,
const bool aPrevious,

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

@ -737,9 +737,6 @@ public:
nsIDOMHTMLInputElement* aRadio);
NS_IMETHOD GetCurrentRadioButton(const nsAString& aName,
nsIDOMHTMLInputElement** aRadio);
NS_IMETHOD GetPositionInGroup(nsIDOMHTMLInputElement *aRadio,
PRInt32 *aPositionIndex,
PRInt32 *aItemsInGroup);
NS_IMETHOD GetNextRadioButton(const nsAString& aName,
const bool aPrevious,
nsIDOMHTMLInputElement* aFocusedRadio,

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

@ -94,11 +94,6 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLCanvasElement,
nsGenericHTMLElement)
/**
* Ask the canvas Element to return the primary frame, if any
*/
nsIFrame *GetPrimaryCanvasFrame();
/**
* Get the size in pixels of this canvas element
*/

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

@ -120,19 +120,6 @@ public:
NS_IMETHOD RemoveFromRadioGroup(const nsAString& aName,
nsIFormControl* aRadio) = 0;
/**
* Get the radio group position and the number of radio buttons in the group.
* that the radio button is in. If the radio button not grouped with any other
* radio buttons this method will treat it as being in a group of one.
* @param aRadio radio button's pointer
* @param aPositionIndex out indicates 0-indexed position in the radio group,
* or just 0 if a group cannot be found
* @param aItemsInGroup the number of radio buttons in the group
*/
NS_IMETHOD GetPositionInGroup(nsIDOMHTMLInputElement *aRadio,
PRInt32 *aPositionIndex,
PRInt32 *aItemsInGroup) = 0;
virtual PRUint32 GetRequiredRadioCount(const nsAString& aName) const = 0;
virtual void RadioRequiredChanged(const nsAString& aName,
nsIFormControl* aRadio) = 0;

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

@ -50,8 +50,8 @@ class nsTextControlFrame;
// IID for the nsITextControl interface
#define NS_ITEXTCONTROLELEMENT_IID \
{ 0x2e758eee, 0xd023, 0x4fd1, \
{ 0x97, 0x93, 0xae, 0xeb, 0xbb, 0xf3, 0xa8, 0x3f } }
{ 0xe0a05008, 0xef02, 0x4fa2, \
{ 0x93, 0xf2, 0x78, 0xe1, 0xec, 0xf7, 0x5b, 0x79 } }
/**
* This interface is used for the text control frame to get the editor and
@ -127,14 +127,6 @@ public:
*/
NS_IMETHOD_(void) GetTextEditorValue(nsAString& aValue, bool aIgnoreWrap) const = 0;
/**
* Set the current value of the text editor.
*
* @param aValue the new value for the text control.
* @param aUserInput whether this value is coming from user input.
*/
NS_IMETHOD_(void) SetTextEditorValue(const nsAString& aValue, bool aUserInput) = 0;
/**
* Get the editor object associated with the text editor.
* The return value is null if the control does not support an editor
@ -190,11 +182,6 @@ public:
*/
NS_IMETHOD_(void) InitializeKeyboardEventListeners() = 0;
/**
* Notify the text control that the placeholder text needs to be updated.
*/
NS_IMETHOD_(void) UpdatePlaceholderText(bool aNotify) = 0;
/**
* Show/hide the placeholder for the control.
*/

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

@ -2311,19 +2311,6 @@ nsGenericHTMLElement::SetUnsignedIntAttr(nsIAtom* aAttr, PRUint32 aValue)
return SetAttr(kNameSpaceID_None, aAttr, value, true);
}
nsresult
nsGenericHTMLElement::GetDoubleAttr(nsIAtom* aAttr, double aDefault, double* aResult)
{
const nsAttrValue* attrVal = mAttrsAndChildren.GetAttr(aAttr);
if (attrVal && attrVal->Type() == nsAttrValue::eDoubleValue) {
*aResult = attrVal->GetDoubleValue();
}
else {
*aResult = aDefault;
}
return NS_OK;
}
nsresult
nsGenericHTMLElement::SetDoubleAttr(nsIAtom* aAttr, double aValue)
{

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

@ -692,19 +692,6 @@ protected:
NS_HIDDEN_(nsresult) SetUnsignedIntAttr(nsIAtom* aAttr, PRUint32 aValue);
/**
* Helper method for NS_IMPL_DOUBLE_ATTR macro.
* Gets the double-value of an attribute, returns specified default value
* if the attribute isn't set or isn't set to a double. Only works for
* attributes in null namespace.
*
* @param aAttr name of attribute.
* @param aDefault default-value to return if attribute isn't set.
* @param aResult result value [out]
*/
NS_HIDDEN_(nsresult) GetDoubleAttr(nsIAtom* aAttr, double aDefault, double* aValue);
/**
* Helper method for NS_IMPL_DOUBLE_ATTR macro.
* Sets value of attribute to specified double. Only works for attributes
* in null namespace.
*
@ -1092,26 +1079,6 @@ PR_STATIC_ASSERT(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + 1 < 32);
return SetUnsignedIntAttr(nsGkAtoms::_atom, aValue); \
}
/**
* A macro to implement the getter and setter for a given double-precision
* floating point valued content property. The method uses GetDoubleAttr and
* SetDoubleAttr methods.
*/
#define NS_IMPL_DOUBLE_ATTR(_class, _method, _atom) \
NS_IMPL_DOUBLE_ATTR_DEFAULT_VALUE(_class, _method, _atom, 0.0)
#define NS_IMPL_DOUBLE_ATTR_DEFAULT_VALUE(_class, _method, _atom, _default) \
NS_IMETHODIMP \
_class::Get##_method(double* aValue) \
{ \
return GetDoubleAttr(nsGkAtoms::_atom, _default, aValue); \
} \
NS_IMETHODIMP \
_class::Set##_method(double aValue) \
{ \
return SetDoubleAttr(nsGkAtoms::_atom, aValue); \
}
/**
* A macro to implement the getter and setter for a given content
* property that needs to return a URI in string form. The method

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

@ -167,11 +167,6 @@ protected:
bool mDisabledChanged;
bool mInInternalActivate;
bool mInhibitStateRestoration;
private:
// The analogue of defaultValue in the DOM for input and textarea
nsresult SetDefaultValue(const nsAString& aDefaultValue);
nsresult GetDefaultValue(nsAString& aDefaultValue);
};
@ -530,19 +525,6 @@ nsHTMLButtonElement::UnbindFromTree(bool aDeep, bool aNullParent)
UpdateState(false);
}
nsresult
nsHTMLButtonElement::GetDefaultValue(nsAString& aDefaultValue)
{
GetAttr(kNameSpaceID_None, nsGkAtoms::value, aDefaultValue);
return NS_OK;
}
nsresult
nsHTMLButtonElement::SetDefaultValue(const nsAString& aDefaultValue)
{
return SetAttr(kNameSpaceID_None, nsGkAtoms::value, aDefaultValue, true);
}
NS_IMETHODIMP
nsHTMLButtonElement::Reset()
{

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

@ -659,12 +659,6 @@ nsHTMLCanvasElement::UpdateContext(nsIPropertyBag *aNewContextOptions)
return rv;
}
nsIFrame *
nsHTMLCanvasElement::GetPrimaryCanvasFrame()
{
return GetPrimaryFrame(Flush_Frames);
}
nsIntSize
nsHTMLCanvasElement::GetSize()
{

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

@ -1909,41 +1909,6 @@ nsHTMLFormElement::GetCurrentRadioButton(const nsAString& aName,
return NS_OK;
}
NS_IMETHODIMP
nsHTMLFormElement::GetPositionInGroup(nsIDOMHTMLInputElement *aRadio,
PRInt32 *aPositionIndex,
PRInt32 *aItemsInGroup)
{
*aPositionIndex = 0;
*aItemsInGroup = 1;
nsAutoString name;
aRadio->GetName(name);
if (name.IsEmpty()) {
return NS_OK;
}
nsCOMPtr<nsISupports> itemWithName;
itemWithName = ResolveName(name);
NS_ENSURE_TRUE(itemWithName, NS_ERROR_FAILURE);
nsCOMPtr<nsINodeList> radioGroup(do_QueryInterface(itemWithName));
NS_ASSERTION(radioGroup, "No such radio group in this container");
if (!radioGroup) {
return NS_OK;
}
nsCOMPtr<nsIContent> currentRadioNode(do_QueryInterface(aRadio));
NS_ASSERTION(currentRadioNode, "No nsIContent for current radio button");
*aPositionIndex = radioGroup->IndexOf(currentRadioNode);
NS_ASSERTION(*aPositionIndex >= 0, "Radio button not found in its own group");
PRUint32 itemsInGroup;
radioGroup->GetLength(&itemsInGroup);
*aItemsInGroup = itemsInGroup;
return NS_OK;
}
NS_IMETHODIMP
nsHTMLFormElement::GetNextRadioButton(const nsAString& aName,
const bool aPrevious,

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

@ -98,9 +98,6 @@ public:
nsIDOMHTMLInputElement* aRadio);
NS_IMETHOD GetCurrentRadioButton(const nsAString& aName,
nsIDOMHTMLInputElement** aRadio);
NS_IMETHOD GetPositionInGroup(nsIDOMHTMLInputElement *aRadio,
PRInt32 *aPositionIndex,
PRInt32 *aItemsInGroup);
NS_IMETHOD GetNextRadioButton(const nsAString& aName,
const bool aPrevious,
nsIDOMHTMLInputElement* aFocusedRadio,

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

@ -1238,15 +1238,6 @@ nsHTMLInputElement::GetPlaceholderNode()
return nsnull;
}
NS_IMETHODIMP_(void)
nsHTMLInputElement::UpdatePlaceholderText(bool aNotify)
{
nsTextEditorState *state = GetEditorState();
if (state) {
state->UpdatePlaceholderText(aNotify);
}
}
NS_IMETHODIMP_(void)
nsHTMLInputElement::SetPlaceholderClass(bool aVisible, bool aNotify)
{
@ -4099,16 +4090,6 @@ nsHTMLInputElement::GetTextEditorValue(nsAString& aValue,
}
}
NS_IMETHODIMP_(void)
nsHTMLInputElement::SetTextEditorValue(const nsAString& aValue,
bool aUserInput)
{
nsTextEditorState *state = GetEditorState();
if (state) {
state->SetValue(aValue, aUserInput);
}
}
NS_IMETHODIMP_(void)
nsHTMLInputElement::InitializeKeyboardEventListeners()
{

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

@ -182,7 +182,6 @@ public:
NS_IMETHOD_(void) GetDefaultValueFromContent(nsAString& aValue);
NS_IMETHOD_(bool) ValueChanged() const;
NS_IMETHOD_(void) GetTextEditorValue(nsAString& aValue, bool aIgnoreWrap) const;
NS_IMETHOD_(void) SetTextEditorValue(const nsAString& aValue, bool aUserInput);
NS_IMETHOD_(nsIEditor*) GetTextEditor();
NS_IMETHOD_(nsISelectionController*) GetSelectionController();
NS_IMETHOD_(nsFrameSelection*) GetConstFrameSelection();
@ -192,7 +191,6 @@ public:
NS_IMETHOD_(nsIContent*) GetRootEditorNode();
NS_IMETHOD_(nsIContent*) CreatePlaceholderNode();
NS_IMETHOD_(nsIContent*) GetPlaceholderNode();
NS_IMETHOD_(void) UpdatePlaceholderText(bool aNotify);
NS_IMETHOD_(void) SetPlaceholderClass(bool aVisible, bool aNotify);
NS_IMETHOD_(void) InitializeKeyboardEventListeners();
NS_IMETHOD_(void) OnValueChanged(bool aNotify);

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

@ -1815,13 +1815,6 @@ nsHTMLSelectElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
return NS_OK;
}
NS_IMETHODIMP
nsHTMLSelectElement::GetHasOptGroups(bool* aHasGroups)
{
*aHasGroups = (mOptGroupCount > 0);
return NS_OK;
}
void
nsHTMLSelectElement::DispatchContentReset()
{

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

@ -383,9 +383,6 @@ public:
bool aForward,
PRInt32* aIndex NS_OUTPARAM);
/** Whether or not there are optgroups in this select */
NS_IMETHOD GetHasOptGroups(bool* aHasGroups);
/**
* Called when an attribute is about to be changed
*/

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

@ -163,7 +163,6 @@ public:
NS_IMETHOD_(void) GetDefaultValueFromContent(nsAString& aValue);
NS_IMETHOD_(bool) ValueChanged() const;
NS_IMETHOD_(void) GetTextEditorValue(nsAString& aValue, bool aIgnoreWrap) const;
NS_IMETHOD_(void) SetTextEditorValue(const nsAString& aValue, bool aUserInput);
NS_IMETHOD_(nsIEditor*) GetTextEditor();
NS_IMETHOD_(nsISelectionController*) GetSelectionController();
NS_IMETHOD_(nsFrameSelection*) GetConstFrameSelection();
@ -173,7 +172,6 @@ public:
NS_IMETHOD_(nsIContent*) GetRootEditorNode();
NS_IMETHOD_(nsIContent*) CreatePlaceholderNode();
NS_IMETHOD_(nsIContent*) GetPlaceholderNode();
NS_IMETHOD_(void) UpdatePlaceholderText(bool aNotify);
NS_IMETHOD_(void) SetPlaceholderClass(bool aVisible, bool aNotify);
NS_IMETHOD_(void) InitializeKeyboardEventListeners();
NS_IMETHOD_(void) OnValueChanged(bool aNotify);
@ -560,12 +558,6 @@ nsHTMLTextAreaElement::GetPlaceholderNode()
return mState.GetPlaceholderNode();
}
NS_IMETHODIMP_(void)
nsHTMLTextAreaElement::UpdatePlaceholderText(bool aNotify)
{
mState.UpdatePlaceholderText(aNotify);
}
NS_IMETHODIMP_(void)
nsHTMLTextAreaElement::SetPlaceholderClass(bool aVisible, bool aNotify)
{
@ -1541,13 +1533,6 @@ nsHTMLTextAreaElement::GetTextEditorValue(nsAString& aValue,
mState.GetValue(aValue, aIgnoreWrap);
}
NS_IMETHODIMP_(void)
nsHTMLTextAreaElement::SetTextEditorValue(const nsAString& aValue,
bool aUserInput)
{
mState.SetValue(aValue, aUserInput);
}
NS_IMETHODIMP_(void)
nsHTMLTextAreaElement::InitializeKeyboardEventListeners()
{