Merge latest green inbound changeset to mozilla-central

This commit is contained in:
Ed Morley 2013-02-12 14:43:06 +00:00
commit 6735c60a03
60 changed files with 5231 additions and 6206 deletions

View File

@ -0,0 +1,265 @@
/* -*- Mode: C++; 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 "mozilla/dom/HTMLOutputElement.h"
#include "mozilla/dom/HTMLOutputElementBinding.h"
#include "nsFormSubmission.h"
#include "nsDOMSettableTokenList.h"
#include "nsEventStates.h"
#include "mozAutoDocUpdate.h"
#include "nsHTMLFormElement.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Output)
DOMCI_NODE_DATA(HTMLOutputElement, mozilla::dom::HTMLOutputElement)
namespace mozilla {
namespace dom {
HTMLOutputElement::HTMLOutputElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLFormElement(aNodeInfo)
, mValueModeFlag(eModeDefault)
{
SetIsDOMBinding();
AddMutationObserver(this);
// We start out valid and ui-valid (since we have no form).
AddStatesSilently(NS_EVENT_STATE_VALID | NS_EVENT_STATE_MOZ_UI_VALID);
}
HTMLOutputElement::~HTMLOutputElement()
{
if (mTokenList) {
mTokenList->DropReference();
}
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLOutputElement,
nsGenericHTMLFormElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mValidity)
if (tmp->mTokenList) {
tmp->mTokenList->DropReference();
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTokenList)
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLOutputElement,
nsGenericHTMLFormElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mValidity)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTokenList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(HTMLOutputElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLOutputElement, Element)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLOutputElement)
NS_HTML_CONTENT_INTERFACE_TABLE3(HTMLOutputElement,
nsIDOMHTMLOutputElement,
nsIMutationObserver,
nsIConstraintValidation)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(HTMLOutputElement,
nsGenericHTMLFormElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLOutputElement)
NS_IMPL_ELEMENT_CLONE(HTMLOutputElement)
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
HTMLOutputElement::Reset()
{
mValueModeFlag = eModeDefault;
return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
}
NS_IMETHODIMP
HTMLOutputElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
{
// The output element is not submittable.
return NS_OK;
}
bool
HTMLOutputElement::ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
const nsAString& aValue, nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::_for) {
aResult.ParseAtomArray(aValue);
return true;
}
}
return nsGenericHTMLFormElement::ParseAttribute(aNamespaceID, aAttribute,
aValue, aResult);
}
nsEventStates
HTMLOutputElement::IntrinsicState() const
{
nsEventStates states = nsGenericHTMLFormElement::IntrinsicState();
// We don't have to call IsCandidateForConstraintValidation()
// because <output> can't be barred from constraint validation.
if (IsValid()) {
states |= NS_EVENT_STATE_VALID;
if (!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) {
states |= NS_EVENT_STATE_MOZ_UI_VALID;
}
} else {
states |= NS_EVENT_STATE_INVALID;
if (!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) {
states |= NS_EVENT_STATE_MOZ_UI_INVALID;
}
}
return states;
}
nsresult
HTMLOutputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers)
{
nsresult rv = nsGenericHTMLFormElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
// Unfortunately, we can actually end up having to change our state
// as a result of being bound to a tree even from the parser: we
// might end up a in a novalidate form, and unlike other form
// controls that on its own is enough to make change ui-valid state.
// So just go ahead and update our state now.
UpdateState(false);
return rv;
}
NS_IMETHODIMP
HTMLOutputElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLFormElement::GetForm(aForm);
}
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) {
return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
}
return NS_OK;
}
nsDOMSettableTokenList*
HTMLOutputElement::HtmlFor()
{
if (!mTokenList) {
mTokenList = new nsDOMSettableTokenList(this, nsGkAtoms::_for);
}
return mTokenList;
}
NS_IMETHODIMP
HTMLOutputElement::GetHtmlFor(nsISupports** aResult)
{
NS_ADDREF(*aResult = HtmlFor());
return NS_OK;
}
void HTMLOutputElement::DescendantsChanged()
{
if (mValueModeFlag == eModeDefault) {
nsContentUtils::GetNodeTextContent(this, true, mDefaultValue);
}
}
// nsIMutationObserver
void HTMLOutputElement::CharacterDataChanged(nsIDocument* aDocument,
nsIContent* aContent,
CharacterDataChangeInfo* aInfo)
{
DescendantsChanged();
}
void HTMLOutputElement::ContentAppended(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aFirstNewContent,
int32_t aNewIndexInContainer)
{
DescendantsChanged();
}
void HTMLOutputElement::ContentInserted(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aChild,
int32_t aIndexInContainer)
{
DescendantsChanged();
}
void HTMLOutputElement::ContentRemoved(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aChild,
int32_t aIndexInContainer,
nsIContent* aPreviousSibling)
{
DescendantsChanged();
}
JSObject*
HTMLOutputElement::WrapNode(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap)
{
return HTMLOutputElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
} // namespace dom
} // namespace mozilla

View File

@ -0,0 +1,123 @@
/* -*- Mode: C++; 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/. */
#ifndef mozilla_dom_HTMLOutputElement_h
#define mozilla_dom_HTMLOutputElement_h
#include "nsGenericHTMLElement.h"
#include "nsIDOMHTMLOutputElement.h"
#include "nsStubMutationObserver.h"
#include "nsIConstraintValidation.h"
namespace mozilla {
namespace dom {
class HTMLOutputElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLOutputElement,
public nsStubMutationObserver,
public nsIConstraintValidation
{
public:
using nsIConstraintValidation::GetValidationMessage;
HTMLOutputElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~HTMLOutputElement();
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLOutputElement
NS_DECL_NSIDOMHTMLOUTPUTELEMENT
// nsIFormControl
NS_IMETHOD_(uint32_t) GetType() const { return NS_FORM_OUTPUT; }
NS_IMETHOD Reset();
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
virtual bool IsDisabled() const { return false; }
nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
const nsAString& aValue, nsAttrValue& aResult);
nsEventStates IntrinsicState() const;
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers);
// This function is called when a callback function from nsIMutationObserver
// has to be used to update the defaultValue attribute.
void DescendantsChanged();
// nsIMutationObserver
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLOutputElement,
nsGenericHTMLFormElement)
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
virtual JSObject*
WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) MOZ_OVERRIDE;
// WebIDL
nsDOMSettableTokenList* HtmlFor();
// nsGenericHTMLFormElement::GetForm is fine.
using nsGenericHTMLFormElement::GetForm;
// XPCOM GetName is fine.
void SetName(const nsAString& aName, ErrorResult& aRv)
{
SetHTMLAttr(nsGkAtoms::name, aName, aRv);
}
// XPCOM GetType is fine.
// XPCOM GetDefaultValue is fine.
void SetDefaultValue(const nsAString& aDefaultValue, ErrorResult& aRv)
{
aRv = SetDefaultValue(aDefaultValue);
}
// XPCOM GetValue is fine.
void SetValue(const nsAString& aValue, ErrorResult& aRv)
{
aRv = SetValue(aValue);
}
// nsIConstraintValidation::WillValidate is fine.
// nsIConstraintValidation::Validity() is fine.
// nsIConstraintValidation::GetValidationMessage() is fine.
// nsIConstraintValidation::CheckValidity() is fine.
using nsIConstraintValidation::CheckValidity;
// nsIConstraintValidation::SetCustomValidity() is fine.
protected:
enum ValueModeFlag {
eModeDefault,
eModeValue
};
ValueModeFlag mValueModeFlag;
nsString mDefaultValue;
nsRefPtr<nsDOMSettableTokenList> mTokenList;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_HTMLOutputElement_h

View File

@ -51,6 +51,7 @@ EXPORTS_mozilla/dom = \
HTMLMeterElement.h \
HTMLModElement.h \
HTMLOptGroupElement.h \
HTMLOutputElement.h \
HTMLParagraphElement.h \
HTMLPreElement.h \
HTMLProgressElement.h \
@ -112,7 +113,7 @@ CPPSRCS = \
nsHTMLSharedObjectElement.cpp \
nsHTMLOptionElement.cpp \
HTMLOptGroupElement.cpp \
nsHTMLOutputElement.cpp \
HTMLOutputElement.cpp \
HTMLParagraphElement.cpp \
HTMLPreElement.cpp \
HTMLProgressElement.cpp \

View File

