mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 657938 (1/2) - Implement the content part of the meter element. f=mounir r=smaug,mrbkap
This commit is contained in:
parent
8e3f4a6794
commit
7b00eb233d
@ -26,6 +26,7 @@ enum FormControlsTypes {
|
||||
NS_FORM_SELECT,
|
||||
NS_FORM_TEXTAREA,
|
||||
NS_FORM_OBJECT,
|
||||
NS_FORM_METER,
|
||||
eFormControlsWithoutSubTypesMax,
|
||||
// After this, all types will have sub-types which introduce new enum lists.
|
||||
// eFormControlsWithoutSubTypesMax let us know if the previous types values
|
||||
@ -243,13 +244,12 @@ bool
|
||||
nsIFormControl::IsLabelableControl() const
|
||||
{
|
||||
// TODO: keygen should be in that list, see bug 101019.
|
||||
// TODO: meter should be added, see bug 555985.
|
||||
// TODO: NS_FORM_INPUT_HIDDEN should be removed, see bug 597650.
|
||||
PRUint32 type = GetType();
|
||||
return type & NS_FORM_INPUT_ELEMENT ||
|
||||
type & NS_FORM_BUTTON_ELEMENT ||
|
||||
// type == NS_FORM_KEYGEN ||
|
||||
// type == NS_FORM_METER ||
|
||||
type == NS_FORM_METER ||
|
||||
type == NS_FORM_OUTPUT ||
|
||||
type == NS_FORM_SELECT ||
|
||||
type == NS_FORM_TEXTAREA;
|
||||
|
@ -58,6 +58,7 @@ CPPSRCS = \
|
||||
nsHTMLMenuElement.cpp \
|
||||
nsHTMLMenuItemElement.cpp \
|
||||
nsHTMLMetaElement.cpp \
|
||||
nsHTMLMeterElement.cpp \
|
||||
nsHTMLModElement.cpp \
|
||||
nsHTMLObjectElement.cpp \
|
||||
nsHTMLOListElement.cpp \
|
||||
|
@ -3466,7 +3466,8 @@ nsGenericHTMLFormElement::CanBeDisabled() const
|
||||
return
|
||||
type != NS_FORM_LABEL &&
|
||||
type != NS_FORM_OBJECT &&
|
||||
type != NS_FORM_OUTPUT;
|
||||
type != NS_FORM_OUTPUT &&
|
||||
type != NS_FORM_METER;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1544,6 +1544,7 @@ NS_DECLARE_NS_NEW_HTML_ELEMENT(Map)
|
||||
NS_DECLARE_NS_NEW_HTML_ELEMENT(Menu)
|
||||
NS_DECLARE_NS_NEW_HTML_ELEMENT(MenuItem)
|
||||
NS_DECLARE_NS_NEW_HTML_ELEMENT(Meta)
|
||||
NS_DECLARE_NS_NEW_HTML_ELEMENT(Meter)
|
||||
NS_DECLARE_NS_NEW_HTML_ELEMENT(Object)
|
||||
NS_DECLARE_NS_NEW_HTML_ELEMENT(OptGroup)
|
||||
NS_DECLARE_NS_NEW_HTML_ELEMENT(Option)
|
||||
|
@ -128,7 +128,8 @@ nsHTMLFieldSetElement::MatchListedElements(nsIContent* aContent, PRInt32 aNamesp
|
||||
nsIAtom* aAtom, void* aData)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(aContent);
|
||||
return formControl && formControl->GetType() != NS_FORM_LABEL;
|
||||
return formControl && formControl->GetType() != NS_FORM_LABEL &&
|
||||
formControl->GetType() != NS_FORM_METER;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -191,6 +191,7 @@ ShouldBeInElements(nsIFormControl* aFormControl)
|
||||
//
|
||||
// NS_FORM_INPUT_IMAGE
|
||||
// NS_FORM_LABEL
|
||||
// NS_FORM_METER
|
||||
|
||||
return false;
|
||||
}
|
||||
|
379
content/html/content/src/nsHTMLMeterElement.cpp
Normal file
379
content/html/content/src/nsHTMLMeterElement.cpp
Normal file
@ -0,0 +1,379 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla 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/MPL/
|
||||
*
|
||||
* 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 code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Foundation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Mounir Lamouri <mounir.lamouri@mozilla.com> (original author)
|
||||
* Vincent Lamotte <Vincent.Lamotte@ensimag.imag.fr>
|
||||
* Laurent Dulary <Laurent.Dulary@ensimag.imag.fr>
|
||||
* Yoan Teboul <Yoan.Teboul@ensimag.imag.fr>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsIDOMHTMLMeterElement.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsAttrValue.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsAlgorithm.h"
|
||||
|
||||
|
||||
class nsHTMLMeterElement : public nsGenericHTMLFormElement,
|
||||
public nsIDOMHTMLMeterElement
|
||||
{
|
||||
public:
|
||||
nsHTMLMeterElement(already_AddRefed<nsINodeInfo> aNodeInfo);
|
||||
virtual ~nsHTMLMeterElement();
|
||||
|
||||
/* nsISupports */
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
/* nsIDOMNode */
|
||||
NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
|
||||
|
||||
/* nsIDOMElement */
|
||||
NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
|
||||
|
||||
/* nsIDOMHTMLElement */
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
|
||||
|
||||
/* nsIDOMHTMLMeterElement */
|
||||
NS_DECL_NSIDOMHTMLMETERELEMENT
|
||||
|
||||
/* nsIFormControl */
|
||||
NS_IMETHOD_(PRUint32) GetType() const { return NS_FORM_METER; }
|
||||
NS_IMETHOD Reset();
|
||||
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
|
||||
|
||||
nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
|
||||
|
||||
bool ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute,
|
||||
const nsAString& aValue, nsAttrValue& aResult);
|
||||
|
||||
virtual nsXPCClassInfo* GetClassInfo();
|
||||
|
||||
virtual nsIDOMNode* AsDOMNode() { return this; }
|
||||
|
||||
protected:
|
||||
|
||||
static const double kDefaultValue;
|
||||
static const double kDefaultMin;
|
||||
static const double kDefaultMax;
|
||||
};
|
||||
|
||||
const double nsHTMLMeterElement::kDefaultValue = 0.0;
|
||||
const double nsHTMLMeterElement::kDefaultMin = 0.0;
|
||||
const double nsHTMLMeterElement::kDefaultMax = 1.0;
|
||||
|
||||
NS_IMPL_NS_NEW_HTML_ELEMENT(Meter)
|
||||
|
||||
|
||||
nsHTMLMeterElement::nsHTMLMeterElement(already_AddRefed<nsINodeInfo> aNodeInfo)
|
||||
: nsGenericHTMLFormElement(aNodeInfo)
|
||||
{
|
||||
}
|
||||
|
||||
nsHTMLMeterElement::~nsHTMLMeterElement()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(nsHTMLMeterElement, nsGenericElement)
|
||||
NS_IMPL_RELEASE_INHERITED(nsHTMLMeterElement, nsGenericElement)
|
||||
|
||||
DOMCI_NODE_DATA(HTMLMeterElement, nsHTMLMeterElement)
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD(nsHTMLMeterElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLMeterElement,
|
||||
nsIDOMHTMLMeterElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLMeterElement,
|
||||
nsGenericHTMLFormElement)
|
||||
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLMeterElement)
|
||||
|
||||
NS_IMPL_ELEMENT_CLONE(nsHTMLMeterElement)
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::Reset()
|
||||
{
|
||||
/* The meter element is not resettable. */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
|
||||
{
|
||||
/* The meter element is not submittable. */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
nsHTMLMeterElement::ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute,
|
||||
const nsAString& aValue, nsAttrValue& aResult)
|
||||
{
|
||||
if (aNamespaceID == kNameSpaceID_None) {
|
||||
if (aAttribute == nsGkAtoms::value || aAttribute == nsGkAtoms::max ||
|
||||
aAttribute == nsGkAtoms::min || aAttribute == nsGkAtoms::low ||
|
||||
aAttribute == nsGkAtoms::high || aAttribute == nsGkAtoms::optimum) {
|
||||
return aResult.ParseDoubleValue(aValue);
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::ParseAttribute(aNamespaceID, aAttribute,
|
||||
aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
{
|
||||
return nsGenericHTMLFormElement::GetForm(aForm);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::GetMin(double* aValue)
|
||||
{
|
||||
/**
|
||||
* If the attribute min is defined, the minimum is this value.
|
||||
* Otherwise, the minimum is the default value.
|
||||
*/
|
||||
const nsAttrValue* attrMin = mAttrsAndChildren.GetAttr(nsGkAtoms::min);
|
||||
if (attrMin && attrMin->Type() == nsAttrValue::eDoubleValue) {
|
||||
*aValue = attrMin->GetDoubleValue();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*aValue = kDefaultMin;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::SetMin(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::min, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::GetMax(double* aValue)
|
||||
{
|
||||
/**
|
||||
* If the attribute max is defined, the maximum is this value.
|
||||
* Otherwise, the maximum is the default value.
|
||||
* If the maximum value is less than the minimum value,
|
||||
* the maximum value is the same as the minimum value.
|
||||
*/
|
||||
const nsAttrValue* attrMax = mAttrsAndChildren.GetAttr(nsGkAtoms::max);
|
||||
if (attrMax && attrMax->Type() == nsAttrValue::eDoubleValue) {
|
||||
*aValue = attrMax->GetDoubleValue();
|
||||
} else {
|
||||
*aValue = kDefaultMax;
|
||||
}
|
||||
|
||||
double min;
|
||||
GetMin(&min);
|
||||
|
||||
*aValue = NS_MAX(*aValue, min);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::SetMax(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::max, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::GetValue(double* aValue)
|
||||
{
|
||||
/**
|
||||
* If the attribute value is defined, the actual value is this value.
|
||||
* Otherwise, the actual value is the default value.
|
||||
* If the actual value is less than the minimum value,
|
||||
* the actual value is the same as the minimum value.
|
||||
* If the actual value is greater than the maximum value,
|
||||
* the actual value is the same as the maximum value.
|
||||
*/
|
||||
const nsAttrValue* attrValue = mAttrsAndChildren.GetAttr(nsGkAtoms::value);
|
||||
if (attrValue && attrValue->Type() == nsAttrValue::eDoubleValue) {
|
||||
*aValue = attrValue->GetDoubleValue();
|
||||
} else {
|
||||
*aValue = kDefaultValue;
|
||||
}
|
||||
|
||||
double min;
|
||||
GetMin(&min);
|
||||
|
||||
if (*aValue <= min) {
|
||||
*aValue = min;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
double max;
|
||||
GetMax(&max);
|
||||
|
||||
*aValue = NS_MIN(*aValue, max);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::SetValue(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::value, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::GetLow(double* aValue)
|
||||
{
|
||||
/**
|
||||
* If the low value is defined, the low value is this value.
|
||||
* Otherwise, the low value is the minimum value.
|
||||
* If the low value is less than the minimum value,
|
||||
* the low value is the same as the minimum value.
|
||||
* If the low value is greater than the maximum value,
|
||||
* the low value is the same as the maximum value.
|
||||
*/
|
||||
|
||||
double min;
|
||||
GetMin(&min);
|
||||
|
||||
const nsAttrValue* attrLow = mAttrsAndChildren.GetAttr(nsGkAtoms::low);
|
||||
if (!attrLow || attrLow->Type() != nsAttrValue::eDoubleValue) {
|
||||
*aValue = min;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*aValue = attrLow->GetDoubleValue();
|
||||
|
||||
if (*aValue <= min) {
|
||||
*aValue = min;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
double max;
|
||||
GetMax(&max);
|
||||
|
||||
*aValue = NS_MIN(*aValue, max);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::SetLow(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::low, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::GetHigh(double* aValue)
|
||||
{
|
||||
/**
|
||||
* If the high value is defined, the high value is this value.
|
||||
* Otherwise, the high value is the maximum value.
|
||||
* If the high value is less than the low value,
|
||||
* the high value is the same as the low value.
|
||||
* If the high value is greater than the maximum value,
|
||||
* the high value is the same as the maximum value.
|
||||
*/
|
||||
|
||||
double max;
|
||||
GetMax(&max);
|
||||
|
||||
const nsAttrValue* attrHigh = mAttrsAndChildren.GetAttr(nsGkAtoms::high);
|
||||
if (!attrHigh || attrHigh->Type() != nsAttrValue::eDoubleValue) {
|
||||
*aValue = max;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*aValue = attrHigh->GetDoubleValue();
|
||||
|
||||
if (*aValue >= max) {
|
||||
*aValue = max;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
double low;
|
||||
GetLow(&low);
|
||||
|
||||
*aValue = NS_MAX(*aValue, low);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::SetHigh(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::high, aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::GetOptimum(double* aValue)
|
||||
{
|
||||
/**
|
||||
* If the optimum value is defined, the optimum value is this value.
|
||||
* Otherwise, the optimum value is the midpoint between
|
||||
* the minimum value and the maximum value :
|
||||
* min + (max - min)/2 = (min + max)/2
|
||||
* If the optimum value is less than the minimum value,
|
||||
* the optimum value is the same as the minimum value.
|
||||
* If the optimum value is greater than the maximum value,
|
||||
* the optimum value is the same as the maximum value.
|
||||
*/
|
||||
|
||||
double max;
|
||||
GetMax(&max);
|
||||
|
||||
double min;
|
||||
GetMin(&min);
|
||||
|
||||
const nsAttrValue* attrOptimum =
|
||||
mAttrsAndChildren.GetAttr(nsGkAtoms::optimum);
|
||||
if (!attrOptimum || attrOptimum->Type() != nsAttrValue::eDoubleValue) {
|
||||
*aValue = (min + max) / 2.0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*aValue = attrOptimum->GetDoubleValue();
|
||||
|
||||
if (*aValue <= min) {
|
||||
*aValue = min;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*aValue = NS_MIN(*aValue, max);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLMeterElement::SetOptimum(double aValue)
|
||||
{
|
||||
return SetDoubleAttr(nsGkAtoms::optimum, aValue);
|
||||
}
|
||||
|
@ -248,6 +248,7 @@
|
||||
#include "nsIDOMHTMLMenuElement.h"
|
||||
#include "nsIDOMHTMLMenuItemElement.h"
|
||||
#include "nsIDOMHTMLMetaElement.h"
|
||||
#include "nsIDOMHTMLMeterElement.h"
|
||||
#include "nsIDOMHTMLModElement.h"
|
||||
#include "nsIDOMHTMLOListElement.h"
|
||||
#include "nsIDOMHTMLObjectElement.h"
|
||||
@ -905,6 +906,8 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
ELEMENT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(HTMLMetaElement, nsElementSH,
|
||||
ELEMENT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(HTMLMeterElement, nsElementSH,
|
||||
ELEMENT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(HTMLModElement, nsElementSH,
|
||||
ELEMENT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(HTMLOListElement, nsElementSH,
|
||||
@ -2918,6 +2921,11 @@ nsDOMClassInfo::Init()
|
||||
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(HTMLMeterElement, nsIDOMHTMLMeterElement)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLMeterElement)
|
||||
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(HTMLModElement, nsIDOMHTMLModElement)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLModElement)
|
||||
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
||||
|
@ -95,6 +95,7 @@ DOMCI_CLASS(HTMLMapElement)
|
||||
DOMCI_CLASS(HTMLMenuElement)
|
||||
DOMCI_CLASS(HTMLMenuItemElement)
|
||||
DOMCI_CLASS(HTMLMetaElement)
|
||||
DOMCI_CLASS(HTMLMeterElement)
|
||||
DOMCI_CLASS(HTMLModElement)
|
||||
DOMCI_CLASS(HTMLOListElement)
|
||||
DOMCI_CLASS(HTMLObjectElement)
|
||||
|
@ -51,6 +51,7 @@ SDK_XPIDLSRCS = \
|
||||
nsIDOMHTMLMenuElement.idl \
|
||||
nsIDOMHTMLMenuItemElement.idl \
|
||||
nsIDOMHTMLMetaElement.idl \
|
||||
nsIDOMHTMLMeterElement.idl \
|
||||
nsIDOMHTMLModElement.idl \
|
||||
nsIDOMHTMLOListElement.idl \
|
||||
nsIDOMHTMLObjectElement.idl \
|
||||
|
64
dom/interfaces/html/nsIDOMHTMLMeterElement.idl
Normal file
64
dom/interfaces/html/nsIDOMHTMLMeterElement.idl
Normal file
@ -0,0 +1,64 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla 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/MPL/
|
||||
*
|
||||
* 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 code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Foundation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vincent Lamotte <Vincent.Lamotte@ensimag.imag.fr>
|
||||
* Laurent Dulary <Laurent.Dulary@ensimag.imag.fr>
|
||||
* Yoan Teboul <Yoan.Teboul@ensimag.imag.fr>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsIDOMHTMLElement.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMHTMLMeterElement interface is the interface to a HTML
|
||||
* <meter> element.
|
||||
*
|
||||
* For more information on this interface, please see
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-meter-element
|
||||
*/
|
||||
|
||||
[scriptable, uuid(d4466510-8143-11e0-b278-0800200c9a66)]
|
||||
interface nsIDOMHTMLMeterElement : nsIDOMHTMLElement
|
||||
{
|
||||
attribute double value;
|
||||
attribute double min;
|
||||
attribute double max;
|
||||
attribute double low;
|
||||
attribute double high;
|
||||
attribute double optimum;
|
||||
readonly attribute nsIDOMHTMLFormElement form;
|
||||
/**
|
||||
* The labels attribute will be done with bug 556743.
|
||||
*/
|
||||
//readonly attribute NodeList labels;
|
||||
};
|
@ -114,6 +114,7 @@ EDITOR_ATOM(legend, "legend")
|
||||
EDITOR_ATOM(li, "li")
|
||||
EDITOR_ATOM(map, "map")
|
||||
EDITOR_ATOM(mark, "mark")
|
||||
EDITOR_ATOM(meter, "meter")
|
||||
EDITOR_ATOM(menuitem, "menuitem")
|
||||
EDITOR_ATOM(mozdirty, "_moz_dirty")
|
||||
EDITOR_ATOM(mozEditorBogusNode, "_moz_editor_bogus_node")
|
||||
|
@ -466,6 +466,7 @@ nsHTMLEditUtils::IsFormWidget(dom::Element* node)
|
||||
|| (nodeAtom == nsEditProperty::output)
|
||||
|| (nodeAtom == nsEditProperty::keygen)
|
||||
|| (nodeAtom == nsEditProperty::progress)
|
||||
|| (nodeAtom == nsEditProperty::meter)
|
||||
|| (nodeAtom == nsEditProperty::input);
|
||||
}
|
||||
|
||||
@ -517,7 +518,7 @@ nsHTMLEditUtils::SupportsAlignAttr(nsIDOMNode * aNode)
|
||||
// strong, var
|
||||
#define GROUP_PHRASE (1 << 4)
|
||||
|
||||
// a, applet, basefont, bdo, br, font, iframe, img, map, object, output,
|
||||
// a, applet, basefont, bdo, br, font, iframe, img, map, meter, object, output,
|
||||
// progress, q, script, span, sub, sup
|
||||
#define GROUP_SPECIAL (1 << 5)
|
||||
|
||||
@ -695,6 +696,7 @@ static const nsElementInfo kElements[eHTMLTag_userdefined] = {
|
||||
ELEM(menu, true, true, GROUP_BLOCK, GROUP_LI | GROUP_FLOW_ELEMENT),
|
||||
ELEM(menuitem, false, false, GROUP_NONE, GROUP_NONE),
|
||||
ELEM(meta, false, false, GROUP_HEAD_CONTENT, GROUP_NONE),
|
||||
ELEM(meter, true, false, GROUP_SPECIAL, GROUP_FLOW_ELEMENT),
|
||||
ELEM(multicol, false, false, GROUP_NONE, GROUP_NONE),
|
||||
ELEM(nav, true, true, GROUP_BLOCK, GROUP_FLOW_ELEMENT),
|
||||
ELEM(nobr, false, false, GROUP_NONE, GROUP_NONE),
|
||||
|
@ -282,6 +282,7 @@ members = [
|
||||
'nsIDOMHTMLInputElement.selectionDirection',
|
||||
'nsIDOMHTMLInputElement.setSelectionRange',
|
||||
'nsIDOMHTMLLinkElement.disabled',
|
||||
'nsIDOMHTMLMeterElement.*',
|
||||
'nsIDOMHTMLMenuElement.*',
|
||||
'nsIDOMHTMLMenuItemElement.*',
|
||||
'nsIDOMHTMLOptionElement.index',
|
||||
|
@ -110,6 +110,7 @@ HTML_TAG(marquee, Div)
|
||||
HTML_TAG(menu, Menu)
|
||||
HTML_TAG(menuitem, MenuItem)
|
||||
HTML_TAG(meta, Meta)
|
||||
HTML_TAG(meter, Meter)
|
||||
HTML_TAG(multicol, Span)
|
||||
HTML_HTMLELEMENT_TAG(nav)
|
||||
HTML_HTMLELEMENT_TAG(nobr)
|
||||
|
@ -840,6 +840,15 @@ const nsHTMLElement gHTMLElements[] = {
|
||||
/*special props, prop-range*/ kNoStyleLeaksIn|kNonContainer, kDefaultPropRange,
|
||||
/*special parents,kids*/ &gInHead,0,
|
||||
},
|
||||
{
|
||||
/*tag*/ eHTMLTag_meter,
|
||||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
/*rootnodes,endrootnodes*/ &gRootTags,&gRootTags,
|
||||
/*autoclose starttags and endtags*/ 0,0,0,0,
|
||||
/*parent,incl,exclgroups*/ kFormControl, kFlowEntity, kNone,
|
||||
/*special props, prop-range*/ 0,kDefaultPropRange,
|
||||
/*special parents,kids*/ 0,0,
|
||||
},
|
||||
{
|
||||
/*tag*/ eHTMLTag_multicol,
|
||||
/*req-parent excl-parent*/ eHTMLTag_unknown,eHTMLTag_unknown,
|
||||
|
@ -172,6 +172,8 @@ static const PRUnichar sHTMLTagUnicodeName_menuitem[] =
|
||||
{'m', 'e', 'n', 'u', 'i', 't', 'e', 'm', '\0'};
|
||||
static const PRUnichar sHTMLTagUnicodeName_meta[] =
|
||||
{'m', 'e', 't', 'a', '\0'};
|
||||
static const PRUnichar sHTMLTagUnicodeName_meter[] =
|
||||
{'m', 'e', 't', 'e', 'r', '\0'};
|
||||
static const PRUnichar sHTMLTagUnicodeName_multicol[] =
|
||||
{'m', 'u', 'l', 't', 'i', 'c', 'o', 'l', '\0'};
|
||||
static const PRUnichar sHTMLTagUnicodeName_nav[] =
|
||||
|
Loading…
Reference in New Issue
Block a user