mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 686913 - HTMLProgressElement and HTMLMeterElement should not be form controls. r=mounir, a=mfinkle
This commit is contained in:
parent
adf465996e
commit
43713e6cef
@ -58,7 +58,6 @@ enum FormControlsTypes {
|
||||
NS_FORM_SELECT,
|
||||
NS_FORM_TEXTAREA,
|
||||
NS_FORM_OBJECT,
|
||||
NS_FORM_PROGRESS,
|
||||
eFormControlsWithoutSubTypesMax,
|
||||
// After this, all types will have sub-types which introduce new enum lists.
|
||||
// eFormControlsWithoutSubTypesMax let us know if the previous types values
|
||||
@ -284,7 +283,6 @@ nsIFormControl::IsLabelableControl() const
|
||||
// type == NS_FORM_KEYGEN ||
|
||||
// type == NS_FORM_METER ||
|
||||
type == NS_FORM_OUTPUT ||
|
||||
type == NS_FORM_PROGRESS ||
|
||||
type == NS_FORM_SELECT ||
|
||||
type == NS_FORM_TEXTAREA;
|
||||
}
|
||||
|
@ -2918,8 +2918,7 @@ nsGenericHTMLFormElement::CanBeDisabled() const
|
||||
return
|
||||
type != NS_FORM_LABEL &&
|
||||
type != NS_FORM_OBJECT &&
|
||||
type != NS_FORM_OUTPUT &&
|
||||
type != NS_FORM_PROGRESS;
|
||||
type != NS_FORM_OUTPUT;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -160,8 +160,7 @@ nsHTMLFieldSetElement::MatchListedElements(nsIContent* aContent, PRInt32 aNamesp
|
||||
nsIAtom* aAtom, void* aData)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(aContent);
|
||||
return formControl && formControl->GetType() != NS_FORM_LABEL &&
|
||||
formControl->GetType() != NS_FORM_PROGRESS;
|
||||
return formControl && formControl->GetType() != NS_FORM_LABEL;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -223,7 +223,6 @@ ShouldBeInElements(nsIFormControl* aFormControl)
|
||||
//
|
||||
// NS_FORM_INPUT_IMAGE
|
||||
// NS_FORM_LABEL
|
||||
// NS_FORM_PROGRESS
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include "nsEventStateManager.h"
|
||||
|
||||
|
||||
class nsHTMLProgressElement : public nsGenericHTMLFormElement,
|
||||
class nsHTMLProgressElement : public nsGenericHTMLElement,
|
||||
public nsIDOMHTMLProgressElement
|
||||
{
|
||||
public:
|
||||
@ -52,22 +52,17 @@ public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
// nsIDOMNode
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMElement
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
|
||||
|
||||
// nsIDOMHTMLProgressElement
|
||||
NS_DECL_NSIDOMHTMLPROGRESSELEMENT
|
||||
|
||||
// nsIFormControl
|
||||
NS_IMETHOD_(PRUint32) GetType() const { return NS_FORM_PROGRESS; }
|
||||
NS_IMETHOD Reset();
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
|
||||
|
||||
nsEventStates IntrinsicState() const;
|
||||
|
||||
nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
|
||||
@ -100,7 +95,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Progress)
|
||||
|
||||
|
||||
nsHTMLProgressElement::nsHTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
: nsGenericHTMLFormElement(aNodeInfo)
|
||||
: nsGenericHTMLElement(aNodeInfo)
|
||||
{
|
||||
// We start out indeterminate
|
||||
AddStatesSilently(NS_EVENT_STATE_INDETERMINATE);
|
||||
@ -119,7 +114,7 @@ NS_INTERFACE_TABLE_HEAD(nsHTMLProgressElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLProgressElement,
|
||||
nsIDOMHTMLProgressElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLProgressElement,
|
||||
nsGenericHTMLFormElement)
|
||||
nsGenericHTMLElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLProgressElement)
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLProgressElement)
|
||||
@ -142,7 +137,7 @@ nsHTMLProgressElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
nsEventStates
|
||||
nsHTMLProgressElement::IntrinsicState() const
|
||||
{
|
||||
nsEventStates state = nsGenericHTMLFormElement::IntrinsicState();
|
||||
nsEventStates state = nsGenericHTMLElement::IntrinsicState();
|
||||
|
||||
if (IsIndeterminate()) {
|
||||
state |= NS_EVENT_STATE_INDETERMINATE;
|
||||
@ -161,14 +156,8 @@ nsHTMLProgressElement::ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute,
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::ParseAttribute(aNamespaceID, aAttribute,
|
||||
aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLProgressElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
return nsGenericHTMLFormElement::GetForm(aForm);
|
||||
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute,
|
||||
aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -29,7 +29,6 @@ function checkFormIDLAttribute(aElement)
|
||||
{
|
||||
var form = document.forms[0];
|
||||
var content = document.getElementById('content');
|
||||
is(aElement.form, form, "The form IDL attribute should be the parent form");
|
||||
|
||||
content.removeChild(form);
|
||||
content.appendChild(aElement);
|
||||
@ -226,20 +225,6 @@ function checkFormListedElement(aElement)
|
||||
is(document.forms[0].elements.length, 0, "the form should have no element");
|
||||
}
|
||||
|
||||
function checkLabelable(aElement)
|
||||
{
|
||||
var content = document.getElementById('content');
|
||||
var label = document.createElement('label');
|
||||
|
||||
content.appendChild(label);
|
||||
label.appendChild(aElement);
|
||||
is(label.control, aElement, "progress should be labelable");
|
||||
|
||||
// Cleaning-up.
|
||||
content.removeChild(label);
|
||||
content.appendChild(aElement);
|
||||
}
|
||||
|
||||
function checkNotResetableAndFormSubmission(aElement)
|
||||
{
|
||||
// Creating an input element to check the submission worked.
|
||||
@ -312,8 +297,6 @@ checkIndeterminatePseudoClass();
|
||||
|
||||
checkFormListedElement(p);
|
||||
|
||||
checkLabelable(p);
|
||||
|
||||
checkNotResetableAndFormSubmission(p);
|
||||
|
||||
</script>
|
||||
|
@ -400,7 +400,7 @@ var forms = [
|
||||
|
||||
var elementNames = [
|
||||
'button', 'fieldset', 'input', 'label', 'object', 'output', 'select',
|
||||
'textarea', 'progress',
|
||||
'textarea',
|
||||
];
|
||||
|
||||
var todoElements = [
|
||||
|
@ -47,13 +47,12 @@
|
||||
* @status UNDER_DEVELOPMENT
|
||||
*/
|
||||
|
||||
[scriptable, uuid(842AEE33-8381-4DA4-A347-9E70C797BC3E)]
|
||||
[scriptable, uuid(275851c9-c3e2-4427-a770-3d2aaad6c546)]
|
||||
interface nsIDOMHTMLProgressElement : nsIDOMHTMLElement
|
||||
{
|
||||
attribute double value;
|
||||
attribute double max;
|
||||
readonly attribute double position;
|
||||
readonly attribute nsIDOMHTMLFormElement form;
|
||||
/**
|
||||
* The labels attribute will be done with bug 567740.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user