@ -1,324 +0,0 @@
/* -*- Mode: C++; 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 "nsIDOMHTMLOutputElement.h"
#include "nsGenericHTMLElement.h"
#include "nsFormSubmission.h"
#include "nsDOMSettableTokenList.h"
#include "nsStubMutationObserver.h"
#include "nsIConstraintValidation.h"
#include "nsEventStates.h"
#include "mozAutoDocUpdate.h"
#include "nsHTMLFormElement.h"
using namespace mozilla::dom;
class nsHTMLOutputElement : public nsGenericHTMLFormElement,
public nsIDOMHTMLOutputElement,
public nsStubMutationObserver,
public nsIConstraintValidation
{
public:
using nsIConstraintValidation::GetValidationMessage;
nsHTMLOutputElement(already_AddRefed<nsINodeInfo> aNodeInfo);
virtual ~nsHTMLOutputElement();
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// nsIDOMNode
NS_FORWARD_NSIDOMNODE_TO_NSINODE
// nsIDOMElement
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
// nsIDOMHTMLElement
NS_FORWARD_NSIDOMHTMLELEMENT_TO_GENERIC
// nsIDOMHTMLOutputElement
NS_DECL_NSIDOMHTMLOUTPUTELEMENT
// nsIFormControl
NS_IMETHOD_(uint32_t) GetType() const { return NS_FORM_OUTPUT; }
NS_IMETHOD Reset();
NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
virtual bool IsDisabled() const { return false; }
nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
const nsAString& aValue, nsAttrValue& aResult);
nsEventStates IntrinsicState() const;
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers);
// This function is called when a callback function from nsIMutationObserver
// has to be used to update the defaultValue attribute.
void DescendantsChanged();
// nsIMutationObserver
NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsHTMLOutputElement,
nsGenericHTMLFormElement)
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
protected:
enum ValueModeFlag {
eModeDefault,
eModeValue
};
ValueModeFlag mValueModeFlag;
nsString mDefaultValue;
nsRefPtr<nsDOMSettableTokenList> mTokenList;
};
NS_IMPL_NS_NEW_HTML_ELEMENT(Output)
nsHTMLOutputElement::nsHTMLOutputElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsGenericHTMLFormElement(aNodeInfo)
, mValueModeFlag(eModeDefault)
{
AddMutationObserver(this);
// We start out valid and ui-valid (since we have no form).
AddStatesSilently(NS_EVENT_STATE_VALID | NS_EVENT_STATE_MOZ_UI_VALID);
}
nsHTMLOutputElement::~nsHTMLOutputElement()
{
if (mTokenList) {
mTokenList->DropReference();
}
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLOutputElement,
nsGenericHTMLFormElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mValidity)
if (tmp->mTokenList) {
tmp->mTokenList->DropReference();
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTokenList)
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLOutputElement,
nsGenericHTMLFormElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mValidity)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTokenList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_ADDREF_INHERITED(nsHTMLOutputElement, Element)
NS_IMPL_RELEASE_INHERITED(nsHTMLOutputElement, Element)
DOMCI_NODE_DATA(HTMLOutputElement, nsHTMLOutputElement)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(nsHTMLOutputElement)
NS_HTML_CONTENT_INTERFACE_TABLE3(nsHTMLOutputElement,
nsIDOMHTMLOutputElement,
nsIMutationObserver,
nsIConstraintValidation)
NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLOutputElement,
nsGenericHTMLFormElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLOutputElement)
NS_IMPL_ELEMENT_CLONE(nsHTMLOutputElement)
NS_IMPL_STRING_ATTR(nsHTMLOutputElement, Name, name)
// nsIConstraintValidation
NS_IMPL_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY(nsHTMLOutputElement)
NS_IMETHODIMP
nsHTMLOutputElement::SetCustomValidity(const nsAString& aError)
{
nsIConstraintValidation::SetCustomValidity(aError);
UpdateState(true);
return NS_OK;
}
NS_IMETHODIMP
nsHTMLOutputElement::Reset()
{
mValueModeFlag = eModeDefault;
return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
}
NS_IMETHODIMP
nsHTMLOutputElement::SubmitNamesValues(nsFormSubmission* aFormSubmission)
{
// The output element is not submittable.
return NS_OK;
}
bool
nsHTMLOutputElement::ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
const nsAString& aValue, nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None) {
if (aAttribute == nsGkAtoms::_for) {
aResult.ParseAtomArray(aValue);
return true;
}
}
return nsGenericHTMLFormElement::ParseAttribute(aNamespaceID, aAttribute,
aValue, aResult);
}
nsEventStates
nsHTMLOutputElement::IntrinsicState() const
{
nsEventStates states = nsGenericHTMLFormElement::IntrinsicState();
// We don't have to call IsCandidateForConstraintValidation()
// because <output> can't be barred from constraint validation.
if (IsValid()) {
states |= NS_EVENT_STATE_VALID;
if (!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) {
states |= NS_EVENT_STATE_MOZ_UI_VALID;
}
} else {
states |= NS_EVENT_STATE_INVALID;
if (!mForm || !mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate)) {
states |= NS_EVENT_STATE_MOZ_UI_INVALID;
}
}
return states;
}
nsresult
nsHTMLOutputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers)
{
nsresult rv = nsGenericHTMLFormElement::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
// Unfortunately, we can actually end up having to change our state
// as a result of being bound to a tree even from the parser: we
// might end up a in a novalidate form, and unlike other form
// controls that on its own is enough to make change ui-valid state.
// So just go ahead and update our state now.
UpdateState(false);
return rv;
}
NS_IMETHODIMP
nsHTMLOutputElement::GetForm(nsIDOMHTMLFormElement** aForm)
{
return nsGenericHTMLFormElement::GetForm(aForm);
}
NS_IMETHODIMP
nsHTMLOutputElement::GetType(nsAString& aType)
{
aType.AssignLiteral("output");
return NS_OK;
}
NS_IMETHODIMP
nsHTMLOutputElement::GetValue(nsAString& aValue)
{
nsContentUtils::GetNodeTextContent(this, true, aValue);
return NS_OK;
}
NS_IMETHODIMP
nsHTMLOutputElement::SetValue(const nsAString& aValue)
{
mValueModeFlag = eModeValue;
return nsContentUtils::SetNodeTextContent(this, aValue, true);
}
NS_IMETHODIMP
nsHTMLOutputElement::GetDefaultValue(nsAString& aDefaultValue)
{
aDefaultValue = mDefaultValue;
return NS_OK;
}
NS_IMETHODIMP
nsHTMLOutputElement::SetDefaultValue(const nsAString& aDefaultValue)
{
mDefaultValue = aDefaultValue;
if (mValueModeFlag == eModeDefault) {
return nsContentUtils::SetNodeTextContent(this, mDefaultValue, true);
}
return NS_OK;
}
NS_IMETHODIMP
nsHTMLOutputElement::GetHtmlFor(nsISupports** aResult)
{
if (!mTokenList) {
mTokenList = new nsDOMSettableTokenList(this, nsGkAtoms::_for);
}
NS_ADDREF(*aResult = mTokenList);
return NS_OK;
}
void nsHTMLOutputElement::DescendantsChanged()
{
if (mValueModeFlag == eModeDefault) {
nsContentUtils::GetNodeTextContent(this, true, mDefaultValue);
}
}
// nsIMutationObserver
void nsHTMLOutputElement::CharacterDataChanged(nsIDocument* aDocument,
nsIContent* aContent,
CharacterDataChangeInfo* aInfo)
{
DescendantsChanged();
}
void nsHTMLOutputElement::ContentAppended(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aFirstNewContent,
int32_t aNewIndexInContainer)
{
DescendantsChanged();
}
void nsHTMLOutputElement::ContentInserted(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aChild,
int32_t aIndexInContainer)
{
DescendantsChanged();
}
void nsHTMLOutputElement::ContentRemoved(nsIDocument* aDocument,
nsIContent* aContainer,
nsIContent* aChild,
int32_t aIndexInContainer,
nsIContent* aPreviousSibling)
{
DescendantsChanged();
}

View File

@ -6,6 +6,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=346485
<head>
<title>Test for Bug 346485</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="../reflect.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
frameLoaded = function() {
@ -32,20 +33,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=346485
function checkNameAttribute(element)
{
function nameAttributeEquals(element, expectedValue)
{
is(element.name, expectedValue, "Output name IDL attribute is not correct");
is(element.getAttribute('name'), expectedValue,
"Output name content attribute is not correct");
}
nameAttributeEquals(element, "output-name");
element.name = "new-name";
nameAttributeEquals(element, "new-name");
element.setAttribute('name', 'new-name-2');
nameAttributeEquals(element, "new-name-2");
is(element.name, "output-name", "Output name IDL attribute is not correct");
is(element.getAttribute('name'), "output-name",
"Output name content attribute is not correct");
}
function checkValueAndDefaultValueIDLAttribute(element)
@ -153,6 +143,11 @@ function checkFormSubmission()
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
reflectString({
element: document.createElement("output"),
attribute: "name",
});
var o = document.getElementsByTagName('output');
is(o.length, 1, "There should be one output element");

View File

@ -261,8 +261,6 @@ function reflectLimitedEnumerated(aParameters)
? aParameters.attribute : aParameters.attribute.idl;
var validValues = aParameters.validValues;
var invalidValues = aParameters.invalidValues;
var defaultValue = aParameters.defaultValue !== undefined
? aParameters.defaultValue : "";
var defaultValueInvalid = aParameters.defaultValue === undefined
? "" : typeof aParameters.defaultValue === "string"
? aParameters.defaultValue : aParameters.defaultValue.invalid

View File

@ -166,6 +166,7 @@ EXPORTS_mozilla/dom = \
SVGAnimationElement.h \
SVGClipPathElement.h \
SVGCircleElement.h \
SVGComponentTransferFunctionElement.h \
SVGDefsElement.h \
SVGDescElement.h \
SVGEllipseElement.h \

View File

@ -0,0 +1,256 @@
/* -*- Mode: C++; 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/. */
#ifndef mozilla_dom_SVGComponentTransferFunctionElement_h
#define mozilla_dom_SVGComponentTransferFunctionElement_h
#include "nsSVGEnum.h"
#include "nsSVGFilters.h"
#include "nsSVGNumber2.h"
#include "SVGAnimatedNumberList.h"
#define NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID \
{ 0xafab106d, 0xbc18, 0x4f7f, \
{ 0x9e, 0x29, 0xfe, 0xb4, 0xb0, 0x16, 0x5f, 0xf4 } }
nsresult NS_NewSVGComponentTransferFunctionElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
namespace mozilla {
class DOMSVGAnimatedNumberList;
namespace dom {
typedef SVGFEUnstyledElement SVGComponentTransferFunctionElementBase;
class SVGComponentTransferFunctionElement : public SVGComponentTransferFunctionElementBase
{
friend nsresult (::NS_NewSVGComponentTransferFunctionElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo));
protected:
SVGComponentTransferFunctionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: SVGComponentTransferFunctionElementBase(aNodeInfo)
{
SetIsDOMBinding();
}
public:
// interfaces:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT
virtual bool AttributeAffectsRendering(
int32_t aNameSpaceID, nsIAtom* aAttribute) const;
virtual int32_t GetChannel() = 0;
void GenerateLookupTable(uint8_t* aTable);
// WebIDL
virtual JSObject*
WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) MOZ_OVERRIDE = 0;
already_AddRefed<nsIDOMSVGAnimatedEnumeration> Type();
already_AddRefed<DOMSVGAnimatedNumberList> TableValues();
already_AddRefed<nsIDOMSVGAnimatedNumber> Slope();
already_AddRefed<nsIDOMSVGAnimatedNumber> Intercept();
already_AddRefed<nsIDOMSVGAnimatedNumber> Amplitude();
already_AddRefed<nsIDOMSVGAnimatedNumber> Exponent();
already_AddRefed<nsIDOMSVGAnimatedNumber> Offset();
protected:
virtual NumberAttributesInfo GetNumberInfo();
virtual EnumAttributesInfo GetEnumInfo();
virtual NumberListAttributesInfo GetNumberListInfo();
// nsIDOMSVGComponentTransferFunctionElement properties:
enum { TABLEVALUES };
SVGAnimatedNumberList mNumberListAttributes[1];
static NumberListInfo sNumberListInfo[1];
enum { SLOPE, INTERCEPT, AMPLITUDE, EXPONENT, OFFSET };
nsSVGNumber2 mNumberAttributes[5];
static NumberInfo sNumberInfo[5];
enum { TYPE };
nsSVGEnum mEnumAttributes[1];
static nsSVGEnumMapping sTypeMap[];
static EnumInfo sEnumInfo[1];
};
} // namespace dom
} // namespace mozilla
nsresult NS_NewSVGFEFuncRElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
namespace mozilla {
namespace dom {
class SVGFEFuncRElement : public SVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncRElement
{
friend nsresult (::NS_NewSVGFEFuncRElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo));
protected:
SVGFEFuncRElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: SVGComponentTransferFunctionElement(aNodeInfo) {}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(SVGComponentTransferFunctionElement::)
NS_DECL_NSIDOMSVGFEFUNCRELEMENT
virtual int32_t GetChannel() { return 0; }
NS_FORWARD_NSIDOMSVGELEMENT(SVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
virtual JSObject*
WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) MOZ_OVERRIDE;
};
} // namespace dom
} // namespace mozilla
nsresult NS_NewSVGFEFuncGElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
namespace mozilla {
namespace dom {
class SVGFEFuncGElement : public SVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncGElement
{
friend nsresult (::NS_NewSVGFEFuncGElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo));
protected:
SVGFEFuncGElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: SVGComponentTransferFunctionElement(aNodeInfo) {}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(SVGComponentTransferFunctionElement::)
NS_DECL_NSIDOMSVGFEFUNCGELEMENT
virtual int32_t GetChannel() { return 1; }
NS_FORWARD_NSIDOMSVGELEMENT(SVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
virtual JSObject*
WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) MOZ_OVERRIDE;
};
} // namespace dom
} // namespace mozilla
nsresult NS_NewSVGFEFuncBElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
namespace mozilla {
namespace dom {
class SVGFEFuncBElement : public SVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncBElement
{
friend nsresult (::NS_NewSVGFEFuncBElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo));
protected:
SVGFEFuncBElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: SVGComponentTransferFunctionElement(aNodeInfo) {}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(SVGComponentTransferFunctionElement::)
NS_DECL_NSIDOMSVGFEFUNCBELEMENT
virtual int32_t GetChannel() { return 2; }
NS_FORWARD_NSIDOMSVGELEMENT(SVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
virtual JSObject*
WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) MOZ_OVERRIDE;
};
} // namespace dom
} // namespace mozilla
nsresult NS_NewSVGFEFuncAElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
namespace mozilla {
namespace dom {
class SVGFEFuncAElement : public SVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncAElement
{
friend nsresult (::NS_NewSVGFEFuncAElement(
nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo));
protected:
SVGFEFuncAElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: SVGComponentTransferFunctionElement(aNodeInfo) {}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(SVGComponentTransferFunctionElement::)
NS_DECL_NSIDOMSVGFEFUNCAELEMENT
virtual int32_t GetChannel() { return 3; }
NS_FORWARD_NSIDOMSVGELEMENT(SVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
virtual JSObject*
WrapNode(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap) MOZ_OVERRIDE;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_SVGComponentTransferFunctionElement_h

View File

@ -38,6 +38,11 @@
#include "SVGContentUtils.h"
#include <algorithm>
#include "nsContentUtils.h"
#include "mozilla/dom/SVGComponentTransferFunctionElement.h"
#include "mozilla/dom/SVGFEFuncAElementBinding.h"
#include "mozilla/dom/SVGFEFuncBElementBinding.h"
#include "mozilla/dom/SVGFEFuncGElementBinding.h"
#include "mozilla/dom/SVGFEFuncRElementBinding.h"
#if defined(XP_WIN)
// Prevent Windows redefining LoadImage
@ -1754,53 +1759,6 @@ nsSVGFEComponentTransferElement::GetStringInfo()
//--------------------------------------------
#define NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID \
{ 0xafab106d, 0xbc18, 0x4f7f, \
{ 0x9e, 0x29, 0xfe, 0xb4, 0xb0, 0x16, 0x5f, 0xf4 } }
typedef SVGFEUnstyledElement nsSVGComponentTransferFunctionElementBase;
class nsSVGComponentTransferFunctionElement : public nsSVGComponentTransferFunctionElementBase
{
friend nsresult NS_NewSVGComponentTransferFunctionElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
protected:
nsSVGComponentTransferFunctionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGComponentTransferFunctionElementBase(aNodeInfo) {}
public:
// interfaces:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT
virtual bool AttributeAffectsRendering(
int32_t aNameSpaceID, nsIAtom* aAttribute) const;
virtual int32_t GetChannel() = 0;
void GenerateLookupTable(uint8_t* aTable);
protected:
virtual NumberAttributesInfo GetNumberInfo();
virtual EnumAttributesInfo GetEnumInfo();
virtual NumberListAttributesInfo GetNumberListInfo();
// nsIDOMSVGComponentTransferFunctionElement properties:
enum { TABLEVALUES };
SVGAnimatedNumberList mNumberListAttributes[1];
static NumberListInfo sNumberListInfo[1];
enum { SLOPE, INTERCEPT, AMPLITUDE, EXPONENT, OFFSET };
nsSVGNumber2 mNumberAttributes[5];
static NumberInfo sNumberInfo[5];
enum { TYPE };
nsSVGEnum mEnumAttributes[1];
static nsSVGEnumMapping sTypeMap[];
static EnumInfo sEnumInfo[1];
};
nsresult
nsSVGFEComponentTransferElement::Filter(nsSVGFilterInstance *instance,
const nsTArray<const Image*>& aSources,
@ -1819,9 +1777,9 @@ nsSVGFEComponentTransferElement::Filter(nsSVGFilterInstance *instance,
childContent;
childContent = childContent->GetNextSibling()) {
nsRefPtr<nsSVGComponentTransferFunctionElement> child;
nsRefPtr<SVGComponentTransferFunctionElement> child;
CallQueryInterface(childContent,
(nsSVGComponentTransferFunctionElement**)getter_AddRefs(child));
(SVGComponentTransferFunctionElement**)getter_AddRefs(child));
if (child) {
child->GenerateLookupTable(tables[child->GetChannel()]);
}
@ -1858,12 +1816,15 @@ nsSVGFEComponentTransferElement::GetSourceImageNames(nsTArray<nsSVGStringInfo>&
aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN1], this));
}
nsSVGElement::NumberListInfo nsSVGComponentTransferFunctionElement::sNumberListInfo[1] =
namespace mozilla {
namespace dom {
nsSVGElement::NumberListInfo SVGComponentTransferFunctionElement::sNumberListInfo[1] =
{
{ &nsGkAtoms::tableValues }
};
nsSVGElement::NumberInfo nsSVGComponentTransferFunctionElement::sNumberInfo[5] =
nsSVGElement::NumberInfo SVGComponentTransferFunctionElement::sNumberInfo[5] =
{
{ &nsGkAtoms::slope, 1, false },
{ &nsGkAtoms::intercept, 0, false },
@ -1872,7 +1833,7 @@ nsSVGElement::NumberInfo nsSVGComponentTransferFunctionElement::sNumberInfo[5] =
{ &nsGkAtoms::offset, 0, false }
};
nsSVGEnumMapping nsSVGComponentTransferFunctionElement::sTypeMap[] = {
nsSVGEnumMapping SVGComponentTransferFunctionElement::sTypeMap[] = {
{&nsGkAtoms::identity,
nsIDOMSVGComponentTransferFunctionElement::SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY},
{&nsGkAtoms::table,
@ -1886,7 +1847,7 @@ nsSVGEnumMapping nsSVGComponentTransferFunctionElement::sTypeMap[] = {
{nullptr, 0}
};
nsSVGElement::EnumInfo nsSVGComponentTransferFunctionElement::sEnumInfo[1] =
nsSVGElement::EnumInfo SVGComponentTransferFunctionElement::sEnumInfo[1] =
{
{ &nsGkAtoms::type,
sTypeMap,
@ -1897,25 +1858,25 @@ nsSVGElement::EnumInfo nsSVGComponentTransferFunctionElement::sEnumInfo[1] =
//----------------------------------------------------------------------
// nsISupports methods
NS_IMPL_ADDREF_INHERITED(nsSVGComponentTransferFunctionElement,nsSVGComponentTransferFunctionElementBase)
NS_IMPL_RELEASE_INHERITED(nsSVGComponentTransferFunctionElement,nsSVGComponentTransferFunctionElementBase)
NS_IMPL_ADDREF_INHERITED(SVGComponentTransferFunctionElement,SVGComponentTransferFunctionElementBase)
NS_IMPL_RELEASE_INHERITED(SVGComponentTransferFunctionElement,SVGComponentTransferFunctionElementBase)
NS_DEFINE_STATIC_IID_ACCESSOR(nsSVGComponentTransferFunctionElement, NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
NS_DEFINE_STATIC_IID_ACCESSOR(SVGComponentTransferFunctionElement, NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
NS_INTERFACE_MAP_BEGIN(nsSVGComponentTransferFunctionElement)
NS_INTERFACE_MAP_BEGIN(SVGComponentTransferFunctionElement)
// nsISupports is an ambiguous base of nsSVGFE so we have to work
// around that
if ( aIID.Equals(NS_GET_IID(nsSVGComponentTransferFunctionElement)) )
if ( aIID.Equals(NS_GET_IID(SVGComponentTransferFunctionElement)) )
foundInterface = static_cast<nsISupports*>(static_cast<void*>(this));
else
NS_INTERFACE_MAP_END_INHERITING(nsSVGComponentTransferFunctionElementBase)
NS_INTERFACE_MAP_END_INHERITING(SVGComponentTransferFunctionElementBase)
//----------------------------------------------------------------------
// nsFEUnstyledElement methods
bool
nsSVGComponentTransferFunctionElement::AttributeAffectsRendering(int32_t aNameSpaceID,
SVGComponentTransferFunctionElement::AttributeAffectsRendering(int32_t aNameSpaceID,
nsIAtom* aAttribute) const
{
return aNameSpaceID == kNameSpaceID_None &&
@ -1932,51 +1893,92 @@ nsSVGComponentTransferFunctionElement::AttributeAffectsRendering(int32_t aNameSp
// nsIDOMSVGComponentTransferFunctionElement methods
/* readonly attribute nsIDOMSVGAnimatedEnumeration type; */
NS_IMETHODIMP nsSVGComponentTransferFunctionElement::GetType(nsIDOMSVGAnimatedEnumeration * *aType)
already_AddRefed<nsIDOMSVGAnimatedEnumeration>
SVGComponentTransferFunctionElement::Type()
{
return mEnumAttributes[TYPE].ToDOMAnimatedEnum(aType, this);
return mEnumAttributes[TYPE].ToDOMAnimatedEnum(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetType(nsIDOMSVGAnimatedEnumeration * *aType)
{
*aType = Type().get();
return NS_OK;
}
/* readonly attribute DOMSVGAnimatedNumberList tableValues; */
NS_IMETHODIMP nsSVGComponentTransferFunctionElement::GetTableValues(nsISupports * *aTableValues)
already_AddRefed<DOMSVGAnimatedNumberList>
SVGComponentTransferFunctionElement::TableValues()
{
*aTableValues = DOMSVGAnimatedNumberList::GetDOMWrapper(&mNumberListAttributes[TABLEVALUES],
this, TABLEVALUES).get();
return DOMSVGAnimatedNumberList::GetDOMWrapper(
&mNumberListAttributes[TABLEVALUES], this, TABLEVALUES);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetTableValues(nsISupports * *aTableValues)
{
*aTableValues = TableValues().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber slope; */
NS_IMETHODIMP nsSVGComponentTransferFunctionElement::GetSlope(nsIDOMSVGAnimatedNumber * *aSlope)
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Slope()
{
return mNumberAttributes[SLOPE].ToDOMAnimatedNumber(aSlope, this);
return mNumberAttributes[SLOPE].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetSlope(nsIDOMSVGAnimatedNumber * *aSlope)
{
*aSlope = Slope().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber intercept; */
NS_IMETHODIMP nsSVGComponentTransferFunctionElement::GetIntercept(nsIDOMSVGAnimatedNumber * *aIntercept)
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Intercept()
{
return mNumberAttributes[INTERCEPT].ToDOMAnimatedNumber(aIntercept, this);
return mNumberAttributes[INTERCEPT].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetIntercept(nsIDOMSVGAnimatedNumber * *aIntercept)
{
*aIntercept = Intercept().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber amplitude; */
NS_IMETHODIMP nsSVGComponentTransferFunctionElement::GetAmplitude(nsIDOMSVGAnimatedNumber * *aAmplitude)
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Amplitude()
{
return mNumberAttributes[AMPLITUDE].ToDOMAnimatedNumber(aAmplitude, this);
return mNumberAttributes[AMPLITUDE].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetAmplitude(nsIDOMSVGAnimatedNumber * *aAmplitude)
{
*aAmplitude = Amplitude().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber exponent; */
NS_IMETHODIMP nsSVGComponentTransferFunctionElement::GetExponent(nsIDOMSVGAnimatedNumber * *aExponent)
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Exponent()
{
return mNumberAttributes[EXPONENT].ToDOMAnimatedNumber(aExponent, this);
return mNumberAttributes[EXPONENT].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetExponent(nsIDOMSVGAnimatedNumber * *aExponent)
{
*aExponent = Exponent().get();
return NS_OK;
}
/* readonly attribute nsIDOMSVGAnimatedNumber offset; */
NS_IMETHODIMP nsSVGComponentTransferFunctionElement::GetOffset(nsIDOMSVGAnimatedNumber * *aOffset)
already_AddRefed<nsIDOMSVGAnimatedNumber>
SVGComponentTransferFunctionElement::Offset()
{
return mNumberAttributes[OFFSET].ToDOMAnimatedNumber(aOffset, this);
return mNumberAttributes[OFFSET].ToDOMAnimatedNumber(this);
}
NS_IMETHODIMP SVGComponentTransferFunctionElement::GetOffset(nsIDOMSVGAnimatedNumber * *aOffset)
{
*aOffset = Offset().get();
return NS_OK;
}
void
nsSVGComponentTransferFunctionElement::GenerateLookupTable(uint8_t *aTable)
SVGComponentTransferFunctionElement::GenerateLookupTable(uint8_t *aTable)
{
uint16_t type = mEnumAttributes[TYPE].GetAnimValue();
@ -2058,212 +2060,176 @@ nsSVGComponentTransferFunctionElement::GenerateLookupTable(uint8_t *aTable)
// nsSVGElement methods
nsSVGElement::NumberListAttributesInfo
nsSVGComponentTransferFunctionElement::GetNumberListInfo()
SVGComponentTransferFunctionElement::GetNumberListInfo()
{
return NumberListAttributesInfo(mNumberListAttributes, sNumberListInfo,
ArrayLength(sNumberListInfo));
}
nsSVGElement::EnumAttributesInfo
nsSVGComponentTransferFunctionElement::GetEnumInfo()
SVGComponentTransferFunctionElement::GetEnumInfo()
{
return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
ArrayLength(sEnumInfo));
}
nsSVGElement::NumberAttributesInfo
nsSVGComponentTransferFunctionElement::GetNumberInfo()
SVGComponentTransferFunctionElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
ArrayLength(sNumberInfo));
}
class nsSVGFEFuncRElement : public nsSVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncRElement
{
friend nsresult NS_NewSVGFEFuncRElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
protected:
nsSVGFEFuncRElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGComponentTransferFunctionElement(aNodeInfo) {}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_IMPL_ADDREF_INHERITED(SVGFEFuncRElement,SVGComponentTransferFunctionElement)
NS_IMPL_RELEASE_INHERITED(SVGFEFuncRElement,SVGComponentTransferFunctionElement)
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(nsSVGComponentTransferFunctionElement::)
} // namespace dom
} // namespace mozilla
NS_DECL_NSIDOMSVGFEFUNCRELEMENT
DOMCI_NODE_DATA(SVGFEFuncRElement, SVGFEFuncRElement)
virtual int32_t GetChannel() { return 0; }
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
namespace mozilla {
namespace dom {
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
};
NS_IMPL_ADDREF_INHERITED(nsSVGFEFuncRElement,nsSVGComponentTransferFunctionElement)
NS_IMPL_RELEASE_INHERITED(nsSVGFEFuncRElement,nsSVGComponentTransferFunctionElement)
DOMCI_NODE_DATA(SVGFEFuncRElement, nsSVGFEFuncRElement)
NS_INTERFACE_TABLE_HEAD(nsSVGFEFuncRElement)
NS_NODE_INTERFACE_TABLE5(nsSVGFEFuncRElement, nsIDOMNode, nsIDOMElement,
NS_INTERFACE_TABLE_HEAD(SVGFEFuncRElement)
NS_NODE_INTERFACE_TABLE5(SVGFEFuncRElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGComponentTransferFunctionElement,
nsIDOMSVGFEFuncRElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFEFuncRElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGComponentTransferFunctionElement)
NS_INTERFACE_MAP_END_INHERITING(SVGComponentTransferFunctionElement)
NS_IMPL_NS_NEW_SVG_ELEMENT(FEFuncR)
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEFuncRElement)
class nsSVGFEFuncGElement : public nsSVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncGElement
/* virtual */ JSObject*
SVGFEFuncRElement::WrapNode(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap)
{
friend nsresult NS_NewSVGFEFuncGElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
protected:
nsSVGFEFuncGElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGComponentTransferFunctionElement(aNodeInfo) {}
return SVGFEFuncRElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
} // namespace dom
} // namespace mozilla
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(nsSVGComponentTransferFunctionElement::)
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEFuncR)
NS_DECL_NSIDOMSVGFEFUNCGELEMENT
namespace mozilla {
namespace dom {
virtual int32_t GetChannel() { return 1; }
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncRElement)
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
NS_IMPL_ADDREF_INHERITED(SVGFEFuncGElement,SVGComponentTransferFunctionElement)
NS_IMPL_RELEASE_INHERITED(SVGFEFuncGElement,SVGComponentTransferFunctionElement)
virtual nsXPCClassInfo* GetClassInfo();
} // namespace dom
} // namespace mozilla
virtual nsIDOMNode* AsDOMNode() { return this; }
};
DOMCI_NODE_DATA(SVGFEFuncGElement, SVGFEFuncGElement)
NS_IMPL_ADDREF_INHERITED(nsSVGFEFuncGElement,nsSVGComponentTransferFunctionElement)
NS_IMPL_RELEASE_INHERITED(nsSVGFEFuncGElement,nsSVGComponentTransferFunctionElement)
namespace mozilla {
namespace dom {
DOMCI_NODE_DATA(SVGFEFuncGElement, nsSVGFEFuncGElement)
NS_INTERFACE_TABLE_HEAD(nsSVGFEFuncGElement)
NS_NODE_INTERFACE_TABLE5(nsSVGFEFuncGElement, nsIDOMNode, nsIDOMElement,
NS_INTERFACE_TABLE_HEAD(SVGFEFuncGElement)
NS_NODE_INTERFACE_TABLE5(SVGFEFuncGElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGComponentTransferFunctionElement,
nsIDOMSVGFEFuncGElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFEFuncGElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGComponentTransferFunctionElement)
NS_INTERFACE_MAP_END_INHERITING(SVGComponentTransferFunctionElement)
NS_IMPL_NS_NEW_SVG_ELEMENT(FEFuncG)
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEFuncGElement)
class nsSVGFEFuncBElement : public nsSVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncBElement
/* virtual */ JSObject*
SVGFEFuncGElement::WrapNode(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap)
{
friend nsresult NS_NewSVGFEFuncBElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
protected:
nsSVGFEFuncBElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGComponentTransferFunctionElement(aNodeInfo) {}
return SVGFEFuncGElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
} // namespace dom
} // namespace mozilla
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(nsSVGComponentTransferFunctionElement::)
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEFuncG)
NS_DECL_NSIDOMSVGFEFUNCBELEMENT
namespace mozilla {
namespace dom {
virtual int32_t GetChannel() { return 2; }
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncGElement)
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
NS_IMPL_ADDREF_INHERITED(SVGFEFuncBElement,SVGComponentTransferFunctionElement)
NS_IMPL_RELEASE_INHERITED(SVGFEFuncBElement,SVGComponentTransferFunctionElement)
virtual nsXPCClassInfo* GetClassInfo();
} // namespace dom
} // namespace mozilla
virtual nsIDOMNode* AsDOMNode() { return this; }
};
DOMCI_NODE_DATA(SVGFEFuncBElement, SVGFEFuncBElement)
NS_IMPL_ADDREF_INHERITED(nsSVGFEFuncBElement,nsSVGComponentTransferFunctionElement)
NS_IMPL_RELEASE_INHERITED(nsSVGFEFuncBElement,nsSVGComponentTransferFunctionElement)
namespace mozilla {
namespace dom {
DOMCI_NODE_DATA(SVGFEFuncBElement, nsSVGFEFuncBElement)
NS_INTERFACE_TABLE_HEAD(nsSVGFEFuncBElement)
NS_NODE_INTERFACE_TABLE5(nsSVGFEFuncBElement, nsIDOMNode, nsIDOMElement,
NS_INTERFACE_TABLE_HEAD(SVGFEFuncBElement)
NS_NODE_INTERFACE_TABLE5(SVGFEFuncBElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGComponentTransferFunctionElement,
nsIDOMSVGFEFuncBElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFEFuncBElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGComponentTransferFunctionElement)
NS_INTERFACE_MAP_END_INHERITING(SVGComponentTransferFunctionElement)
NS_IMPL_NS_NEW_SVG_ELEMENT(FEFuncB)
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEFuncBElement)
class nsSVGFEFuncAElement : public nsSVGComponentTransferFunctionElement,
public nsIDOMSVGFEFuncAElement
/* virtual */ JSObject*
SVGFEFuncBElement::WrapNode(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap)
{
friend nsresult NS_NewSVGFEFuncAElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
protected:
nsSVGFEFuncAElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGComponentTransferFunctionElement(aNodeInfo) {}
return SVGFEFuncBElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
} // namespace dom
} // namespace mozilla
NS_FORWARD_NSIDOMSVGCOMPONENTTRANSFERFUNCTIONELEMENT(nsSVGComponentTransferFunctionElement::)
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEFuncB)
NS_DECL_NSIDOMSVGFEFUNCAELEMENT
namespace mozilla {
namespace dom {
virtual int32_t GetChannel() { return 3; }
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncBElement)
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGComponentTransferFunctionElement::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
NS_IMPL_ADDREF_INHERITED(SVGFEFuncAElement,SVGComponentTransferFunctionElement)
NS_IMPL_RELEASE_INHERITED(SVGFEFuncAElement,SVGComponentTransferFunctionElement)
virtual nsXPCClassInfo* GetClassInfo();
} // namespace dom
} // namespace mozilla
virtual nsIDOMNode* AsDOMNode() { return this; }
};
DOMCI_NODE_DATA(SVGFEFuncAElement, SVGFEFuncAElement)
NS_IMPL_ADDREF_INHERITED(nsSVGFEFuncAElement,nsSVGComponentTransferFunctionElement)
NS_IMPL_RELEASE_INHERITED(nsSVGFEFuncAElement,nsSVGComponentTransferFunctionElement)
namespace mozilla {
namespace dom {
DOMCI_NODE_DATA(SVGFEFuncAElement, nsSVGFEFuncAElement)
NS_INTERFACE_TABLE_HEAD(nsSVGFEFuncAElement)
NS_NODE_INTERFACE_TABLE5(nsSVGFEFuncAElement, nsIDOMNode, nsIDOMElement,
NS_INTERFACE_TABLE_HEAD(SVGFEFuncAElement)
NS_NODE_INTERFACE_TABLE5(SVGFEFuncAElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement,
nsIDOMSVGComponentTransferFunctionElement,
nsIDOMSVGFEFuncAElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFEFuncAElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGComponentTransferFunctionElement)
NS_INTERFACE_MAP_END_INHERITING(SVGComponentTransferFunctionElement)
NS_IMPL_NS_NEW_SVG_ELEMENT(FEFuncA)
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEFuncAElement)
/* virtual */ JSObject*
SVGFEFuncAElement::WrapNode(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap)
{
return SVGFEFuncAElementBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
} // namespace dom
} // namespace mozilla
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEFuncA)
namespace mozilla {
namespace dom {
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEFuncAElement)
} // namespace dom
} // namespace mozilla
//---------------------Merge------------------------

View File

@ -151,9 +151,8 @@ nsSVGNumber2::SetAnimValue(float aValue, nsSVGElement *aSVGElement)
aSVGElement->DidAnimateNumber(mAttrEnum);
}
nsresult
nsSVGNumber2::ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult,
nsSVGElement *aSVGElement)
already_AddRefed<nsIDOMSVGAnimatedNumber>
nsSVGNumber2::ToDOMAnimatedNumber(nsSVGElement* aSVGElement)
{
nsRefPtr<DOMAnimatedNumber> domAnimatedNumber =
sSVGAnimatedNumberTearoffTable.GetTearoff(this);
@ -162,7 +161,14 @@ nsSVGNumber2::ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult,
sSVGAnimatedNumberTearoffTable.AddTearoff(this, domAnimatedNumber);
}
domAnimatedNumber.forget(aResult);
return domAnimatedNumber.forget();
}
nsresult
nsSVGNumber2::ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult,
nsSVGElement *aSVGElement)
{
*aResult = ToDOMAnimatedNumber(aSVGElement).get();
return NS_OK;
}

View File

@ -48,6 +48,8 @@ public:
bool IsExplicitlySet() const
{ return mIsAnimated || mIsBaseSet; }
already_AddRefed<nsIDOMSVGAnimatedNumber>
ToDOMAnimatedNumber(nsSVGElement* aSVGElement);
nsresult ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult,
nsSVGElement* aSVGElement);
// Returns a new nsISMILAttr object that the caller must delete

View File

@ -494,6 +494,10 @@ DOMInterfaces = {
}
},
'HTMLOutputElement': {
'hasInstanceInterface': 'nsIDOMHTMLOutputElement',
},
'HTMLParagraphElement': {
'hasInstanceInterface': 'nsIDOMHTMLParagraphElement',
},
@ -740,6 +744,10 @@ DOMInterfaces = {
'concrete': False
},
'SVGComponentTransferFunctionElement': {
'concrete': False,
},
'SVGElement': {
'nativeType': 'nsSVGElement',
'hasXPConnectImpls': True,
@ -747,6 +755,22 @@ DOMInterfaces = {
'resultNotAddRefed': ['ownerSVGElement', 'viewportElement', 'style']
},
'SVGFEFuncAElement': {
'headerFile': 'mozilla/dom/SVGComponentTransferFunctionElement.h',
},
'SVGFEFuncBElement': {
'headerFile': 'mozilla/dom/SVGComponentTransferFunctionElement.h',
},
'SVGFEFuncGElement': {
'headerFile': 'mozilla/dom/SVGComponentTransferFunctionElement.h',
},
'SVGFEFuncRElement': {
'headerFile': 'mozilla/dom/SVGComponentTransferFunctionElement.h',
},
'SVGGraphicsElement': {
'concrete': False,
'resultNotAddRefed': ['nearestViewportElement', 'farthestViewportElement']

View File

@ -1,40 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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 "Skeleton.h"
#include "mozilla/dom/SkeletonBinding.h"
#include "nsContentUtils.h"
namespace mozilla {
namespace dom {
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(Skeleton)
NS_IMPL_CYCLE_COLLECTING_ADDREF(Skeleton)
NS_IMPL_CYCLE_COLLECTING_RELEASE(Skeleton)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Skeleton)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
Skeleton::Skeleton()
{
SetIsDOMBinding();
}
Skeleton::~Skeleton()
{
}
JSObject*
Skeleton::WrapObject(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap)
{
return SkeletonBinding::Wrap(aCx, aScope, this, aTriedToWrap);
}
}
}

View File

@ -1,40 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* 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/. */
#pragma once
#include "nsWrapperCache.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
struct JSContext;
namespace mozilla {
namespace dom {
class Skeleton MOZ_FINAL : public nsISupports,
public nsWrapperCache
{
public:
Skeleton();
~Skeleton();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Skeleton)
void* GetParentObject() const
{
// TODO: return something sensible here, and change the return type
return somethingSensible;
}
virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope,
bool* aTriedToWrap);
};
}
}

View File

@ -1,16 +0,0 @@
#!/bin/bash
# This script creates a skeleton implementation for a C++ class which
# implements a Web IDL interface.
# This script is released into the public domain.
if [ -z "$1" ]; then
echo usage: ./generate.sh ClassName
exit 1
fi
expression="s/Skeleton/$1/g"
sed "$expression" < Skeleton.h > "$1.h"
sed "$expression" < Skeleton.cpp > "$1.cpp"

View File

@ -11,7 +11,8 @@ relativesrcdir = dom/imported-tests
DIRS = \
failures/editing/conformancetest \
failures/editing/selecttest \
failures/html/tests/submission/Opera/microdata \
failures/html/html/semantics/scripting-1/the-script-element \
failures/html/old-tests/submission/Opera/microdata \
failures/webapps/DOMCore/tests/approved \
failures/webapps/DOMCore/tests/submissions/Ms2ger \
failures/webapps/DOMCore/tests/submissions/Opera \

View File

@ -0,0 +1,22 @@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
DEPTH := @DEPTH@
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_script-for-event.html.json \
test_script-language-type.html.json \
test_script-languages-01.html.json \
test_script-languages-02.html.json \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,5 @@
{
"Script 1": true,
"Script 2": true,
"Script 3": true
}

View File

@ -0,0 +1,3 @@
{
"A script with empty type should run": true
}

View File

@ -0,0 +1,4 @@
{
"Script @type: unknown parameters": true,
"Script @type: unknown parameters 1": true
}

View File

@ -0,0 +1,74 @@
{
"Script should run with type=\"application/ecmascript\\f\"": true,
"Script should run with type=\"application/javascript\\f\"": true,
"Script should run with type=\"application/x-ecmascript\\f\"": true,
"Script should run with type=\"application/x-javascript\\f\"": true,
"Script should run with type=\"\\fapplication/ecmascript\"": true,
"Script should run with type=\"\\fapplication/javascript\"": true,
"Script should run with type=\"\\fapplication/x-ecmascript\"": true,
"Script should run with type=\"\\fapplication/x-javascript\"": true,
"Script shouldn't run with type=\"application/ecmascript\\0\"": true,
"Script shouldn't run with type=\"application/javascript\\0\"": true,
"Script shouldn't run with type=\"application/x-ecmascript\\0\"": true,
"Script shouldn't run with type=\"application/x-javascript\\0\"": true,
"Script shouldn't run with type=\"application/ecmascript\\0foo\"": true,
"Script shouldn't run with type=\"application/javascript\\0foo\"": true,
"Script shouldn't run with type=\"application/x-ecmascript\\0foo\"": true,
"Script shouldn't run with type=\"application/x-javascript\\0foo\"": true,
"Script should run with type=\"text/ecmascript\\f\"": true,
"Script should run with type=\"text/javascript\\f\"": true,
"Script should run with type=\"text/javascript1.0\\f\"": true,
"Script should run with type=\"text/javascript1.1\\f\"": true,
"Script should run with type=\"text/javascript1.2\\f\"": true,
"Script should run with type=\"text/javascript1.3\\f\"": true,
"Script should run with type=\"text/javascript1.4\\f\"": true,
"Script should run with type=\"text/javascript1.5\\f\"": true,
"Script should run with type=\"text/jscript\\f\"": true,
"Script should run with type=\"text/livescript\\f\"": true,
"Script should run with type=\"text/x-ecmascript\\f\"": true,
"Script should run with type=\"text/x-javascript\\f\"": true,
"Script should run with type=\"\\ftext/ecmascript\"": true,
"Script should run with type=\"\\ftext/javascript\"": true,
"Script should run with type=\"\\ftext/javascript1.0\"": true,
"Script should run with type=\"\\ftext/javascript1.1\"": true,
"Script should run with type=\"\\ftext/javascript1.2\"": true,
"Script should run with type=\"\\ftext/javascript1.3\"": true,
"Script should run with type=\"\\ftext/javascript1.4\"": true,
"Script should run with type=\"\\ftext/javascript1.5\"": true,
"Script should run with type=\"\\ftext/jscript\"": true,
"Script should run with type=\"\\ftext/livescript\"": true,
"Script should run with type=\"\\ftext/x-ecmascript\"": true,
"Script should run with type=\"\\ftext/x-javascript\"": true,
"Script shouldn't run with type=\"text/ecmascript\\0\"": true,
"Script shouldn't run with type=\"text/javascript\\0\"": true,
"Script shouldn't run with type=\"text/javascript1.0\\0\"": true,
"Script shouldn't run with type=\"text/javascript1.1\\0\"": true,
"Script shouldn't run with type=\"text/javascript1.2\\0\"": true,
"Script shouldn't run with type=\"text/javascript1.3\\0\"": true,
"Script shouldn't run with type=\"text/javascript1.4\\0\"": true,
"Script shouldn't run with type=\"text/javascript1.5\\0\"": true,
"Script shouldn't run with type=\"text/jscript\\0\"": true,
"Script shouldn't run with type=\"text/livescript\\0\"": true,
"Script shouldn't run with type=\"text/x-ecmascript\\0\"": true,
"Script shouldn't run with type=\"text/x-javascript\\0\"": true,
"Script shouldn't run with type=\"text/ecmascript\\0foo\"": true,
"Script shouldn't run with type=\"text/javascript\\0foo\"": true,
"Script shouldn't run with type=\"text/javascript1.0\\0foo\"": true,
"Script shouldn't run with type=\"text/javascript1.1\\0foo\"": true,
"Script shouldn't run with type=\"text/javascript1.2\\0foo\"": true,
"Script shouldn't run with type=\"text/javascript1.3\\0foo\"": true,
"Script shouldn't run with type=\"text/javascript1.4\\0foo\"": true,
"Script shouldn't run with type=\"text/javascript1.5\\0foo\"": true,
"Script shouldn't run with type=\"text/jscript\\0foo\"": true,
"Script shouldn't run with type=\"text/livescript\\0foo\"": true,
"Script shouldn't run with type=\"text/x-ecmascript\\0foo\"": true,
"Script shouldn't run with type=\"text/x-javascript\\0foo\"": true,
"Script should run with language=\"ecmascript\"": true,
"Script should run with language=\"jscript\"": true,
"Script should run with language=\"x-ecmascript\"": true,
"Script should run with language=\"x-javascript\"": true,
"Script should run with language=\"ECMASCRIPT\"": true,
"Script should run with language=\"JSCRIPT\"": true,
"Script should run with language=\"X-ECMASCRIPT\"": true,
"Script should run with language=\"X-JAVASCRIPT\"": true
}

View File

@ -1,5 +1,5 @@
{
"itemValue must reflect the src attribute on track elements": true,
"itemValue must reflect the textContent of time elements with no datetime attribute": true,
"itemValue must reflect the dateTime attribute of time elements with no datetime attribute": true,
"itemValue must reflect the datetime attribute of time elements with a datetime attribute": true
}

View File

@ -1,4 +1,7 @@
DIRS += \
html/tests/submission/Mozilla \
html/tests/submission/Opera/microdata \
html/html/webappapis/scripting/events \
html/html/browsers/browsing-the-web/read-media \
html/html/semantics/scripting-1/the-script-element \
html/html/webappapis/scripting/processing-model-2 \
html/old-tests/submission/Opera/microdata \
$(NULL)

View File

@ -1,3 +1,6 @@
https://dvcs.w3.org/hg/html|html
tests/submission/Mozilla
tests/submission/Opera/microdata
git+ssh://git@github.com:w3c/html-testsuite.git|html
html/webappapis/scripting/events
html/browsers/browsing-the-web/read-media
html/semantics/scripting-1/the-script-element
html/webappapis/scripting/processing-model-2
old-tests/submission/Opera/microdata

View File

@ -0,0 +1,20 @@
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
DEPTH := @DEPTH@
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_pageload-image.html \
test_pageload-video.html \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,26 @@
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
DEPTH := @DEPTH@
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_script-for-event.html \
test_script-for-onload.html \
test_script-for-event.xhtml \
test_script-language-type.html \
test_script-languages-01.html \
test_script-languages-02.html \
test_script-noembed-noframes-iframe.xhtml \
test_script-onload-string.html \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<title>Scripts with for and event attributes</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var run = [true, true, true, true, true, true, true, true];
</script>
<script for="w&#x130;ndow" event="onload">
run[0] = false;
</script>
<script for="window" event="onload x">
run[1] = false;
</script>
<script for="window" event="onload(x">
run[2] = false;
</script>
<script for="window" event="onload(x)">
run[3] = false;
</script>
<script for="window" event="onclick">
run[4] = false;
</script>
<script for="" event="onload">
run[5] = false;
</script>
<script for="window" event="">
run[6] = false;
</script>
<script for="" event="">
run[7] = false;
</script>
<script>
test(function() {
for (var i = 0; i < run.length; ++i) {
test(function() {
assert_true(run[i]);
}, "Script " + i);
}
});
</script>

View File

@ -0,0 +1,22 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Scripts with for and event attributes</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
var run = false;
</script>
<script for="window" event="bar">
// This script should not run, but should not cause a parse error either.
run = true;
</script>
<script>
test(function() {
assert_false(run, "Script was unexpectedly run.")
}, "Scripts with for and event attributes should not run.")
</script>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<title>Script: combinations of @type and @language</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html/#prepare-a-script">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var run = false;
</script>
<script type="" language="foo">
run = true;
</script>
<script>
test(function() {
assert_equals(run, true);
}, "A script with empty type should run");
</script>

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<title>Script @type: unknown parameters</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html5/#scriptingLanguages">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<script type="text/javascript;charset=UTF-8">
test(function() {
assert_unreached("'charset' should have prevented this script from executing.");
})
</script>
<script type="text/javascript;x-test=abc">
test(function() {
assert_unreached("'x-test' should have prevented this script from executing.");
})
</script>
</div>
<script>
test(function() {
assert_true(true)
})
</script>

View File

@ -0,0 +1,98 @@
<!DOCTYPE html>
<title>Script @type: JavaScript types</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://www.whatwg.org/html5/#scriptingLanguages">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
function testAttribute(attr, val, shouldRun) {
test(function() {
assert_false(ran, "ran variable not reset");
var script = document.createElement("script");
script.setAttribute(attr, val);
script.textContent = "ran = true;"
document.body.appendChild(script);
assert_equals(ran, shouldRun);
}, "Script should" + (shouldRun ? "" : "n't") + " run with " + attr + "=" + format_value(val));
ran = false
}
function testType(type) {
testAttribute("type", type, true);
}
function testLanguage(lang) {
testAttribute("language", lang, true);
}
function testTypeIgnored(type) {
testAttribute("type", type, false);
}
function testLanguageIgnored(lang) {
testAttribute("language", lang, false);
}
var application = [
"ecmascript",
"javascript",
"x-ecmascript",
"x-javascript"
];
var text = [
"ecmascript",
"javascript",
"javascript1.0",
"javascript1.1",
"javascript1.2",
"javascript1.3",
"javascript1.4",
"javascript1.5",
"jscript",
"livescript",
"x-ecmascript",
"x-javascript"
];
var spaces = [" ", "\t", "\n", "\r", "\f"];
var ran = false;
// Type attribute
testType("");
testTypeIgnored(" ");
application.map(function(t) { return "application/" + t; }).forEach(testType);
application.map(function(t) { return ("application/" + t).toUpperCase(); }).forEach(testType);
spaces.forEach(function(s) {
application.map(function(t) { return "application/" + t + s; }).forEach(testType);
application.map(function(t) { return s + "application/" + t; }).forEach(testType);
})
application.map(function(t) { return "application/" + t + "\0"; }).forEach(testTypeIgnored);
application.map(function(t) { return "application/" + t + "\0foo"; }).forEach(testTypeIgnored);
text.map(function(t) { return "text/" + t; }).forEach(testType);
text.map(function(t) { return ("text/" + t).toUpperCase(); }).forEach(testType);
spaces.forEach(function(s) {
text.map(function(t) { return "text/" + t + s; }).forEach(testType);
text.map(function(t) { return s + "text/" + t; }).forEach(testType);
})
text.map(function(t) { return "text/" + t + "\0"; }).forEach(testTypeIgnored);
text.map(function(t) { return "text/" + t + "\0foo"; }).forEach(testTypeIgnored);
// Language attribute
testLanguage("");
testLanguageIgnored(" ");
text.forEach(testLanguage);
text.map(function(t) { return t.toUpperCase(); }).forEach(testLanguage);
text.map(function(t) { return t + " "; }).forEach(testLanguageIgnored);
text.map(function(t) { return " " + t; }).forEach(testLanguageIgnored);
text.map(function(t) { return t + "xyz"; }).forEach(testLanguageIgnored);
text.map(function(t) { return "xyz" + t; }).forEach(testLanguageIgnored);
text.map(function(t) { return t + "\0"; }).forEach(testLanguageIgnored);
text.map(function(t) { return t + "\0foo"; }).forEach(testLanguageIgnored);
</script>

View File

@ -0,0 +1,36 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Script inside noembed, noframes and iframe</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
var run = [];
</script>
<div id="test">
<noembed>
<script>
run.push("noembed");
</script>
</noembed>
<noframes>
<script>
run.push("noframes");
</script>
</noframes>
<iframe>
<script>
run.push("iframe");
</script>
</iframe>
</div>
<script>
test(function() {
assert_array_equals(run, ["noembed", "noframes", "iframe"], "Haven't run.");
});
</script>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<title>Script: setting onload to a string</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
test(function() {
var s = document.createElement("script");
assert_equals(s.onload, null);
var dummy = function() {};
s.onload = dummy;
assert_equals(s.onload, dummy);
s.onload = "w('load DOM appended')";
assert_equals(s.onload, null);
}, "Setting onload to a string should convert to null.");
</script>

View File

@ -0,0 +1,21 @@
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
DEPTH := @DEPTH@
topsrcdir := @top_srcdir@
srcdir := @srcdir@
VPATH := @srcdir@
relativesrcdir := @relativesrcdir@
include $(DEPTH)/config/autoconf.mk
DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_body-onload.html \
test_event-handler-javascript.html \
test_event-handler-spec-example.html \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<title>Event handler with labels</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body onload="javascript:
for (var i = 0; i < 2; ++i) {
for (var j = 0; j < 2; ++j) {
t.step(function() {
assert_equals(i, 0);
assert_equals(j, 0);
});
break javascript;
}
}
t.done();
">
<div id="log"></div>
<script>
var t = async_test("Event handlers starting with 'javascript:' should treat that as a label.");
</script>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>Event handler invocation order</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<button type="button" id="test">Start test</button>
<script>
var t = async_test("Event handler listeners should be registered when they are first set.");
var i = 0;
var uncalled = "t.step(function() { assert_unreached('First event handler.') })"
var button = document.getElementById('test');
button.onclick = {};
button.addEventListener('click', t.step_func(function () { assert_equals(++i, 1) }), false);
button.setAttribute('onclick', uncalled); // event handler listener is registered here
button.addEventListener('click', t.step_func(function () { assert_equals(++i, 3) }), false);
button.onclick = t.step_func(function () { assert_equals(++i, 2); });
button.addEventListener('click', t.step_func(function () { assert_equals(++i, 4) }), false);
button.click()
assert_equals(button.getAttribute("onclick"), uncalled)
assert_equals(i, 4);
t.done()
</script>

View File

@ -13,14 +13,9 @@ DIRS := \
$(NULL)
MOCHITEST_FILES := \
test_body-onload.html \
test_pageload-image.html \
test_pageload-video.html \
test_script-for-onload.html \
test_window-onerror-parse-error.html \
test_window-onerror-runtime-error.html \
test_window-onerror-runtime-error-throw.html \
nested-document-write-external.js \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -1 +0,0 @@
document.write("w"); document.write("o");

View File

@ -12,16 +12,27 @@
// http://www.whatwg.org/specs/web-apps/current-work/#the-button-element
interface HTMLButtonElement : HTMLElement {
[SetterThrows, Pure]
attribute boolean autofocus;
[SetterThrows, Pure]
attribute boolean disabled;
[Pure]
readonly attribute HTMLFormElement? form;
[SetterThrows, Pure]
attribute DOMString formAction;
[SetterThrows, Pure]
attribute DOMString formEnctype;
[SetterThrows, Pure]
attribute DOMString formMethod;
[SetterThrows, Pure]
attribute boolean formNoValidate;
[SetterThrows, Pure]
attribute DOMString formTarget;
[SetterThrows, Pure]
attribute DOMString name;
[SetterThrows, Pure]
attribute DOMString type;
[SetterThrows, Pure]
attribute DOMString value;
// Not yet implemented:
// attribute HTMLMenuElement? menu;

View File

@ -0,0 +1,37 @@
/* -*- 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/.
*
* The origin of this IDL file is
* http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
*
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
interface HTMLOutputElement : HTMLElement {
[PutForwards=value, Constant]
readonly attribute DOMSettableTokenList htmlFor;
readonly attribute HTMLFormElement? form;
[SetterThrows, Pure]
attribute DOMString name;
[Constant]
readonly attribute DOMString type;
[SetterThrows, Pure]
attribute DOMString defaultValue;
[SetterThrows, Pure]
attribute DOMString value;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);
// Not yet implemented (bug 556743).
// readonly attribute NodeList labels;
};

View File

@ -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/.
*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html
*
* Copyright © 2013 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface SVGComponentTransferFunctionElement : SVGElement {
// Component Transfer Types
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4;
const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5;
readonly attribute SVGAnimatedEnumeration type;
readonly attribute SVGAnimatedNumberList tableValues;
readonly attribute SVGAnimatedNumber slope;
readonly attribute SVGAnimatedNumber intercept;
readonly attribute SVGAnimatedNumber amplitude;
readonly attribute SVGAnimatedNumber exponent;
readonly attribute SVGAnimatedNumber offset;
};

View File

@ -0,0 +1,14 @@
/* -*- 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/.
*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html
*
* Copyright © 2013 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface SVGFEFuncAElement : SVGComponentTransferFunctionElement {
};

View File

@ -0,0 +1,14 @@
/* -*- 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/.
*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html
*
* Copyright © 2013 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface SVGFEFuncBElement : SVGComponentTransferFunctionElement {
};

View File

@ -0,0 +1,14 @@
/* -*- 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/.
*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html
*
* Copyright © 2013 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface SVGFEFuncGElement : SVGComponentTransferFunctionElement {
};

View File

@ -0,0 +1,14 @@
/* -*- 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/.
*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html
*
* Copyright © 2013 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/
interface SVGFEFuncRElement : SVGComponentTransferFunctionElement {
};

View File

@ -87,6 +87,7 @@ webidl_files = \
HTMLOListElement.webidl \
HTMLOptGroupElement.webidl \
HTMLOptionsCollection.webidl \
HTMLOutputElement.webidl \
HTMLParagraphElement.webidl \
HTMLParamElement.webidl \
HTMLPreElement.webidl \
@ -140,10 +141,15 @@ webidl_files = \
SVGAnimationElement.webidl \
SVGCircleElement.webidl \
SVGClipPathElement.webidl \
SVGComponentTransferFunctionElement.webidl \
SVGDefsElement.webidl \
SVGDescElement.webidl \
SVGElement.webidl \
SVGEllipseElement.webidl \
SVGFEFuncAElement.webidl \
SVGFEFuncBElement.webidl \
SVGFEFuncGElement.webidl \
SVGFEFuncRElement.webidl \
SVGFitToViewBox.webidl \
SVGForeignObjectElement.webidl \
SVGGElement.webidl \

View File

@ -1473,12 +1473,8 @@ BindNameToSlot(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
static bool
CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answer)
{
bool ok;
ParseNode *pn2;
ok = true;
if (!pn || *answer)
return ok;
return true;
switch (pn->getArity()) {
case PN_FUNC:
@ -1489,8 +1485,8 @@ CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answe
* (the object and binding can be detected and hijacked or captured).
* This is a bug fix to ES3; it is fixed in ES3.1 drafts.
*/
*answer = false;
break;
MOZ_ASSERT(*answer == false);
return true;
case PN_LIST:
if (pn->isOp(JSOP_NOP) || pn->isOp(JSOP_OR) || pn->isOp(JSOP_AND) ||
@ -1499,35 +1495,39 @@ CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answe
* Non-operators along with ||, &&, ===, and !== never invoke
* toString or valueOf.
*/
for (pn2 = pn->pn_head; pn2; pn2 = pn2->pn_next)
bool ok = true;
for (ParseNode *pn2 = pn->pn_head; pn2; pn2 = pn2->pn_next)
ok &= CheckSideEffects(cx, bce, pn2, answer);
} else if (pn->isKind(PNK_GENEXP)) {
/* Generator-expressions are harmless if the result is ignored. */
*answer = false;
} else {
/*
* All invocation operations (construct: PNK_NEW, call: PNK_CALL)
* are presumed to be useful, because they may have side effects
* even if their main effect (their return value) is discarded.
*
* PNK_ELEM binary trees of 3+ nodes are flattened into lists to
* avoid too much recursion. All such lists must be presumed to be
* useful because each index operation could invoke a getter.
*
* Likewise, array and object initialisers may call prototype
* setters (the __defineSetter__ built-in, and writable __proto__
* on Array.prototype create this hazard). Initialiser list nodes
* have JSOP_NEWINIT in their pn_op.
*/
*answer = true;
return ok;
}
break;
if (pn->isKind(PNK_GENEXP)) {
/* Generator-expressions are harmless if the result is ignored. */
MOZ_ASSERT(*answer == false);
return true;
}
/*
* All invocation operations (construct: PNK_NEW, call: PNK_CALL)
* are presumed to be useful, because they may have side effects
* even if their main effect (their return value) is discarded.
*
* PNK_ELEM binary trees of 3+ nodes are flattened into lists to
* avoid too much recursion. All such lists must be presumed to be
* useful because each index operation could invoke a getter.
*
* Likewise, array and object initialisers may call prototype
* setters (the __defineSetter__ built-in, and writable __proto__
* on Array.prototype create this hazard). Initialiser list nodes
* have JSOP_NEWINIT in their pn_op.
*/
*answer = true;
return true;
case PN_TERNARY:
ok = CheckSideEffects(cx, bce, pn->pn_kid1, answer) &&
CheckSideEffects(cx, bce, pn->pn_kid2, answer) &&
CheckSideEffects(cx, bce, pn->pn_kid3, answer);
break;
return CheckSideEffects(cx, bce, pn->pn_kid1, answer) &&
CheckSideEffects(cx, bce, pn->pn_kid2, answer) &&
CheckSideEffects(cx, bce, pn->pn_kid3, answer);
case PN_BINARY:
if (pn->isAssignment()) {
@ -1540,7 +1540,7 @@ CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answe
* The only exception is assignment of a useless value to a const
* declared in the function currently being compiled.
*/
pn2 = pn->pn_left;
ParseNode *pn2 = pn->pn_left;
if (!pn2->isKind(PNK_NAME)) {
*answer = true;
} else {
@ -1551,36 +1551,38 @@ CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answe
if (!*answer && (!pn->isOp(JSOP_NOP) || !pn2->isConst()))
*answer = true;
}
} else {
if (pn->isOp(JSOP_OR) || pn->isOp(JSOP_AND) || pn->isOp(JSOP_STRICTEQ) ||
pn->isOp(JSOP_STRICTNE)) {
/*
* ||, &&, ===, and !== do not convert their operands via
* toString or valueOf method calls.
*/
ok = CheckSideEffects(cx, bce, pn->pn_left, answer) &&
CheckSideEffects(cx, bce, pn->pn_right, answer);
} else {
/*
* We can't easily prove that neither operand ever denotes an
* object with a toString or valueOf method.
*/
*answer = true;
}
return true;
}
break;
if (pn->isOp(JSOP_OR) || pn->isOp(JSOP_AND) || pn->isOp(JSOP_STRICTEQ) ||
pn->isOp(JSOP_STRICTNE)) {
/*
* ||, &&, ===, and !== do not convert their operands via
* toString or valueOf method calls.
*/
return CheckSideEffects(cx, bce, pn->pn_left, answer) &&
CheckSideEffects(cx, bce, pn->pn_right, answer);
}
/*
* We can't easily prove that neither operand ever denotes an
* object with a toString or valueOf method.
*/
*answer = true;
return true;
case PN_UNARY:
switch (pn->getKind()) {
case PNK_DELETE:
pn2 = pn->pn_kid;
{
ParseNode *pn2 = pn->pn_kid;
switch (pn2->getKind()) {
case PNK_NAME:
if (!BindNameToSlot(cx, bce, pn2))
return false;
if (pn2->isConst()) {
*answer = false;
break;
MOZ_ASSERT(*answer == false);
return true;
}
/* FALL THROUGH */
case PNK_DOT:
@ -1588,12 +1590,13 @@ CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answe
case PNK_ELEM:
/* All these delete addressing modes have effects too. */
*answer = true;
break;
return true;
default:
ok = CheckSideEffects(cx, bce, pn2, answer);
break;
return CheckSideEffects(cx, bce, pn2, answer);
}
break;
MOZ_NOT_REACHED("We have a returning default case");
return false;
}
case PNK_TYPEOF:
case PNK_VOID:
@ -1601,8 +1604,7 @@ CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answe
case PNK_BITNOT:
if (pn->isOp(JSOP_NOT)) {
/* ! does not convert its operand via toString or valueOf. */
ok = CheckSideEffects(cx, bce, pn->pn_kid, answer);
break;
return CheckSideEffects(cx, bce, pn->pn_kid, answer);
}
/* FALL THROUGH */
@ -1614,9 +1616,10 @@ CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answe
* toString or valueOf method.
*/
*answer = true;
break;
return true;
}
break;
MOZ_NOT_REACHED("We have a returning default case");
return false;
case PN_NAME:
/*
@ -1640,15 +1643,14 @@ CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answe
/* Dotted property references in general can call getters. */
*answer = true;
}
ok = CheckSideEffects(cx, bce, pn->maybeExpr(), answer);
break;
return CheckSideEffects(cx, bce, pn->maybeExpr(), answer);
case PN_NULLARY:
if (pn->isKind(PNK_DEBUGGER))
*answer = true;
break;
return true;
}
return ok;
return true;
}
bool

View File

@ -47,6 +47,11 @@ public class GeckoThread extends Thread implements GeckoEventListener {
// so just save it to locale here and reset it as default after the join
Locale locale = Locale.getDefault();
if (locale.toString().equalsIgnoreCase("zh_hk")) {
locale = Locale.TRADITIONAL_CHINESE;
Locale.setDefault(locale);
}
GeckoApp app = GeckoApp.mAppContext;
String resourcePath = app.getApplication().getPackageResourcePath();
String[] pluginDirs = null;

View File

@ -763,13 +763,16 @@ if [ "$ENABLE_TESTS" ]; then
dom/imptests/editing/selecttest/Makefile
dom/imptests/failures/editing/conformancetest/Makefile
dom/imptests/failures/editing/selecttest/Makefile
dom/imptests/failures/html/tests/submission/Opera/microdata/Makefile
dom/imptests/failures/html/old-tests/submission/Opera/microdata/Makefile
dom/imptests/failures/webapps/DOMCore/tests/approved/Makefile
dom/imptests/failures/webapps/DOMCore/tests/submissions/Opera/Makefile
dom/imptests/failures/webapps/WebStorage/tests/submissions/Infraware/Makefile
dom/imptests/failures/webapps/WebStorage/tests/submissions/Ms2ger/Makefile
dom/imptests/html/tests/submission/Mozilla/Makefile
dom/imptests/html/tests/submission/Opera/microdata/Makefile
dom/imptests/html/html/semantics/scripting-1/the-script-element/Makefile
dom/imptests/html/html/webappapis/scripting/events/Makefile
dom/imptests/html/html/webappapis/scripting/processing-model-2/Makefile
dom/imptests/html/html/browsers/browsing-the-web/read-media/Makefile
dom/imptests/html/old-tests/submission/Opera/microdata/Makefile
dom/imptests/webapps/DOMCore/tests/approved/Makefile
dom/imptests/webapps/DOMCore/tests/submissions/Opera/Makefile
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/Makefile