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_ADDREF_INHERITED(HTMLDataListElement, Element)
NS_IMPL_RELEASE_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_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLDataListElement,
nsIDOMHTMLDataListElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END
@ -42,5 +45,13 @@ HTMLDataListElement::MatchOptions(nsIContent* aContent, int32_t aNamespaceID,
!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled); !aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
} }
NS_IMETHODIMP
HTMLDataListElement::GetOptions(nsIDOMHTMLCollection** aOptions)
{
NS_ADDREF(*aOptions = Options());
return NS_OK;
}
} // namespace dom } // namespace dom
} // namespace mozilla } // namespace mozilla

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

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

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

@ -31,13 +31,66 @@ NS_IMPL_ADDREF_INHERITED(HTMLFontElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLFontElement, Element) NS_IMPL_RELEASE_INHERITED(HTMLFontElement, Element)
// QueryInterface implementation for HTMLFontElement // QueryInterface implementation for HTMLFontElement
NS_INTERFACE_MAP_BEGIN(HTMLFontElement) NS_INTERFACE_TABLE_HEAD(HTMLFontElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement) NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLFontElement, nsIDOMHTMLFontElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLFontElement) 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 bool
HTMLFontElement::ParseAttribute(int32_t aNamespaceID, HTMLFontElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute, nsIAtom* aAttribute,

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

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

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

@ -25,13 +25,30 @@ NS_IMPL_RELEASE_INHERITED(HTMLLegendElement, Element)
// QueryInterface implementation for HTMLLegendElement // QueryInterface implementation for HTMLLegendElement
NS_INTERFACE_MAP_BEGIN(HTMLLegendElement) NS_INTERFACE_TABLE_HEAD(HTMLLegendElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement) NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLLegendElement, nsIDOMHTMLLegendElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END
// nsIDOMHTMLLegendElement
NS_IMPL_ELEMENT_CLONE(HTMLLegendElement) 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 // this contains center, because IE4 does
static const nsAttrValue::EnumTable kAlignTable[] = { static const nsAttrValue::EnumTable kAlignTable[] = {
{ "left", NS_STYLE_TEXT_ALIGN_LEFT }, { "left", NS_STYLE_TEXT_ALIGN_LEFT },

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

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

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

@ -29,8 +29,11 @@ NS_IMPL_ADDREF_INHERITED(HTMLMeterElement, Element)
NS_IMPL_RELEASE_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_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLMeterElement,
nsIDOMHTMLMeterElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLMeterElement) NS_IMPL_ELEMENT_CLONE(HTMLMeterElement)
@ -220,6 +223,88 @@ HTMLMeterElement::Optimum() const
return std::min(optimum, max); 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 nsEventStates
HTMLMeterElement::GetOptimumState() const HTMLMeterElement::GetOptimumState() const
{ {

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

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

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

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

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

@ -8,13 +8,14 @@
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "nsGenericHTMLElement.h" #include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLModElement.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
class HTMLModElement MOZ_FINAL : public nsGenericHTMLElement, class HTMLModElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement public nsIDOMHTMLModElement
{ {
public: public:
HTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo); HTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -32,6 +33,9 @@ public:
// nsIDOMHTMLElement // nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLModElement
NS_DECL_NSIDOMHTMLMODELEMENT
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE; virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; } virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
@ -44,10 +48,7 @@ public:
{ {
SetHTMLAttr(nsGkAtoms::cite, aCite, aRv); SetHTMLAttr(nsGkAtoms::cite, aCite, aRv);
} }
void GetDateTime(nsAString& aDateTime) // XPCOM GetDateTime is fine.
{
GetHTMLAttr(nsGkAtoms::datetime, aDateTime);
}
void SetDateTime(const nsAString& aDateTime, ErrorResult& aRv) void SetDateTime(const nsAString& aDateTime, ErrorResult& aRv)
{ {
SetHTMLAttr(nsGkAtoms::datetime, aDateTime, 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_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLOutputElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement) NS_HTML_CONTENT_INTERFACES(nsGenericHTMLFormElement)
NS_INTERFACE_TABLE_INHERITED2(HTMLOutputElement, NS_INTERFACE_TABLE_INHERITED3(HTMLOutputElement,
nsIDOMHTMLOutputElement,
nsIMutationObserver, nsIMutationObserver,
nsIConstraintValidation) nsIConstraintValidation)
NS_INTERFACE_TABLE_TO_MAP_SEGUE NS_INTERFACE_TABLE_TO_MAP_SEGUE
@ -61,12 +62,20 @@ NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLOutputElement) 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) HTMLOutputElement::SetCustomValidity(const nsAString& aError)
{ {
nsIConstraintValidation::SetCustomValidity(aError); nsIConstraintValidation::SetCustomValidity(aError);
UpdateState(true); UpdateState(true);
return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -140,20 +149,49 @@ HTMLOutputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
return rv; return rv;
} }
void NS_IMETHODIMP
HTMLOutputElement::SetValue(const nsAString& aValue, ErrorResult& aRv) HTMLOutputElement::GetForm(nsIDOMHTMLFormElement** aForm)
{ {
mValueModeFlag = eModeValue; return nsGenericHTMLFormElement::GetForm(aForm);
aRv = nsContentUtils::SetNodeTextContent(this, aValue, true);
} }
void NS_IMETHODIMP
HTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv) 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; mDefaultValue = aDefaultValue;
if (mValueModeFlag == eModeDefault) { if (mValueModeFlag == eModeDefault) {
aRv = nsContentUtils::SetNodeTextContent(this, mDefaultValue, true); return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
} }
return NS_OK;
} }
nsDOMSettableTokenList* nsDOMSettableTokenList*
@ -165,6 +203,13 @@ HTMLOutputElement::HtmlFor()
return mTokenList; return mTokenList;
} }
NS_IMETHODIMP
HTMLOutputElement::GetHtmlFor(nsISupports** aResult)
{
NS_ADDREF(*aResult = HtmlFor());
return NS_OK;
}
void HTMLOutputElement::DescendantsChanged() void HTMLOutputElement::DescendantsChanged()
{ {
if (mValueModeFlag == eModeDefault) { if (mValueModeFlag == eModeDefault) {

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

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

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

@ -31,8 +31,11 @@ NS_IMPL_ADDREF_INHERITED(HTMLProgressElement, Element)
NS_IMPL_RELEASE_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_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLProgressElement,
nsIDOMHTMLProgressElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLProgressElement) NS_IMPL_ELEMENT_CLONE(HTMLProgressElement)
@ -64,6 +67,13 @@ HTMLProgressElement::ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
aValue, aResult); aValue, aResult);
} }
NS_IMETHODIMP
HTMLProgressElement::GetValue(double* aValue)
{
*aValue = Value();
return NS_OK;
}
double double
HTMLProgressElement::Value() const HTMLProgressElement::Value() const
{ {
@ -76,6 +86,21 @@ HTMLProgressElement::Value() const
return std::min(attrValue->GetDoubleValue(), Max()); 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 double
HTMLProgressElement::Max() const HTMLProgressElement::Max() const
{ {
@ -88,6 +113,21 @@ HTMLProgressElement::Max() const
return attrMax->GetDoubleValue(); 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 double
HTMLProgressElement::Position() const HTMLProgressElement::Position() const
{ {

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

@ -7,6 +7,7 @@
#define mozilla_dom_HTMLProgressElement_h #define mozilla_dom_HTMLProgressElement_h
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "nsIDOMHTMLProgressElement.h"
#include "nsGenericHTMLElement.h" #include "nsGenericHTMLElement.h"
#include "nsAttrValue.h" #include "nsAttrValue.h"
#include "nsAttrValueInlines.h" #include "nsAttrValueInlines.h"
@ -17,7 +18,7 @@ namespace mozilla {
namespace dom { namespace dom {
class HTMLProgressElement MOZ_FINAL : public nsGenericHTMLElement, class HTMLProgressElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLElement public nsIDOMHTMLProgressElement
{ {
public: public:
HTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo); HTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo);
@ -35,6 +36,9 @@ public:
// nsIDOMHTMLElement // nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLProgressElement
NS_DECL_NSIDOMHTMLPROGRESSELEMENT
nsEventStates IntrinsicState() const MOZ_OVERRIDE; nsEventStates IntrinsicState() const MOZ_OVERRIDE;
nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) 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 // QueryInterface implementation for HTMLSharedElement
NS_INTERFACE_MAP_BEGIN(HTMLSharedElement) NS_INTERFACE_MAP_BEGIN(HTMLSharedElement)
NS_HTML_CONTENT_INTERFACES_AMBIGUOUS(nsGenericHTMLElement, 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(nsIDOMHTMLBaseElement, base)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLDirectoryElement, dir) NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLDirectoryElement, dir)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLQuoteElement, q) NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLQuoteElement, q)
@ -46,6 +47,15 @@ NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLSharedElement) 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 // nsIDOMHTMLQuoteElement
NS_IMPL_URI_ATTR(HTMLSharedElement, Cite, cite) NS_IMPL_URI_ATTR(HTMLSharedElement, Cite, cite)

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

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

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

@ -32,6 +32,7 @@ NS_INTERFACE_MAP_BEGIN(HTMLSharedListElement)
NS_HTML_CONTENT_INTERFACES_AMBIGUOUS(nsGenericHTMLElement, NS_HTML_CONTENT_INTERFACES_AMBIGUOUS(nsGenericHTMLElement,
nsIDOMHTMLOListElement) nsIDOMHTMLOListElement)
NS_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLOListElement, ol) 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_INTERFACE_MAP_ENTRY_IF_TAG(nsIDOMHTMLUListElement, ul)
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END

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

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

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

@ -34,12 +34,115 @@ NS_IMPL_ADDREF_INHERITED(HTMLTableColElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLTableColElement, Element) NS_IMPL_RELEASE_INHERITED(HTMLTableColElement, Element)
// QueryInterface implementation for HTMLTableColElement // QueryInterface implementation for HTMLTableColElement
NS_INTERFACE_MAP_BEGIN(HTMLTableColElement) NS_INTERFACE_TABLE_HEAD(HTMLTableColElement)
NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement) NS_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLTableColElement,
nsIDOMHTMLTableColElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLTableColElement) 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 bool
HTMLTableColElement::ParseAttribute(int32_t aNamespaceID, HTMLTableColElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute, nsIAtom* aAttribute,

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

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

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

@ -6,6 +6,7 @@
#include "mozilla/Util.h" #include "mozilla/Util.h"
#include "mozilla/dom/HTMLTableElement.h" #include "mozilla/dom/HTMLTableElement.h"
#include "nsIDOMHTMLTableSectionElement.h"
#include "nsAttrValueInlines.h" #include "nsAttrValueInlines.h"
#include "nsRuleData.h" #include "nsRuleData.h"
#include "nsHTMLStyleSheet.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 // in fact, they are integers or they are meaningless. so we store them
// here as ints. // 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* nsIHTMLCollection*
HTMLTableElement::Rows() HTMLTableElement::Rows()
{ {
@ -353,6 +567,13 @@ HTMLTableElement::Rows()
return mRows; return mRows;
} }
NS_IMETHODIMP
HTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue)
{
NS_ADDREF(*aValue = TBodies());
return NS_OK;
}
nsIHTMLCollection* nsIHTMLCollection*
HTMLTableElement::TBodies() HTMLTableElement::TBodies()
{ {
@ -389,7 +610,14 @@ HTMLTableElement::CreateTHead()
return head.forget(); 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() HTMLTableElement::DeleteTHead()
{ {
HTMLTableSectionElement* tHead = GetTHead(); HTMLTableSectionElement* tHead = GetTHead();
@ -398,6 +626,8 @@ HTMLTableElement::DeleteTHead()
nsINode::RemoveChild(*tHead, rv); nsINode::RemoveChild(*tHead, rv);
MOZ_ASSERT(!rv.Failed()); MOZ_ASSERT(!rv.Failed());
} }
return NS_OK;
} }
already_AddRefed<nsGenericHTMLElement> already_AddRefed<nsGenericHTMLElement>
@ -420,7 +650,14 @@ HTMLTableElement::CreateTFoot()
return foot.forget(); 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() HTMLTableElement::DeleteTFoot()
{ {
HTMLTableSectionElement* tFoot = GetTFoot(); HTMLTableSectionElement* tFoot = GetTFoot();
@ -429,6 +666,8 @@ HTMLTableElement::DeleteTFoot()
nsINode::RemoveChild(*tFoot, rv); nsINode::RemoveChild(*tFoot, rv);
MOZ_ASSERT(!rv.Failed()); MOZ_ASSERT(!rv.Failed());
} }
return NS_OK;
} }
already_AddRefed<nsGenericHTMLElement> already_AddRefed<nsGenericHTMLElement>
@ -451,7 +690,14 @@ HTMLTableElement::CreateCaption()
return caption.forget(); 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() HTMLTableElement::DeleteCaption()
{ {
HTMLTableCaptionElement* caption = GetCaption(); HTMLTableCaptionElement* caption = GetCaption();
@ -460,6 +706,8 @@ HTMLTableElement::DeleteCaption()
nsINode::RemoveChild(*caption, rv); nsINode::RemoveChild(*caption, rv);
MOZ_ASSERT(!rv.Failed()); MOZ_ASSERT(!rv.Failed());
} }
return NS_OK;
} }
already_AddRefed<nsGenericHTMLElement> already_AddRefed<nsGenericHTMLElement>
@ -600,6 +848,14 @@ HTMLTableElement::InsertRow(int32_t aIndex, ErrorResult& aError)
return newRow.forget(); 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 void
HTMLTableElement::DeleteRow(int32_t aIndex, ErrorResult& aError) HTMLTableElement::DeleteRow(int32_t aIndex, ErrorResult& aError)
{ {
@ -630,6 +886,14 @@ HTMLTableElement::DeleteRow(int32_t aIndex, ErrorResult& aError)
row->RemoveFromParent(); row->RemoveFromParent();
} }
NS_IMETHODIMP
HTMLTableElement::DeleteRow(int32_t aValue)
{
ErrorResult rv;
DeleteRow(aValue, rv);
return rv.ErrorCode();
}
static const nsAttrValue::EnumTable kFrameTable[] = { static const nsAttrValue::EnumTable kFrameTable[] = {
{ "void", NS_STYLE_TABLE_FRAME_NONE }, { "void", NS_STYLE_TABLE_FRAME_NONE },
{ "above", NS_STYLE_TABLE_FRAME_ABOVE }, { "above", NS_STYLE_TABLE_FRAME_ABOVE },

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

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

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

@ -35,8 +35,11 @@ NS_IMPL_ADDREF_INHERITED(HTMLTableRowElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLTableRowElement, Element) NS_IMPL_RELEASE_INHERITED(HTMLTableRowElement, Element)
// QueryInterface implementation for HTMLTableRowElement // 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_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLTableRowElement,
nsIDOMHTMLTableRowElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END
@ -44,16 +47,12 @@ NS_IMPL_ELEMENT_CLONE(HTMLTableRowElement)
// protected method // protected method
HTMLTableSectionElement* already_AddRefed<nsIDOMHTMLTableSectionElement>
HTMLTableRowElement::GetSection() const HTMLTableRowElement::GetSection() const
{ {
nsIContent* parent = GetParent(); nsCOMPtr<nsIDOMHTMLTableSectionElement> section =
if (parent->IsHTML() && (parent->Tag() == nsGkAtoms::thead || do_QueryInterface(GetParent());
parent->Tag() == nsGkAtoms::tbody || return section.forget();
parent->Tag() == nsGkAtoms::tfoot)) {
return static_cast<HTMLTableSectionElement*>(parent);
}
return nullptr;
} }
// protected method // protected method
@ -95,15 +94,25 @@ HTMLTableRowElement::RowIndex() const
return -1; return -1;
} }
NS_IMETHODIMP
HTMLTableRowElement::GetRowIndex(int32_t* aValue)
{
*aValue = RowIndex();
return NS_OK;
}
int32_t int32_t
HTMLTableRowElement::SectionRowIndex() const HTMLTableRowElement::SectionRowIndex() const
{ {
HTMLTableSectionElement* section = GetSection(); nsCOMPtr<nsIDOMHTMLTableSectionElement> section = GetSection();
if (!section) { if (!section) {
return -1; 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(); uint32_t numRows = coll->Length();
for (uint32_t i = 0; i < numRows; i++) { for (uint32_t i = 0; i < numRows; i++) {
if (coll->GetElementAt(i) == this) { if (coll->GetElementAt(i) == this) {
@ -114,6 +123,13 @@ HTMLTableRowElement::SectionRowIndex() const
return -1; return -1;
} }
NS_IMETHODIMP
HTMLTableRowElement::GetSectionRowIndex(int32_t* aValue)
{
*aValue = SectionRowIndex();
return NS_OK;
}
static bool static bool
IsCell(nsIContent *aContent, int32_t aNamespaceID, IsCell(nsIContent *aContent, int32_t aNamespaceID,
nsIAtom* aAtom, void *aData) nsIAtom* aAtom, void *aData)
@ -141,6 +157,13 @@ HTMLTableRowElement::Cells()
return mCells; return mCells;
} }
NS_IMETHODIMP
HTMLTableRowElement::GetCells(nsIDOMHTMLCollection** aValue)
{
NS_ADDREF(*aValue = Cells());
return NS_OK;
}
already_AddRefed<nsGenericHTMLElement> already_AddRefed<nsGenericHTMLElement>
HTMLTableRowElement::InsertCell(int32_t aIndex, HTMLTableRowElement::InsertCell(int32_t aIndex,
ErrorResult& aError) ErrorResult& aError)
@ -188,6 +211,14 @@ HTMLTableRowElement::InsertCell(int32_t aIndex,
return cell.forget(); 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 void
HTMLTableRowElement::DeleteCell(int32_t aValue, ErrorResult& aError) HTMLTableRowElement::DeleteCell(int32_t aValue, ErrorResult& aError)
{ {
@ -220,6 +251,99 @@ HTMLTableRowElement::DeleteCell(int32_t aValue, ErrorResult& aError)
nsINode::RemoveChild(*cell, 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 bool
HTMLTableRowElement::ParseAttribute(int32_t aNamespaceID, HTMLTableRowElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute, nsIAtom* aAttribute,

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

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

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

@ -35,13 +35,84 @@ NS_IMPL_ADDREF_INHERITED(HTMLTableSectionElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLTableSectionElement, Element) NS_IMPL_RELEASE_INHERITED(HTMLTableSectionElement, Element)
// QueryInterface implementation for HTMLTableSectionElement // 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_HTML_CONTENT_INTERFACES(nsGenericHTMLElement)
NS_INTERFACE_TABLE_INHERITED1(HTMLTableSectionElement,
nsIDOMHTMLTableSectionElement)
NS_INTERFACE_TABLE_TO_MAP_SEGUE
NS_ELEMENT_INTERFACE_MAP_END NS_ELEMENT_INTERFACE_MAP_END
NS_IMPL_ELEMENT_CLONE(HTMLTableSectionElement) 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* nsIHTMLCollection*
HTMLTableSectionElement::Rows() HTMLTableSectionElement::Rows()
{ {
@ -56,6 +127,13 @@ HTMLTableSectionElement::Rows()
return mRows; return mRows;
} }
NS_IMETHODIMP
HTMLTableSectionElement::GetRows(nsIDOMHTMLCollection** aValue)
{
NS_ADDREF(*aValue = Rows());
return NS_OK;
}
already_AddRefed<nsGenericHTMLElement> already_AddRefed<nsGenericHTMLElement>
HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError) HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError)
{ {
@ -94,6 +172,15 @@ HTMLTableSectionElement::InsertRow(int32_t aIndex, ErrorResult& aError)
return rowContent.forget(); 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 void
HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError) HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
{ {
@ -126,6 +213,14 @@ HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
nsINode::RemoveChild(*row, aError); nsINode::RemoveChild(*row, aError);
} }
NS_IMETHODIMP
HTMLTableSectionElement::DeleteRow(int32_t aValue)
{
ErrorResult rv;
DeleteRow(aValue, rv);
return rv.ErrorCode();
}
bool bool
HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID, HTMLTableSectionElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute, nsIAtom* aAttribute,

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -16,12 +16,15 @@ XPIDL_SOURCES += [
'nsIDOMHTMLByteRanges.idl', 'nsIDOMHTMLByteRanges.idl',
'nsIDOMHTMLCanvasElement.idl', 'nsIDOMHTMLCanvasElement.idl',
'nsIDOMHTMLCollection.idl', 'nsIDOMHTMLCollection.idl',
'nsIDOMHTMLDListElement.idl',
'nsIDOMHTMLDataListElement.idl',
'nsIDOMHTMLDirectoryElement.idl', 'nsIDOMHTMLDirectoryElement.idl',
'nsIDOMHTMLDivElement.idl', 'nsIDOMHTMLDivElement.idl',
'nsIDOMHTMLDocument.idl', 'nsIDOMHTMLDocument.idl',
'nsIDOMHTMLElement.idl', 'nsIDOMHTMLElement.idl',
'nsIDOMHTMLEmbedElement.idl', 'nsIDOMHTMLEmbedElement.idl',
'nsIDOMHTMLFieldSetElement.idl', 'nsIDOMHTMLFieldSetElement.idl',
'nsIDOMHTMLFontElement.idl',
'nsIDOMHTMLFormElement.idl', 'nsIDOMHTMLFormElement.idl',
'nsIDOMHTMLFrameElement.idl', 'nsIDOMHTMLFrameElement.idl',
'nsIDOMHTMLFrameSetElement.idl', 'nsIDOMHTMLFrameSetElement.idl',
@ -34,19 +37,25 @@ XPIDL_SOURCES += [
'nsIDOMHTMLInputElement.idl', 'nsIDOMHTMLInputElement.idl',
'nsIDOMHTMLLIElement.idl', 'nsIDOMHTMLLIElement.idl',
'nsIDOMHTMLLabelElement.idl', 'nsIDOMHTMLLabelElement.idl',
'nsIDOMHTMLLegendElement.idl',
'nsIDOMHTMLLinkElement.idl', 'nsIDOMHTMLLinkElement.idl',
'nsIDOMHTMLMapElement.idl', 'nsIDOMHTMLMapElement.idl',
'nsIDOMHTMLMediaElement.idl', 'nsIDOMHTMLMediaElement.idl',
'nsIDOMHTMLMenuElement.idl', 'nsIDOMHTMLMenuElement.idl',
'nsIDOMHTMLMenuItemElement.idl', 'nsIDOMHTMLMenuItemElement.idl',
'nsIDOMHTMLMetaElement.idl', 'nsIDOMHTMLMetaElement.idl',
'nsIDOMHTMLMeterElement.idl',
'nsIDOMHTMLModElement.idl',
'nsIDOMHTMLOListElement.idl', 'nsIDOMHTMLOListElement.idl',
'nsIDOMHTMLObjectElement.idl', 'nsIDOMHTMLObjectElement.idl',
'nsIDOMHTMLOptGroupElement.idl', 'nsIDOMHTMLOptGroupElement.idl',
'nsIDOMHTMLOptionElement.idl', 'nsIDOMHTMLOptionElement.idl',
'nsIDOMHTMLOptionsCollection.idl', 'nsIDOMHTMLOptionsCollection.idl',
'nsIDOMHTMLOutputElement.idl',
'nsIDOMHTMLParagraphElement.idl', 'nsIDOMHTMLParagraphElement.idl',
'nsIDOMHTMLParamElement.idl',
'nsIDOMHTMLPreElement.idl', 'nsIDOMHTMLPreElement.idl',
'nsIDOMHTMLProgressElement.idl',
'nsIDOMHTMLQuoteElement.idl', 'nsIDOMHTMLQuoteElement.idl',
'nsIDOMHTMLScriptElement.idl', 'nsIDOMHTMLScriptElement.idl',
'nsIDOMHTMLSelectElement.idl', 'nsIDOMHTMLSelectElement.idl',
@ -54,10 +63,14 @@ XPIDL_SOURCES += [
'nsIDOMHTMLStyleElement.idl', 'nsIDOMHTMLStyleElement.idl',
'nsIDOMHTMLTableCaptionElem.idl', 'nsIDOMHTMLTableCaptionElem.idl',
'nsIDOMHTMLTableCellElement.idl', 'nsIDOMHTMLTableCellElement.idl',
'nsIDOMHTMLTableColElement.idl',
'nsIDOMHTMLTableElement.idl', 'nsIDOMHTMLTableElement.idl',
'nsIDOMHTMLTableRowElement.idl',
'nsIDOMHTMLTableSectionElement.idl',
'nsIDOMHTMLTextAreaElement.idl', 'nsIDOMHTMLTextAreaElement.idl',
'nsIDOMHTMLTitleElement.idl', 'nsIDOMHTMLTitleElement.idl',
'nsIDOMHTMLUListElement.idl', 'nsIDOMHTMLUListElement.idl',
'nsIDOMHTMLUnknownElement.idl',
'nsIDOMHTMLVideoElement.idl', 'nsIDOMHTMLVideoElement.idl',
'nsIDOMMediaError.idl', 'nsIDOMMediaError.idl',
'nsIDOMMozBrowserFrame.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/ * http://www.whatwg.org/specs/web-apps/current-work/
*/ */
// Exists so that | element instanceof Ci.nsIDOMHTMLDirectoryElement | works.
[scriptable, uuid(cf50373e-e004-4cec-bc65-be9250d9e4c8)] [scriptable, uuid(cf50373e-e004-4cec-bc65-be9250d9e4c8)]
interface nsIDOMHTMLDirectoryElement : nsIDOMHTMLElement 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)] [scriptable, uuid(1a7bf1f1-5d6c-4200-9ceb-455874322315)]
interface nsIDOMHTMLTableElement : nsIDOMHTMLElement 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 // http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLLegendElement { partial interface HTMLLegendElement {
[SetterThrows]
attribute DOMString align; attribute DOMString align;
}; };

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

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

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

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

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

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

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

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

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

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

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

@ -24,8 +24,8 @@
#include "nsCocoaWindow.h" #include "nsCocoaWindow.h"
#include "nsNativeThemeColors.h" #include "nsNativeThemeColors.h"
#include "nsIScrollableFrame.h" #include "nsIScrollableFrame.h"
#include "nsIDOMHTMLMeterElement.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLMeterElement.h"
#include "nsLookAndFeel.h" #include "nsLookAndFeel.h"
#include "gfxContext.h" #include "gfxContext.h"
@ -34,7 +34,6 @@
#include <algorithm> #include <algorithm>
using namespace mozilla::gfx; using namespace mozilla::gfx;
using mozilla::dom::HTMLMeterElement;
#define DRAW_IN_FRAME_DEBUG 0 #define DRAW_IN_FRAME_DEBUG 0
#define SCROLLBARS_VISUAL_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!"); 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 // 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. // get all the needed information so we just draw an empty meter.
nsIContent* content = aFrame->GetContent(); if (!meterElement) {
if (!(content && content->IsHTML(nsGkAtoms::meter))) {
DrawCellWithSnapping(mMeterBarCell, cgContext, inBoxRect, DrawCellWithSnapping(mMeterBarCell, cgContext, inBoxRect,
meterSetting, VerticalAlignFactor(aFrame), meterSetting, VerticalAlignFactor(aFrame),
mCellDrawView, IsFrameRTL(aFrame)); mCellDrawView, IsFrameRTL(aFrame));
return; return;
} }
HTMLMeterElement* meterElement = static_cast<HTMLMeterElement*>(content); double value;
double value = meterElement->Value(); double min;
double min = meterElement->Min(); double max;
double max = meterElement->Max(); double low;
double low = meterElement->Low(); double high;
double high = meterElement->High(); double optimum;
double optimum = meterElement->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; NSLevelIndicatorCell* cell = mMeterBarCell;

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

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