backout Bug 893117 for mochitest failure

This commit is contained in:
David Zbarsky 2013-08-01 01:54:09 -07:00
Родитель 239d7c7d1c
Коммит 3d161603d7
55 изменённых файлов: 1464 добавлений и 135 удалений

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

@ -27,8 +27,11 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED_1(HTMLDataListElement, nsGenericHTMLElement,
NS_IMPL_ADDREF_INHERITED(HTMLDataListElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLDataListElement, Element)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLDataListElement)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLDataListElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLDataListElement,
nsIDOMHTMLDataListElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
@ -42,5 +45,13 @@ HTMLDataListElement::MatchOptions(nsIContent* aContent, int32_t aNamespaceID,
!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
}
NS_IMETHODIMP
HTMLDataListElement::GetOptions(nsIDOMHTMLCollection** aOptions)
{
NS_ADDREF(*aOptions = Options());
return NS_OK;
}
} // namespace dom
} // namespace mozilla

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

@ -7,13 +7,14 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLDataListElement.h"
#include "nsContentList.h"
namespace mozilla {
namespace dom {
class HTMLDataListElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
public nsIDOMHTMLDataListElement
{
public:
HTMLDataListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -34,6 +35,9 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLDataListElement
NS_DECL_NSIDOMHTMLDATALISTELEMENT
nsContentList* Options()
{
if (!mOptions) {

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

@ -31,13 +31,66 @@ NS_IMPL_ADDREF_INHERITED(HTMLFontElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLFontElement, Element)
// QueryInterface implementation for HTMLFontElement
NS_INTERFACE_MAP_BEGIN(HTMLFontElement)
NS_INTERFACE_TABLE_HEAD(HTMLFontElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLFontElement, nsIDOMHTMLFontElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLFontElement)
NS_IMETHODIMP
HTMLFontElement::GetColor(nsAString& aColor)
{
nsString color;
GetColor(color);
aColor = color;
return NS_OK;
}
NS_IMETHODIMP
HTMLFontElement::SetColor(const nsAString& aColor)
{
ErrorResult rv;
SetColor(aColor, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLFontElement::GetFace(nsAString& aFace)
{
nsString face;
GetFace(face);
aFace = face;
return NS_OK;
}
NS_IMETHODIMP
HTMLFontElement::SetFace(const nsAString& aFace)
{
ErrorResult rv;
SetFace(aFace, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLFontElement::GetSize(nsAString& aSize)
{
nsString size;
GetSize(size);
aSize = size;
return NS_OK;
}
NS_IMETHODIMP
HTMLFontElement::SetSize(const nsAString& aSize)
{
ErrorResult rv;
SetSize(aSize, rv);
return rv.ErrorCode();
}
bool
HTMLFontElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,

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

@ -7,12 +7,13 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLFontElement.h"
namespace mozilla {
namespace dom {
class HTMLFontElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
public nsIDOMHTMLFontElement
{
public:
HTMLFontElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -33,6 +34,9 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLFontElement
NS_DECL_NSIDOMHTMLFONTELEMENT
void GetColor(nsString& aColor)
{
GetHTMLAttr(nsGkAtoms::color, aColor);

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

@ -25,13 +25,30 @@ NS_IMPL_RELEASE_INHERITED(HTMLLegendElement, Element)
// QueryInterface implementation for HTMLLegendElement
NS_INTERFACE_MAP_BEGIN(HTMLLegendElement)
NS_INTERFACE_TABLE_HEAD(HTMLLegendElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLLegendElement, nsIDOMHTMLLegendElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
// nsIDOMHTMLLegendElement
NS_IMPL_ELEMENT_CLONE(HTMLLegendElement)
NS_IMETHODIMP
HTMLLegendElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
Element* form = GetFormElement();
return form ? CallQueryInterface(form, aForm) : NS_OK;
}
NS_IMPL_STRING_ATTR(HTMLLegendElement, Align, align)
// this contains center, because IE4 does
static const nsAttrValue::EnumTable kAlignTable[] = {
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },

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

@ -7,6 +7,7 @@
#define mozilla_dom_HTMLLegendElement_h
#include "mozilla/Attributes.h"
#include "nsIDOMHTMLLegendElement.h"
#include "nsGenericHTMLElement.h"
#include "mozilla/dom/HTMLFormElement.h"
@ -14,7 +15,7 @@ namespace mozilla {
namespace dom {
class HTMLLegendElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
public nsIDOMHTMLLegendElement
{
public:
HTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -34,6 +35,9 @@ public:
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLLegendElement
NS_DECL_NSIDOMHTMLLEGENDELEMENT
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
@ -82,11 +86,7 @@ public:
already_AddRefed<HTMLFormElement> GetForm();
void GetAlign(nsAString& aAlign)
{
GetHTMLAttr(nsGkAtoms::align, aAlign);
}
// The XPCOM GetAlign is OK for us
void SetAlign(const nsAString& aAlign, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::align, aAlign, aError);

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

@ -29,8 +29,11 @@ NS_IMPL_ADDREF_INHERITED(HTMLMeterElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLMeterElement, Element)
NS_INTERFACE_MAP_BEGIN(HTMLMeterElement)
NS_INTERFACE_TABLE_HEAD(HTMLMeterElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLMeterElement,
nsIDOMHTMLMeterElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLMeterElement)
@ -220,6 +223,88 @@ HTMLMeterElement::Optimum() const
return std::min(optimum, max);
}
/*
* XPCOM methods
*/
NS_IMETHODIMP
HTMLMeterElement::GetMin(double* aValue)
{
*aValue = Min();
return NS_OK;
}
NS_IMETHODIMP
HTMLMeterElement::SetMin(double aValue)
{
return SetDoubleAttr(nsGkAtoms::min, aValue);
}
NS_IMETHODIMP
HTMLMeterElement::GetMax(double* aValue)
{
*aValue = Max();
return NS_OK;
}
NS_IMETHODIMP
HTMLMeterElement::SetMax(double aValue)
{
return SetDoubleAttr(nsGkAtoms::max, aValue);
}
NS_IMETHODIMP
HTMLMeterElement::GetValue(double* aValue)
{
*aValue = Value();
return NS_OK;
}
NS_IMETHODIMP
HTMLMeterElement::SetValue(double aValue)
{
return SetDoubleAttr(nsGkAtoms::value, aValue);
}
NS_IMETHODIMP
HTMLMeterElement::GetLow(double* aValue)
{
*aValue = Low();
return NS_OK;
}
NS_IMETHODIMP
HTMLMeterElement::SetLow(double aValue)
{
return SetDoubleAttr(nsGkAtoms::low, aValue);
}
NS_IMETHODIMP
HTMLMeterElement::GetHigh(double* aValue)
{
*aValue = High();
return NS_OK;
}
NS_IMETHODIMP
HTMLMeterElement::SetHigh(double aValue)
{
return SetDoubleAttr(nsGkAtoms::high, aValue);
}
NS_IMETHODIMP
HTMLMeterElement::GetOptimum(double* aValue)
{
*aValue = Optimum();
return NS_OK;
}
NS_IMETHODIMP
HTMLMeterElement::SetOptimum(double aValue)
{
return SetDoubleAttr(nsGkAtoms::optimum, aValue);
}
nsEventStates
HTMLMeterElement::GetOptimumState() const
{

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

@ -7,6 +7,7 @@
#define mozilla_dom_HTMLMeterElement_h
#include "mozilla/Attributes.h"
#include "nsIDOMHTMLMeterElement.h"
#include "nsGenericHTMLElement.h"
#include "nsAttrValue.h"
#include "nsAttrValueInlines.h"
@ -18,7 +19,7 @@ namespace mozilla {
namespace dom {
class HTMLMeterElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
public nsIDOMHTMLMeterElement
{
public:
HTMLMeterElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -36,6 +37,9 @@ public:
/* nsIDOMHTMLElement */
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
/* nsIDOMHTMLMeterElement */
NS_DECL_NSIDOMHTMLMETERELEMENT
virtual nsEventStates IntrinsicState() const MOZ_OVERRIDE;
nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;
@ -51,42 +55,42 @@ public:
double Value() const;
void SetValue(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::value, aValue);
aRv = SetValue(aValue);
}
/* @return the minimum value */
double Min() const;
void SetMin(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::min, aValue);
aRv = SetMin(aValue);
}
/* @return the maximum value */
double Max() const;
void SetMax(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::max, aValue);
aRv = SetMax(aValue);
}
/* @return the low value */
double Low() const;
void SetLow(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::low, aValue);
aRv = SetLow(aValue);
}
/* @return the high value */
double High() const;
void SetHigh(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::high, aValue);
aRv = SetHigh(aValue);
}
/* @return the optimum value */
double Optimum() const;
void SetOptimum(double aValue, ErrorResult& aRv)
{
aRv = SetDoubleAttr(nsGkAtoms::optimum, aValue);
aRv = SetOptimum(aValue);
}
protected:

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

@ -26,13 +26,20 @@ NS_IMPL_ADDREF_INHERITED(HTMLModElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLModElement, Element)
// QueryInterface implementation for HTMLModElement
NS_INTERFACE_MAP_BEGIN(HTMLModElement)
NS_INTERFACE_TABLE_HEAD(HTMLModElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLModElement,
nsIDOMHTMLModElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLModElement)
NS_IMPL_URI_ATTR(HTMLModElement, Cite, cite)
NS_IMPL_STRING_ATTR(HTMLModElement, DateTime, datetime)
JSObject*
HTMLModElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aScope)
{

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

@ -8,13 +8,14 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLModElement.h"
#include "nsGkAtoms.h"
namespace mozilla {
namespace dom {
class HTMLModElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
public nsIDOMHTMLModElement
{
public:
HTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -32,6 +33,9 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLModElement
NS_DECL_NSIDOMHTMLMODELEMENT
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
@ -44,10 +48,7 @@ public:
{
SetHTMLAttr(nsGkAtoms::cite, aCite, aRv);
}
void GetDateTime(nsAString& aDateTime)
{
GetHTMLAttr(nsGkAtoms::datetime, aDateTime);
}
// XPCOM GetDateTime is fine.
void SetDateTime(const nsAString& aDateTime, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::datetime, aDateTime, aRv);

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

@ -53,7 +53,8 @@ NS_IMPL_RELEASE_INHERITED(HTMLOutputElement, Element)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLOutputElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
NS_INTERFACE_TABLE_INHERITED2(HTMLOutputElement,
NS_INTERFACE_TABLE_INHERITED3(HTMLOutputElement,
nsIDOMHTMLOutputElement,
nsIMutationObserver,
nsIConstraintValidation)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
@ -61,12 +62,20 @@ NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLOutputElement)
void
NS_IMPL_STRING_ATTR(HTMLOutputElement, Name, name)
// nsIConstraintValidation
NS_IMPL_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY(HTMLOutputElement)
NS_IMETHODIMP
HTMLOutputElement::SetCustomValidity(const nsAString& aError)
{
nsIConstraintValidation::SetCustomValidity(aError);
UpdateState(true);
return NS_OK;
}
NS_IMETHODIMP
@ -140,20 +149,49 @@ HTMLOutputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
return rv;
}
void
HTMLOutputElement::SetValue(const nsAString& aValue, ErrorResult& aRv)
NS_IMETHODIMP
HTMLOutputElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
mValueModeFlag = eModeValue;
aRv = nsContentUtils::SetNodeTextContent(this, aValue, true);
return nsGenericHTMLFormElement::GetForm(aForm);
}
void
HTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv)
NS_IMETHODIMP
HTMLOutputElement::GetType(nsAString& aType)
{
aType.AssignLiteral("output");
return NS_OK;
}
NS_IMETHODIMP
HTMLOutputElement::GetValue(nsAString& aValue)
{
nsContentUtils::GetNodeTextContent(this, true, aValue);
return NS_OK;
}
NS_IMETHODIMP
HTMLOutputElement::SetValue(const nsAString& aValue)
{
mValueModeFlag = eModeValue;
return nsContentUtils::SetNodeTextContent(this, aValue, true);
}
NS_IMETHODIMP
HTMLOutputElement::GetDefaultValue(nsAString& aDefaultValue)
{
aDefaultValue = mDefaultValue;
return NS_OK;
}
NS_IMETHODIMP
HTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue)
{
mDefaultValue = aDefaultValue;
if (mValueModeFlag == eModeDefault) {
aRv = nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
}
return NS_OK;
}
nsDOMSettableTokenList*
@ -165,6 +203,13 @@ HTMLOutputElement::HtmlFor()
return mTokenList;
}
NS_IMETHODIMP
HTMLOutputElement::GetHtmlFor(nsISupports** aResult)
{
NS_ADDREF(*aResult = HtmlFor());
return NS_OK;
}
void HTMLOutputElement::DescendantsChanged()
{
if (mValueModeFlag == eModeDefault) {

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

@ -8,6 +8,7 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLOutputElement.h"
#include "nsStubMutationObserver.h"
#include "nsIConstraintValidation.h"
@ -15,7 +16,7 @@ namespace mozilla {
namespace dom {
class HTMLOutputElement MOZ_FINAL : public nsGenericHTMLFormElement,
public nsIDOMHTMLElement,
public nsIDOMHTMLOutputElement,
public nsStubMutationObserver,
public nsIConstraintValidation
{
@ -37,6 +38,9 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLOutputElement
NS_DECL_NSIDOMHTMLOUTPUTELEMENT
// nsIFormControl
NS_IMETHOD_(uint32_t) GetType() const { return NS_FORM_OUTPUT; }
NS_IMETHOD Reset() MOZ_OVERRIDE;
@ -75,40 +79,31 @@ public:
// WebIDL
nsDOMSettableTokenList* HtmlFor();
// nsGenericHTMLFormElement::GetForm is fine.
void GetName(nsAString& aName)
{
GetHTMLAttr(nsGkAtoms::name, aName);
}
using nsGenericHTMLFormElement::GetForm;
// XPCOM GetName is fine.
void SetName(const nsAString& aName, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::name, aName, aRv);
}
void GetType(nsAString& aType)
// XPCOM GetType is fine.
// XPCOM GetDefaultValue is fine.
void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv)
{
aType.AssignLiteral("output");
aRv = SetDefaultValue(aDefaultValue);
}
void GetDefaultValue(nsAString& aDefaultValue)
// XPCOM GetValue is fine.
void SetValue(const nsAString& aValue, ErrorResult& aRv)
{
aDefaultValue = mDefaultValue;
aRv = SetValue(aValue);
}
void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv);
void GetValue(nsAString& aValue)
{
nsContentUtils::GetNodeTextContent(this, true, aValue);
}
void SetValue(const nsAString& aValue, ErrorResult& aRv);
// nsIConstraintValidation::WillValidate is fine.
// nsIConstraintValidation::Validity() is fine.
// nsIConstraintValidation::GetValidationMessage() is fine.
// nsIConstraintValidation::CheckValidity() is fine.
void SetCustomValidity(const nsAString& aError);
using nsIConstraintValidation::CheckValidity;
// nsIConstraintValidation::SetCustomValidity() is fine.
protected:
enum ValueModeFlag {

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

@ -31,8 +31,11 @@ NS_IMPL_ADDREF_INHERITED(HTMLProgressElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLProgressElement, Element)
NS_INTERFACE_MAP_BEGIN(HTMLProgressElement)
NS_INTERFACE_TABLE_HEAD(HTMLProgressElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLProgressElement,
nsIDOMHTMLProgressElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLProgressElement)
@ -64,6 +67,13 @@ HTMLProgressElement::ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
aValue, aResult);
}
NS_IMETHODIMP
HTMLProgressElement::GetValue(double* aValue)
{
*aValue = Value();
return NS_OK;
}
double
HTMLProgressElement::Value() const
{
@ -76,6 +86,21 @@ HTMLProgressElement::Value() const
return std::min(attrValue->GetDoubleValue(), Max());
}
NS_IMETHODIMP
HTMLProgressElement::SetValue(double aValue)
{
ErrorResult rv;
SetValue(aValue, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLProgressElement::GetMax(double* aValue)
{
*aValue = Max();
return NS_OK;
}
double
HTMLProgressElement::Max() const
{
@ -88,6 +113,21 @@ HTMLProgressElement::Max() const
return attrMax->GetDoubleValue();
}
NS_IMETHODIMP
HTMLProgressElement::SetMax(double aValue)
{
ErrorResult rv;
SetMax(aValue, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLProgressElement::GetPosition(double* aPosition)
{
*aPosition = Position();
return NS_OK;
}
double
HTMLProgressElement::Position() const
{

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

@ -7,6 +7,7 @@
#define mozilla_dom_HTMLProgressElement_h
#include "mozilla/Attributes.h"
#include "nsIDOMHTMLProgressElement.h"
#include "nsGenericHTMLElement.h"
#include "nsAttrValue.h"
#include "nsAttrValueInlines.h"
@ -17,7 +18,7 @@ namespace mozilla {
namespace dom {
class HTMLProgressElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
public nsIDOMHTMLProgressElement
{
public:
HTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -35,6 +36,9 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLProgressElement
NS_DECL_NSIDOMHTMLPROGRESSELEMENT
nsEventStates IntrinsicState() const MOZ_OVERRIDE;
nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;

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

@ -34,7 +34,8 @@ NS_IMPL_RELEASE_INHERITED(HTMLSharedElement, Element)
// QueryInterface implementation for HTMLSharedElement
NS_INTERFACE_MAP_BEGIN(HTMLSharedElement)
NS_HTML_CONTENT_INTERFACES_AMBIGUOUS(nsGenericHTMLElement,
nsIDOMHTMLBaseElement)
nsIDOMHTMLParamElement)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLParamElement, param)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLBaseElement, base)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLDirectoryElement, dir)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLQuoteElement, q)
@ -46,6 +47,15 @@ NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLSharedElement)
// nsIDOMHTMLParamElement
NS_IMPL_STRING_ATTR(HTMLSharedElement, Name, name)
NS_IMPL_STRING_ATTR(HTMLSharedElement, Type, type)
NS_IMPL_STRING_ATTR(HTMLSharedElement, Value, value)
NS_IMPL_STRING_ATTR(HTMLSharedElement, ValueType, valuetype)
// nsIDOMHTMLDirectoryElement
NS_IMPL_BOOL_ATTR(HTMLSharedElement, Compact, compact)
// nsIDOMHTMLQuoteElement
NS_IMPL_URI_ATTR(HTMLSharedElement, Cite, cite)

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

@ -6,6 +6,7 @@
#ifndef mozilla_dom_HTMLSharedElement_h
#define mozilla_dom_HTMLSharedElement_h
#include "nsIDOMHTMLParamElement.h"
#include "nsIDOMHTMLBaseElement.h"
#include "nsIDOMHTMLDirectoryElement.h"
#include "nsIDOMHTMLQuoteElement.h"
@ -22,6 +23,7 @@ namespace mozilla {
namespace dom {
class HTMLSharedElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLParamElement,
public nsIDOMHTMLBaseElement,
public nsIDOMHTMLDirectoryElement,
public nsIDOMHTMLQuoteElement,
@ -47,9 +49,15 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLParamElement
NS_DECL_NSIDOMHTMLPARAMELEMENT
// nsIDOMHTMLBaseElement
NS_DECL_NSIDOMHTMLBASEELEMENT
// nsIDOMHTMLDirectoryElement
NS_DECL_NSIDOMHTMLDIRECTORYELEMENT
// nsIDOMHTMLQuoteElement
NS_DECL_NSIDOMHTMLQUOTEELEMENT
@ -90,7 +98,7 @@ public:
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE
{
return static_cast<nsIDOMHTMLBaseElement*>(this);
return static_cast<nsIDOMHTMLParamElement*>(this);
}
// WebIDL API

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

@ -32,6 +32,7 @@ NS_INTERFACE_MAP_BEGIN(HTMLSharedListElement)
NS_HTML_CONTENT_INTERFACES_AMBIGUOUS(nsGenericHTMLElement,
nsIDOMHTMLOListElement)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLOListElement, ol)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLDListElement, dl)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLUListElement, ul)
NS_ELEMENT_INTERFACE_MAP_END

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

@ -9,6 +9,7 @@
#include "mozilla/Util.h"
#include "nsIDOMHTMLOListElement.h"
#include "nsIDOMHTMLDListElement.h"
#include "nsIDOMHTMLUListElement.h"
#include "nsGenericHTMLElement.h"
@ -17,6 +18,7 @@ namespace dom {
class HTMLSharedListElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLOListElement,
public nsIDOMHTMLDListElement,
public nsIDOMHTMLUListElement
{
public:
@ -41,6 +43,9 @@ public:
// nsIDOMHTMLOListElement
NS_DECL_NSIDOMHTMLOLISTELEMENT
// nsIDOMHTMLDListElement
// fully declared by NS_DECL_NSIDOMHTMLOLISTELEMENT
// nsIDOMHTMLUListElement
// fully declared by NS_DECL_NSIDOMHTMLOLISTELEMENT

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

@ -34,12 +34,115 @@ NS_IMPL_ADDREF_INHERITED(HTMLTableColElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLTableColElement, Element)
// QueryInterface implementation for HTMLTableColElement
NS_INTERFACE_MAP_BEGIN(HTMLTableColElement)
NS_INTERFACE_TABLE_HEAD(HTMLTableColElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLTableColElement,
nsIDOMHTMLTableColElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLTableColElement)
NS_IMETHODIMP
HTMLTableColElement::SetSpan(int32_t aSpan)
{
ErrorResult rv;
SetSpan(aSpan, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableColElement::GetSpan(int32_t* aSpan)
{
*aSpan = Span();
return NS_OK;
}
NS_IMETHODIMP
HTMLTableColElement::SetAlign(const nsAString& aAlign)
{
ErrorResult rv;
SetAlign(aAlign, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableColElement::GetAlign(nsAString& aAlign)
{
nsString align;
GetAlign(align);
aAlign = align;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableColElement::SetVAlign(const nsAString& aVAlign)
{
ErrorResult rv;
SetVAlign(aVAlign, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableColElement::GetVAlign(nsAString& aVAlign)
{
nsString vAlign;
GetVAlign(vAlign);
aVAlign = vAlign;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableColElement::SetCh(const nsAString& aCh)
{
ErrorResult rv;
SetCh(aCh, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableColElement::GetCh(nsAString& aCh)
{
nsString ch;
GetCh(ch);
aCh = ch;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableColElement::SetChOff(const nsAString& aChOff)
{
ErrorResult rv;
SetChOff(aChOff, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableColElement::GetChOff(nsAString& aChOff)
{
nsString chOff;
GetChOff(chOff);
aChOff = chOff;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableColElement::SetWidth(const nsAString& aWidth)
{
ErrorResult rv;
SetWidth(aWidth, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableColElement::GetWidth(nsAString& aWidth)
{
nsString width;
GetWidth(width);
aWidth = width;
return NS_OK;
}
bool
HTMLTableColElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,

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

@ -7,12 +7,13 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLTableColElement.h"
namespace mozilla {
namespace dom {
class HTMLTableColElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
public nsIDOMHTMLTableColElement
{
public:
HTMLTableColElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -33,6 +34,9 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLTableColElement
NS_DECL_NSIDOMHTMLTABLECOLELEMENT
uint32_t Span() const
{
return GetIntAttr(nsGkAtoms::span, 1);

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

@ -6,6 +6,7 @@
#include "mozilla/Util.h"
#include "mozilla/dom/HTMLTableElement.h"
#include "nsIDOMHTMLTableSectionElement.h"
#include "nsAttrValueInlines.h"
#include "nsRuleData.h"
#include "nsHTMLStyleSheet.h"
@ -343,6 +344,219 @@ NS_IMPL_ELEMENT_CLONE(HTMLTableElement)
// in fact, they are integers or they are meaningless. so we store them
// here as ints.
NS_IMETHODIMP
HTMLTableElement::SetAlign(const nsAString& aAlign)
{
ErrorResult rv;
SetAlign(aAlign, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetAlign(nsAString& aAlign)
{
nsString align;
GetAlign(align);
aAlign = align;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetBgColor(const nsAString& aBgColor)
{
ErrorResult rv;
SetBgColor(aBgColor, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetBgColor(nsAString& aBgColor)
{
nsString bgColor;
GetBgColor(bgColor);
aBgColor = bgColor;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetBorder(const nsAString& aBorder)
{
ErrorResult rv;
SetBorder(aBorder, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetBorder(nsAString& aBorder)
{
nsString border;
GetBorder(border);
aBorder = border;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetCellPadding(const nsAString& aCellPadding)
{
ErrorResult rv;
SetCellPadding(aCellPadding, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetCellPadding(nsAString& aCellPadding)
{
nsString cellPadding;
GetCellPadding(cellPadding);
aCellPadding = cellPadding;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetCellSpacing(const nsAString& aCellSpacing)
{
ErrorResult rv;
SetCellSpacing(aCellSpacing, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetCellSpacing(nsAString& aCellSpacing)
{
nsString cellSpacing;
GetCellSpacing(cellSpacing);
aCellSpacing = cellSpacing;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetFrame(const nsAString& aFrame)
{
ErrorResult rv;
SetFrame(aFrame, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetFrame(nsAString& aFrame)
{
nsString frame;
GetFrame(frame);
aFrame = frame;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetRules(const nsAString& aRules)
{
ErrorResult rv;
SetRules(aRules, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetRules(nsAString& aRules)
{
nsString rules;
GetRules(rules);
aRules = rules;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetSummary(const nsAString& aSummary)
{
ErrorResult rv;
SetSummary(aSummary, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetSummary(nsAString& aSummary)
{
nsString summary;
GetSummary(summary);
aSummary = summary;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetWidth(const nsAString& aWidth)
{
ErrorResult rv;
SetWidth(aWidth, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetWidth(nsAString& aWidth)
{
nsString width;
GetWidth(width);
aWidth = width;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::GetCaption(nsIDOMHTMLTableCaptionElement** aValue)
{
nsCOMPtr<nsIDOMHTMLTableCaptionElement> caption = GetCaption();
caption.forget(aValue);
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetCaption(nsIDOMHTMLTableCaptionElement* aValue)
{
HTMLTableCaptionElement* caption =
static_cast<HTMLTableCaptionElement*>(aValue);
SetCaption(caption);
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::GetTHead(nsIDOMHTMLTableSectionElement** aValue)
{
NS_IF_ADDREF(*aValue = GetTHead());
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetTHead(nsIDOMHTMLTableSectionElement* aValue)
{
HTMLTableSectionElement* section =
static_cast<HTMLTableSectionElement*>(aValue);
ErrorResult rv;
SetTHead(section, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetTFoot(nsIDOMHTMLTableSectionElement** aValue)
{
NS_IF_ADDREF(*aValue = GetTFoot());
return NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::SetTFoot(nsIDOMHTMLTableSectionElement* aValue)
{
HTMLTableSectionElement* section =
static_cast<HTMLTableSectionElement*>(aValue);
ErrorResult rv;
SetTFoot(section, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableElement::GetRows(nsIDOMHTMLCollection** aValue)
{
NS_ADDREF(*aValue = Rows());
return NS_OK;
}
nsIHTMLCollection*
HTMLTableElement::Rows()
{
@ -353,6 +567,13 @@ HTMLTableElement::Rows()
return mRows;
}
NS_IMETHODIMP
HTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue)
{
NS_ADDREF(*aValue = TBodies());
return NS_OK;
}
nsIHTMLCollection*
HTMLTableElement::TBodies()
{
@ -389,7 +610,14 @@ HTMLTableElement::CreateTHead()
return head.forget();
}
void
NS_IMETHODIMP
HTMLTableElement::CreateTHead(nsIDOMHTMLElement** aValue)
{
nsRefPtr<nsGenericHTMLElement> thead = CreateTHead();
return thead ? CallQueryInterface(thead, aValue) : NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::DeleteTHead()
{
HTMLTableSectionElement* tHead = GetTHead();
@ -398,6 +626,8 @@ HTMLTableElement::DeleteTHead()
nsINode::RemoveChild(*tHead, rv);
MOZ_ASSERT(!rv.Failed());
}
return NS_OK;
}
already_AddRefed<nsGenericHTMLElement>
@ -420,7 +650,14 @@ HTMLTableElement::CreateTFoot()
return foot.forget();
}
void
NS_IMETHODIMP
HTMLTableElement::CreateTFoot(nsIDOMHTMLElement** aValue)
{
nsRefPtr<nsGenericHTMLElement> tfoot = CreateTFoot();
return tfoot ? CallQueryInterface(tfoot, aValue) : NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::DeleteTFoot()
{
HTMLTableSectionElement* tFoot = GetTFoot();
@ -429,6 +666,8 @@ HTMLTableElement::DeleteTFoot()
nsINode::RemoveChild(*tFoot, rv);
MOZ_ASSERT(!rv.Failed());
}
return NS_OK;
}
already_AddRefed<nsGenericHTMLElement>
@ -451,7 +690,14 @@ HTMLTableElement::CreateCaption()
return caption.forget();
}
void
NS_IMETHODIMP
HTMLTableElement::CreateCaption(nsIDOMHTMLElement** aValue)
{
nsRefPtr<nsGenericHTMLElement> caption = CreateCaption();
return caption ? CallQueryInterface(caption, aValue) : NS_OK;
}
NS_IMETHODIMP
HTMLTableElement::DeleteCaption()
{
HTMLTableCaptionElement* caption = GetCaption();
@ -460,6 +706,8 @@ HTMLTableElement::DeleteCaption()
nsINode::RemoveChild(*caption, rv);
MOZ_ASSERT(!rv.Failed());
}
return NS_OK;
}
already_AddRefed<nsGenericHTMLElement>
@ -600,6 +848,14 @@ HTMLTableElement::InsertRow(int32_t aIndex, ErrorResult& aError)
return newRow.forget();
}
NS_IMETHODIMP
HTMLTableElement::InsertRow(int32_t aIndex, nsIDOMHTMLElement** aValue)
{
ErrorResult rv;
nsRefPtr<nsGenericHTMLElement> newRow = InsertRow(aIndex, rv);
return rv.Failed() ? rv.ErrorCode() : CallQueryInterface(newRow, aValue);
}
void
HTMLTableElement::DeleteRow(int32_t aIndex, ErrorResult& aError)
{
@ -630,6 +886,14 @@ HTMLTableElement::DeleteRow(int32_t aIndex, ErrorResult& aError)
row->RemoveFromParent();
}
NS_IMETHODIMP
HTMLTableElement::DeleteRow(int32_t aValue)
{
ErrorResult rv;
DeleteRow(aValue, rv);
return rv.ErrorCode();
}
static const nsAttrValue::EnumTable kFrameTable[] = {
{ "void", NS_STYLE_TABLE_FRAME_NONE },
{ "above", NS_STYLE_TABLE_FRAME_ABOVE },

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

@ -39,6 +39,9 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLTableElement
NS_DECL_NSIDOMHTMLTABLEELEMENT
HTMLTableCaptionElement* GetCaption() const
{
return static_cast<HTMLTableCaptionElement*>(GetChild(nsGkAtoms::caption));
@ -51,13 +54,8 @@ public:
nsINode::AppendChild(*aCaption, rv);
}
}
void DeleteTFoot();
already_AddRefed<nsGenericHTMLElement> CreateCaption();
void DeleteCaption();
HTMLTableSectionElement* GetTHead() const
{
return static_cast<HTMLTableSectionElement*>(GetChild(nsGkAtoms::thead));
@ -76,8 +74,6 @@ public:
}
already_AddRefed<nsGenericHTMLElement> CreateTHead();
void DeleteTHead();
HTMLTableSectionElement* GetTFoot() const
{
return static_cast<HTMLTableSectionElement*>(GetChild(nsGkAtoms::tfoot));

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

@ -35,8 +35,11 @@ NS_IMPL_ADDREF_INHERITED(HTMLTableRowElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLTableRowElement, Element)
// QueryInterface implementation for HTMLTableRowElement
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLTableRowElement)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableRowElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLTableRowElement,
nsIDOMHTMLTableRowElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
@ -44,16 +47,12 @@ NS_IMPL_ELEMENT_CLONE(HTMLTableRowElement)
// protected method
HTMLTableSectionElement*
already_AddRefed<nsIDOMHTMLTableSectionElement>
HTMLTableRowElement::GetSection() const
{
nsIContent* parent = GetParent();
if (parent->IsHTML() && (parent->Tag() == nsGkAtoms::thead ||
parent->Tag() == nsGkAtoms::tbody ||
parent->Tag() == nsGkAtoms::tfoot)) {
return static_cast<HTMLTableSectionElement*>(parent);
}
return nullptr;
nsCOMPtr<nsIDOMHTMLTableSectionElement> section =
do_QueryInterface(GetParent());
return section.forget();
}
// protected method
@ -95,15 +94,25 @@ HTMLTableRowElement::RowIndex() const
return -1;
}
NS_IMETHODIMP
HTMLTableRowElement::GetRowIndex(int32_t* aValue)
{
*aValue = RowIndex();
return NS_OK;
}
int32_t
HTMLTableRowElement::SectionRowIndex() const
{
HTMLTableSectionElement* section = GetSection();
nsCOMPtr<nsIDOMHTMLTableSectionElement> section = GetSection();
if (!section) {
return -1;
}
nsCOMPtr<nsIHTMLCollection> coll = section->Rows();
nsCOMPtr<nsIDOMHTMLCollection> rows;
section->GetRows(getter_AddRefs(rows));
nsCOMPtr<nsIHTMLCollection> coll = do_QueryInterface(rows);
uint32_t numRows = coll->Length();
for (uint32_t i = 0; i < numRows; i++) {
if (coll->GetElementAt(i) == this) {
@ -114,6 +123,13 @@ HTMLTableRowElement::SectionRowIndex() const
return -1;
}
NS_IMETHODIMP
HTMLTableRowElement::GetSectionRowIndex(int32_t* aValue)
{
*aValue = SectionRowIndex();
return NS_OK;
}
static bool
IsCell(nsIContent *aContent, int32_t aNamespaceID,
nsIAtom* aAtom, void *aData)
@ -141,6 +157,13 @@ HTMLTableRowElement::Cells()
return mCells;
}
NS_IMETHODIMP
HTMLTableRowElement::GetCells(nsIDOMHTMLCollection** aValue)
{
NS_ADDREF(*aValue = Cells());
return NS_OK;
}
already_AddRefed<nsGenericHTMLElement>
HTMLTableRowElement::InsertCell(int32_t aIndex,
ErrorResult& aError)
@ -188,6 +211,14 @@ HTMLTableRowElement::InsertCell(int32_t aIndex,
return cell.forget();
}
NS_IMETHODIMP
HTMLTableRowElement::InsertCell(int32_t aIndex, nsIDOMHTMLElement** aValue)
{
ErrorResult rv;
nsRefPtr<nsGenericHTMLElement> cell = InsertCell(aIndex, rv);
return rv.Failed() ? rv.ErrorCode() : CallQueryInterface(cell, aValue);
}
void
HTMLTableRowElement::DeleteCell(int32_t aValue, ErrorResult& aError)
{
@ -220,6 +251,99 @@ HTMLTableRowElement::DeleteCell(int32_t aValue, ErrorResult& aError)
nsINode::RemoveChild(*cell, aError);
}
NS_IMETHODIMP
HTMLTableRowElement::DeleteCell(int32_t aValue)
{
ErrorResult rv;
DeleteCell(aValue, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableRowElement::SetAlign(const nsAString& aAlign)
{
ErrorResult rv;
SetAlign(aAlign, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableRowElement::GetAlign(nsAString& aAlign)
{
nsString align;
GetAlign(align);
aAlign = align;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableRowElement::SetVAlign(const nsAString& aVAlign)
{
ErrorResult rv;
SetVAlign(aVAlign, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableRowElement::GetVAlign(nsAString& aVAlign)
{
nsString vAlign;
GetVAlign(vAlign);
aVAlign = vAlign;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableRowElement::SetCh(const nsAString& aCh)
{
ErrorResult rv;
SetCh(aCh, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableRowElement::GetCh(nsAString& aCh)
{
nsString ch;
GetCh(ch);
aCh = ch;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableRowElement::SetChOff(const nsAString& aChOff)
{
ErrorResult rv;
SetChOff(aChOff, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableRowElement::GetChOff(nsAString& aChOff)
{
nsString chOff;
GetChOff(chOff);
aChOff = chOff;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableRowElement::SetBgColor(const nsAString& aBgColor)
{
ErrorResult rv;
SetBgColor(aBgColor, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableRowElement::GetBgColor(nsAString& aBgColor)
{
nsString bgColor;
GetBgColor(bgColor);
aBgColor = bgColor;
return NS_OK;
}
bool
HTMLTableRowElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,

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

@ -7,17 +7,17 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLTableRowElement.h"
class nsIDOMHTMLTableElement;
class nsIDOMHTMLTableSectionElement;
class nsContentList;
namespace mozilla {
namespace dom {
class HTMLTableSectionElement;
class HTMLTableRowElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
public nsIDOMHTMLTableRowElement
{
public:
HTMLTableRowElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -39,6 +39,9 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLTableRowElement
NS_DECL_NSIDOMHTMLTABLEROWELEMENT
int32_t RowIndex() const;
int32_t SectionRowIndex() const;
nsIHTMLCollection* Cells();
@ -105,7 +108,7 @@ protected:
virtual JSObject* WrapNode(JSContext *aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
HTMLTableSectionElement* GetSection() const;
already_AddRefed<nsIDOMHTMLTableSectionElement> GetSection() const;
HTMLTableElement* GetTable() const;
nsRefPtr<nsContentList> mCells;
};

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

@ -35,13 +35,84 @@ NS_IMPL_ADDREF_INHERITED(HTMLTableSectionElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLTableSectionElement, Element)
// QueryInterface implementation for HTMLTableSectionElement
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLTableSectionElement)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLTableSectionElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLTableSectionElement,
nsIDOMHTMLTableSectionElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLTableSectionElement)
NS_IMETHODIMP
HTMLTableSectionElement::SetAlign(const nsAString& aAlign)
{
ErrorResult rv;
SetAlign(aAlign, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableSectionElement::GetAlign(nsAString& aAlign)
{
nsString align;
GetAlign(align);
aAlign = align;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableSectionElement::SetVAlign(const nsAString& aVAlign)
{
ErrorResult rv;
SetVAlign(aVAlign, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableSectionElement::GetVAlign(nsAString& aVAlign)
{
nsString vAlign;
GetVAlign(vAlign);
aVAlign = vAlign;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableSectionElement::SetCh(const nsAString& aCh)
{
ErrorResult rv;
SetCh(aCh, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableSectionElement::GetCh(nsAString& aCh)
{
nsString ch;
GetCh(ch);
aCh = ch;
return NS_OK;
}
NS_IMETHODIMP
HTMLTableSectionElement::SetChOff(const nsAString& aChOff)
{
ErrorResult rv;
SetChOff(aChOff, rv);
return rv.ErrorCode();
}
NS_IMETHODIMP
HTMLTableSectionElement::GetChOff(nsAString& aChOff)
{
nsString chOff;
GetChOff(chOff);
aChOff = chOff;
return NS_OK;
}
nsIHTMLCollection*
HTMLTableSectionElement::Rows()
{
@ -56,6 +127,13 @@ HTMLTableSectionElement::Rows()
return mRows;
}
NS_IMETHODIMP
HTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
{
NS_ADDREF(*aValue = Rows());
return NS_OK;
}
already_AddRefed<nsGenericHTMLElement>
HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError)
{
@ -94,6 +172,15 @@ HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError)
return rowContent.forget();
}
NS_IMETHODIMP
HTMLTableSectionElement::InsertRow(int32_t aIndex,
nsIDOMHTMLElement** aValue)
{
ErrorResult rv;
nsRefPtr<nsGenericHTMLElement> row = InsertRow(aIndex, rv);
return rv.Failed() ? rv.ErrorCode() : CallQueryInterface(row, aValue);
}
void
HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
{
@ -126,6 +213,14 @@ HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
nsINode::RemoveChild(*row, aError);
}
NS_IMETHODIMP
HTMLTableSectionElement::DeleteRow(int32_t aValue)
{
ErrorResult rv;
DeleteRow(aValue, rv);
return rv.ErrorCode();
}
bool
HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,

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

@ -7,13 +7,14 @@
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLTableSectionElement.h"
#include "nsContentList.h" // For ctor.
namespace mozilla {
namespace dom {
class HTMLTableSectionElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement
public nsIDOMHTMLTableSectionElement
{
public:
HTMLTableSectionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -33,6 +34,9 @@ public:
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLTableSectionElement
NS_DECL_NSIDOMHTMLTABLESECTIONELEMENT
nsIHTMLCollection* Rows();
already_AddRefed<nsGenericHTMLElement>
InsertRow(int32_t aIndex, ErrorResult& aError);

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

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDocument.h"
#include "mozilla/dom/HTMLUnknownElement.h"
#include "HTMLUnknownElement.h"
#include "mozilla/dom/HTMLElementBinding.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Unknown)
@ -35,8 +35,11 @@ HTMLUnknownElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aScope)
}
// QueryInterface implementation for HTMLUnknownElement
NS_INTERFACE_MAP_BEGIN(HTMLUnknownElement)
NS_INTERFACE_TABLE_HEAD(HTMLUnknownElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLUnknownElement,
nsIDOMHTMLUnknownElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLUnknownElement)

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

@ -2,17 +2,18 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_HTMLUnknownElement_h
#define mozilla_dom_HTMLUnknownElement_h
#ifndef HTMLUnknownElement_h___
#define HTMLUnknownElement_h___
#include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLUnknownElement.h"
namespace mozilla {
namespace dom {
class HTMLUnknownElement MOZ_FINAL : public nsGenericHTMLElement
, public nsIDOMHTMLElement
, public nsIDOMHTMLUnknownElement
{
public:
HTMLUnknownElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -47,4 +48,4 @@ protected:
} // namespace dom
} // namespace mozilla
#endif /* mozilla_dom_HTMLUnknownElement_h */
#endif /* HTMLUnknownElement_h___ */

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

@ -244,9 +244,13 @@ for (var tag of allTags) {
if (classInfoString != 'HTMLUnknownElement') {
is(node instanceof HTMLUnknownElement, false,
tagName(tag) + " is an instance of HTMLUnknownElement");
is(node instanceof SpecialPowers.Ci.nsIDOMHTMLUnknownElement, false,
tagName(tag) + " is an instance of nsIDOMHTMLUnknownElement");
} else {
is(node instanceof HTMLUnknownElement, true,
tagName(tag) + " is an instance of HTMLUnknownElement");
is(node instanceof SpecialPowers.Ci.nsIDOMHTMLUnknownElement, true,
tagName(tag) + " is an instance of nsIDOMHTMLUnknownElement");
}
// Check that each node QIs to all the things we expect it to QI to

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

@ -20,6 +20,7 @@
#include "nsIDOMHTMLFrameElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLMapElement.h"
#include "nsIDOMHTMLLegendElement.h"
#include "nsIDOMDocument.h"
#include "nsIDOMRange.h"
#include "nsIHTMLDocument.h"

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

@ -73,6 +73,7 @@ interface nsIDOMRect;
interface nsIDOMCSSStyleRule;
interface nsIDOMCSSStyleRuleCollection;
interface nsIDOMHTMLTableCaptionElement;
interface nsIDOMHTMLTableSectionElement;
// Range
interface nsIDOMRange;

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

@ -16,12 +16,15 @@ XPIDL_SOURCES += [
'nsIDOMHTMLByteRanges.idl',
'nsIDOMHTMLCanvasElement.idl',
'nsIDOMHTMLCollection.idl',
'nsIDOMHTMLDListElement.idl',
'nsIDOMHTMLDataListElement.idl',
'nsIDOMHTMLDirectoryElement.idl',
'nsIDOMHTMLDivElement.idl',
'nsIDOMHTMLDocument.idl',
'nsIDOMHTMLElement.idl',
'nsIDOMHTMLEmbedElement.idl',
'nsIDOMHTMLFieldSetElement.idl',
'nsIDOMHTMLFontElement.idl',
'nsIDOMHTMLFormElement.idl',
'nsIDOMHTMLFrameElement.idl',
'nsIDOMHTMLFrameSetElement.idl',
@ -34,19 +37,25 @@ XPIDL_SOURCES += [
'nsIDOMHTMLInputElement.idl',
'nsIDOMHTMLLIElement.idl',
'nsIDOMHTMLLabelElement.idl',
'nsIDOMHTMLLegendElement.idl',
'nsIDOMHTMLLinkElement.idl',
'nsIDOMHTMLMapElement.idl',
'nsIDOMHTMLMediaElement.idl',
'nsIDOMHTMLMenuElement.idl',
'nsIDOMHTMLMenuItemElement.idl',
'nsIDOMHTMLMetaElement.idl',
'nsIDOMHTMLMeterElement.idl',
'nsIDOMHTMLModElement.idl',
'nsIDOMHTMLOListElement.idl',
'nsIDOMHTMLObjectElement.idl',
'nsIDOMHTMLOptGroupElement.idl',
'nsIDOMHTMLOptionElement.idl',
'nsIDOMHTMLOptionsCollection.idl',
'nsIDOMHTMLOutputElement.idl',
'nsIDOMHTMLParagraphElement.idl',
'nsIDOMHTMLParamElement.idl',
'nsIDOMHTMLPreElement.idl',
'nsIDOMHTMLProgressElement.idl',
'nsIDOMHTMLQuoteElement.idl',
'nsIDOMHTMLScriptElement.idl',
'nsIDOMHTMLSelectElement.idl',
@ -54,10 +63,14 @@ XPIDL_SOURCES += [
'nsIDOMHTMLStyleElement.idl',
'nsIDOMHTMLTableCaptionElem.idl',
'nsIDOMHTMLTableCellElement.idl',
'nsIDOMHTMLTableColElement.idl',
'nsIDOMHTMLTableElement.idl',
'nsIDOMHTMLTableRowElement.idl',
'nsIDOMHTMLTableSectionElement.idl',
'nsIDOMHTMLTextAreaElement.idl',
'nsIDOMHTMLTitleElement.idl',
'nsIDOMHTMLUListElement.idl',
'nsIDOMHTMLUnknownElement.idl',
'nsIDOMHTMLVideoElement.idl',
'nsIDOMMediaError.idl',
'nsIDOMMozBrowserFrame.idl',

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

@ -0,0 +1,23 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLDListElement interface is the interface to a [X]HTML
* dl element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(edd9338b-f0d5-4825-97d6-6a49862309cc)]
interface nsIDOMHTMLDListElement : nsIDOMHTMLElement
{
attribute boolean compact;
};

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

@ -0,0 +1,25 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLDataListElement interface is the interface to a HTML
* <datalist> element.
*
* For more information on this interface, please see
* http://www.whatwg.org/specs/web-apps/current-work/#the-datalist-element
*
* @status UNDER_DEVELOPMENT
*/
interface nsIDOMHTMLCollection;
[scriptable, uuid(528e6a6b-f957-42e1-8d1b-eeeb2fd0b128)]
interface nsIDOMHTMLDataListElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLCollection options;
};

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

@ -16,8 +16,8 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
// Exists so that | element instanceof Ci.nsIDOMHTMLDirectoryElement | works.
[scriptable, uuid(cf50373e-e004-4cec-bc65-be9250d9e4c8)]
interface nsIDOMHTMLDirectoryElement : nsIDOMHTMLElement
{
attribute boolean compact;
};

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

@ -0,0 +1,25 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLFontElement interface is the interface to a [X]HTML
* font element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(e4d86aad-f245-4901-877e-0ae233c5fd37)]
interface nsIDOMHTMLFontElement : nsIDOMHTMLElement
{
attribute DOMString color;
attribute DOMString face;
attribute DOMString size;
};

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

@ -0,0 +1,24 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLLegendElement interface is the interface to a [X]HTML
* legend element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(2e4567be-3d91-4df8-bdf9-f3bd96a6cd06)]
interface nsIDOMHTMLLegendElement : nsIDOMHTMLElement
{
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString align;
};

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

@ -0,0 +1,30 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#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(6b1fc313-a7c1-4064-ba24-b72e099b05fa)]
interface nsIDOMHTMLMeterElement : nsIDOMHTMLElement
{
attribute double value;
attribute double min;
attribute double max;
attribute double low;
attribute double high;
attribute double optimum;
/**
* The labels attribute will be done with bug 556743.
*/
//readonly attribute NodeList labels;
};

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

@ -0,0 +1,24 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLModElement interface is the interface to a [X]HTML
* ins and del element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(8a1bdf64-19f3-401b-aaea-8c6a5ef1c66f)]
interface nsIDOMHTMLModElement : nsIDOMHTMLElement
{
attribute DOMString cite;
attribute DOMString dateTime;
};

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

@ -0,0 +1,43 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLOutputElement interface is the interface to a HTML
* <output> element.
*
* For more information on this interface, please see
* http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
*
* @status UNDER_DEVELOPMENT
*/
interface nsIDOMValidityState;
[scriptable, uuid(c4bff576-90b5-44b0-8278-bf4e3010b09a)]
interface nsIDOMHTMLOutputElement : nsIDOMHTMLElement
{
// DOMSettableTokenList
readonly attribute nsISupports htmlFor;
readonly attribute nsIDOMHTMLFormElement form;
attribute DOMString name;
readonly attribute DOMString type;
attribute DOMString defaultValue;
attribute DOMString value;
readonly attribute boolean willValidate;
readonly attribute nsIDOMValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(in DOMString error);
/**
* The labels IDL attribute will be added with bug 556743.
*/
//readonly attribute nsIDOMNodeList labels;
};

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

@ -0,0 +1,26 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLParamElement interface is the interface to a [X]HTML
* param element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(f85e1b05-6dc4-442d-bea8-7cf551f9bc9f)]
interface nsIDOMHTMLParamElement : nsIDOMHTMLElement
{
attribute DOMString name;
attribute DOMString type;
attribute DOMString value;
attribute DOMString valueType;
};

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

@ -0,0 +1,29 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLProgressElement interface is the interface to a HTML
* <progress> element.
*
* For more information on this interface, please see
* http://www.whatwg.org/specs/web-apps/current-work/#the-progress-element
*
* @status UNDER_DEVELOPMENT
*/
[scriptable, uuid(4b4bec16-c65f-4a08-97d1-dff624efdca4)]
interface nsIDOMHTMLProgressElement : nsIDOMHTMLElement
{
attribute double value;
attribute double max;
readonly attribute double position;
/**
* The labels attribute will be done with bug 567740.
*/
//readonly attribute NodeList labels;
};

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

@ -0,0 +1,28 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLTableColElement interface is the interface to a
* [X]HTML col element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(cd5a5a33-7101-4d32-987c-337c004fce1a)]
interface nsIDOMHTMLTableColElement : nsIDOMHTMLElement
{
attribute DOMString align;
attribute DOMString ch;
attribute DOMString chOff;
attribute long span;
attribute DOMString vAlign;
attribute DOMString width;
};

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

@ -19,4 +19,39 @@
[scriptable, uuid(1a7bf1f1-5d6c-4200-9ceb-455874322315)]
interface nsIDOMHTMLTableElement : nsIDOMHTMLElement
{
// Modified in DOM Level 2:
attribute nsIDOMHTMLTableCaptionElement caption;
// raises(DOMException) on setting
// Modified in DOM Level 2:
attribute nsIDOMHTMLTableSectionElement tHead;
// raises(DOMException) on setting
// Modified in DOM Level 2:
attribute nsIDOMHTMLTableSectionElement tFoot;
// raises(DOMException) on setting
readonly attribute nsIDOMHTMLCollection rows;
readonly attribute nsIDOMHTMLCollection tBodies;
attribute DOMString align;
attribute DOMString bgColor;
attribute DOMString border;
attribute DOMString cellPadding;
attribute DOMString cellSpacing;
attribute DOMString frame;
attribute DOMString rules;
attribute DOMString summary;
attribute DOMString width;
nsIDOMHTMLElement createTHead();
void deleteTHead();
nsIDOMHTMLElement createTFoot();
void deleteTFoot();
nsIDOMHTMLElement createCaption();
void deleteCaption();
// Modified in DOM Level 2:
nsIDOMHTMLElement insertRow(in long index)
raises(DOMException);
// Modified in DOM Level 2:
void deleteRow(in long index)
raises(DOMException);
};

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

@ -0,0 +1,39 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLTableRowElement interface is the interface to a
* [X]HTML tr element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, uuid(02094366-0d3d-47e3-949c-89113a9bcc15)]
interface nsIDOMHTMLTableRowElement : nsIDOMHTMLElement
{
// Modified in DOM Level 2:
readonly attribute long rowIndex;
// Modified in DOM Level 2:
readonly attribute long sectionRowIndex;
// Modified in DOM Level 2:
readonly attribute nsIDOMHTMLCollection cells;
attribute DOMString align;
attribute DOMString bgColor;
attribute DOMString ch;
attribute DOMString chOff;
attribute DOMString vAlign;
// Modified in DOM Level 2:
nsIDOMHTMLElement insertCell(in long index)
raises(DOMException);
// Modified in DOM Level 2:
void deleteCell(in long index)
raises(DOMException);
};

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

@ -0,0 +1,33 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLTableSectionElement interface is the interface to a
* [X]HTML thead, tbody, and tfoot element.
*
* This interface is trying to follow the DOM Level 2 HTML specification:
* http://www.w3.org/TR/DOM-Level-2-HTML/
*
* with changes from the work-in-progress WHATWG HTML specification:
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[scriptable, builtinclass, uuid(7b91cf4c-5194-4122-bc29-7bbd18ba0020)]
interface nsIDOMHTMLTableSectionElement : nsIDOMHTMLElement
{
attribute DOMString align;
attribute DOMString ch;
attribute DOMString chOff;
attribute DOMString vAlign;
readonly attribute nsIDOMHTMLCollection rows;
// Modified in DOM Level 2:
nsIDOMHTMLElement insertRow(in long index)
raises(DOMException);
// Modified in DOM Level 2:
void deleteRow(in long index)
raises(DOMException);
};

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

@ -0,0 +1,17 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLElement.idl"
/**
* The nsIDOMHTMLUnknownElement interface is the interface to an unknown HTML
* element.
*
* @see <http://www.whatwg.org/html/#htmlunknownelement>
*/
[scriptable, uuid(aa044a2d-4e9b-4fc5-8ad2-666da9062b36)]
interface nsIDOMHTMLUnknownElement : nsIDOMHTMLElement
{
};

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

@ -19,6 +19,5 @@ interface HTMLLegendElement : HTMLElement {
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLLegendElement {
[SetterThrows]
attribute DOMString align;
};

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

@ -12,19 +12,13 @@
*/
interface HTMLTableColElement : HTMLElement {
[SetterThrows]
attribute unsigned long span;
};
partial interface HTMLTableColElement {
[SetterThrows]
attribute DOMString align;
[SetterThrows]
attribute DOMString ch;
[SetterThrows]
attribute DOMString chOff;
[SetterThrows]
attribute DOMString vAlign;
[SetterThrows]
attribute DOMString width;
};

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

@ -42,6 +42,7 @@
#include "nsIDOMXULElement.h"
#include "nsContainerFrame.h"
#include "nsINameSpaceManager.h"
#include "nsIDOMHTMLLegendElement.h"
#include "nsIComboboxControlFrame.h"
#include "nsIListControlFrame.h"
#include "nsISelectControlFrame.h"
@ -5878,7 +5879,7 @@ nsCSSFrameConstructor::IsValidSibling(nsIFrame* aSibling,
nsGkAtoms::blockFrame == parentType)) {
// Legends can be sibling of legends but not of other content in the fieldset
nsIAtom* sibType = aSibling->GetContentInsertionFrame()->GetType();
bool legendContent = aContent->IsHTML(nsGkAtoms::legend);
nsCOMPtr<nsIDOMHTMLLegendElement> legendContent(do_QueryInterface(aContent));
if ((legendContent && (nsGkAtoms::legendFrame != sibType)) ||
(!legendContent && (nsGkAtoms::legendFrame == sibType)))
@ -5986,7 +5987,8 @@ GetAdjustedParentFrame(nsIFrame* aParentFrame,
if (nsGkAtoms::fieldSetFrame == aParentFrameType) {
// If the parent is a fieldSet, use the fieldSet's area frame as the
// parent unless the new content is a legend.
if (!aChildContent->IsHTML(nsGkAtoms::legend)) {
nsCOMPtr<nsIDOMHTMLLegendElement> legendContent(do_QueryInterface(aChildContent));
if (!legendContent) {
newParent = GetFieldSetBlockFrame(aParentFrame);
}
}

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

@ -8,6 +8,7 @@
#include "nsLegendFrame.h"
#include "nsIDOMNode.h"
#include "nsIDOMHTMLFieldSetElement.h"
#include "nsIDOMHTMLLegendElement.h"
#include "nsCSSRendering.h"
#include <algorithm>
#include "nsIContent.h"

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

@ -5,6 +5,7 @@
#include "nsMeterFrame.h"
#include "nsIDOMHTMLMeterElement.h"
#include "nsIContent.h"
#include "nsPresContext.h"
#include "nsGkAtoms.h"
@ -19,11 +20,9 @@
#include "nsFontMetrics.h"
#include "nsContentList.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLMeterElement.h"
#include "nsContentList.h"
#include <algorithm>
using mozilla::dom::HTMLMeterElement;
nsIFrame*
NS_NewMeterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
@ -151,13 +150,15 @@ nsMeterFrame::ReflowBarFrame(nsIFrame* aBarFrame,
nscoord yoffset = aReflowState.mComputedBorderPadding.top;
// NOTE: Introduce a new function getPosition in the content part ?
HTMLMeterElement* meterElement = static_cast<HTMLMeterElement*>(mContent);
double position, max, min, value;
nsCOMPtr<nsIDOMHTMLMeterElement> meterElement =
do_QueryInterface(mContent);
double max = meterElement->Max();
double min = meterElement->Min();
double value = meterElement->Value();
meterElement->GetMax(&max);
meterElement->GetMin(&min);
meterElement->GetValue(&value);
double position = max - min;
position = max - min;
position = position != 0 ? (value - min) / position : 1;
size = NSToCoordRound(size * position);

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

@ -5,6 +5,7 @@
#include "nsProgressFrame.h"
#include "nsIDOMHTMLProgressElement.h"
#include "nsIContent.h"
#include "nsPresContext.h"
#include "nsGkAtoms.h"
@ -19,11 +20,9 @@
#include "nsContentList.h"
#include "nsFontMetrics.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLProgressElement.h"
#include "nsContentList.h"
#include <algorithm>
using namespace mozilla::dom;
nsIFrame*
NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
@ -158,7 +157,10 @@ nsProgressFrame::ReflowBarFrame(nsIFrame* aBarFrame,
nscoord xoffset = aReflowState.mComputedBorderPadding.left;
nscoord yoffset = aReflowState.mComputedBorderPadding.top;
double position = static_cast<HTMLProgressElement*>(mContent)->Position();
double position;
nsCOMPtr<nsIDOMHTMLProgressElement> progressElement =
do_QueryInterface(mContent);
progressElement->GetPosition(&position);
// Force the bar's size to match the current progress.
// When indeterminate, the progress' size will be 100%.

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

@ -24,8 +24,8 @@
#include "nsCocoaWindow.h"
#include "nsNativeThemeColors.h"
#include "nsIScrollableFrame.h"
#include "nsIDOMHTMLMeterElement.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLMeterElement.h"
#include "nsLookAndFeel.h"
#include "gfxContext.h"
@ -34,7 +34,6 @@
#include <algorithm>
using namespace mozilla::gfx;
using mozilla::dom::HTMLMeterElement;
#define DRAW_IN_FRAME_DEBUG 0
#define SCROLLBARS_VISUAL_DEBUG 0
@ -1391,23 +1390,33 @@ nsNativeThemeCocoa::DrawMeter(CGContextRef cgContext, const HIRect& inBoxRect,
NS_PRECONDITION(aFrame, "aFrame should not be null here!");
nsCOMPtr<nsIDOMHTMLMeterElement> meterElement =
do_QueryInterface(aFrame->GetContent());
// When using -moz-meterbar on an non meter element, we will not be able to
// get all the needed information so we just draw an empty meter.
nsIContent* content = aFrame->GetContent();
if (!(content && content->IsHTML(nsGkAtoms::meter))) {
if (!meterElement) {
DrawCellWithSnapping(mMeterBarCell, cgContext, inBoxRect,
meterSetting, VerticalAlignFactor(aFrame),
mCellDrawView, IsFrameRTL(aFrame));
return;
}
HTMLMeterElement* meterElement = static_cast<HTMLMeterElement*>(content);
double value = meterElement->Value();
double min = meterElement->Min();
double max = meterElement->Max();
double low = meterElement->Low();
double high = meterElement->High();
double optimum = meterElement->Optimum();
double value;
double min;
double max;
double low;
double high;
double optimum;
// NOTE: if we were allowed to static_cast to HTMLMeterElement we would be
// able to use nicer getters...
meterElement->GetValue(&value);
meterElement->GetMin(&min);
meterElement->GetMax(&max);
meterElement->GetLow(&low);
meterElement->GetHigh(&high);
meterElement->GetOptimum(&optimum);
NSLevelIndicatorCell* cell = mMeterBarCell;

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

@ -14,6 +14,7 @@
#include "nsString.h"
#include "nsINameSpaceManager.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLProgressElement.h"
#include "nsIDOMXULMenuListElement.h"
#include "nsThemeConstants.h"
#include "nsIComponentManager.h"
@ -25,12 +26,9 @@
#include "nsCSSRendering.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLBodyElement.h"
#include "mozilla/dom/HTMLProgressElement.h"
#include "nsIDocumentInlines.h"
#include <algorithm>
using namespace mozilla::dom;
nsNativeTheme::nsNativeTheme()
: mAnimatedContentTimeout(UINT32_MAX)
{
@ -152,8 +150,14 @@ nsNativeTheme::GetProgressValue(nsIFrame* aFrame)
{
// When we are using the HTML progress element,
// we can get the value from the IDL property.
if (aFrame && aFrame->GetContent()->IsHTML(nsGkAtoms::progress)) {
return static_cast<HTMLProgressElement*>(aFrame->GetContent())->Value();
if (aFrame) {
nsCOMPtr<nsIDOMHTMLProgressElement> progress =
do_QueryInterface(aFrame->GetContent());
if (progress) {
double value;
progress->GetValue(&value);
return value;
}
}
return (double)nsNativeTheme::CheckIntAttr(aFrame, nsGkAtoms::value, 0);
@ -165,8 +169,14 @@ nsNativeTheme::GetProgressMaxValue(nsIFrame* aFrame)
{
// When we are using the HTML progress element,
// we can get the max from the IDL property.
if (aFrame && aFrame->GetContent()->IsHTML(nsGkAtoms::progress)) {
return static_cast<HTMLProgressElement*>(aFrame->GetContent())->Max();
if (aFrame) {
nsCOMPtr<nsIDOMHTMLProgressElement> progress =
do_QueryInterface(aFrame->GetContent());
if (progress) {
double max;
progress->GetMax(&max);
return max;
}
}
return (double)std::max(nsNativeTheme::CheckIntAttr(aFrame, nsGkAtoms::max, 100), 1);