diff --git a/content/html/content/src/HTMLSharedObjectElement.h b/content/html/content/src/HTMLSharedObjectElement.h index 3e88a9bd1f48..82724ec0c7bc 100644 --- a/content/html/content/src/HTMLSharedObjectElement.h +++ b/content/html/content/src/HTMLSharedObjectElement.h @@ -104,6 +104,114 @@ public: { return static_cast(this); } + + // WebIDL API for + void GetAlign(DOMString& aValue) + { + GetHTMLAttr(nsGkAtoms::align, aValue); + } + void SetAlign(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::align, aValue, aRv); + } + void GetAlt(DOMString& aValue) + { + GetHTMLAttr(nsGkAtoms::alt, aValue); + } + void SetAlt(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::alt, aValue, aRv); + } + void GetArchive(DOMString& aValue) + { + GetHTMLAttr(nsGkAtoms::archive, aValue); + } + void SetArchive(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::archive, aValue, aRv); + } + void GetCode(DOMString& aValue) + { + GetHTMLAttr(nsGkAtoms::code, aValue); + } + void SetCode(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::code, aValue, aRv); + } + // XPCOM GetCodebase is ok; note that it's a URI attribute + void SetCodeBase(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::codebase, aValue, aRv); + } + void GetHeight(DOMString& aValue) + { + GetHTMLAttr(nsGkAtoms::height, aValue); + } + void SetHeight(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::height, aValue, aRv); + } + uint32_t Hspace() + { + return GetHTMLUnsignedIntAttr(nsGkAtoms::hspace, 0); + } + void SetHspace(uint32_t aValue, ErrorResult& aRv) + { + SetHTMLUnsignedIntAttr(nsGkAtoms::hspace, aValue, aRv); + } + void GetName(DOMString& aValue) + { + GetHTMLAttr(nsGkAtoms::name, aValue); + } + void SetName(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::name, aValue, aRv); + } + // XPCOM GetObject is ok; note that it's a URI attribute with a weird base URI + void SetObject(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::object, aValue, aRv); + } + uint32_t Vspace() + { + return GetHTMLUnsignedIntAttr(nsGkAtoms::vspace, 0); + } + void SetVspace(uint32_t aValue, ErrorResult& aRv) + { + SetHTMLUnsignedIntAttr(nsGkAtoms::vspace, aValue, aRv); + } + void GetWidth(DOMString& aValue) + { + GetHTMLAttr(nsGkAtoms::width, aValue); + } + void SetWidth(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::width, aValue, aRv); + } + + // WebIDL api + // XPCOM GetSrc is ok; note that it's a URI attribute + void SetSrc(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::src, aValue, aRv); + } + void GetType(DOMString& aValue) + { + GetHTMLAttr(nsGkAtoms::type, aValue); + } + void SetType(const nsAString& aValue, ErrorResult& aRv) + { + SetHTMLAttr(nsGkAtoms::type, aValue, aRv); + } + // width covered by + // height covered by + // align covered by + // name covered by + nsIDocument* GetSVGDocument() + { + return GetContentDocument(); + } + private: /** * Calls LoadObject with the correct arguments to start the plugin load. diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 8d5a924d9efa..9d77d5e1af30 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -345,6 +345,10 @@ DOMInterfaces = { 'wrapperCache': False }, +'HTMLAppletElement': { + 'nativeType': 'mozilla::dom::HTMLSharedObjectElement' +}, + 'HTMLBaseElement': { 'nativeType': 'mozilla::dom::HTMLSharedElement' }, @@ -386,6 +390,10 @@ DOMInterfaces = { ] }, +'HTMLEmbedElement': { + 'nativeType': 'mozilla::dom::HTMLSharedObjectElement' +}, + 'HTMLHeadElement': { 'nativeType': 'mozilla::dom::HTMLSharedElement' }, diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index 8a001b42fa45..cea8a4228b4f 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -319,7 +319,7 @@ class IDLUnresolvedIdentifier(IDLObject): [location]) if name[0] == '_' and not allowDoubleUnderscore: name = name[1:] - if name in ["constructor", "toString"] and not allowForbidden: + if name in ["constructor", "iterator", "toString", "toJSON"] and not allowForbidden: raise WebIDLError("Cannot use reserved identifier '%s'" % (name), [location]) diff --git a/dom/webidl/HTMLAppletElement.webidl b/dom/webidl/HTMLAppletElement.webidl new file mode 100644 index 000000000000..d2805989583a --- /dev/null +++ b/dom/webidl/HTMLAppletElement.webidl @@ -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/. + * + * The origin of this IDL file is + * http://www.whatwg.org/specs/web-apps/current-work/#the-applet-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-applet-element +[NeedNewResolve] +interface HTMLAppletElement : HTMLElement { + [Pure, SetterThrows] + attribute DOMString align; + [Pure, SetterThrows] + attribute DOMString alt; + [Pure, SetterThrows] + attribute DOMString archive; + [Pure, SetterThrows] + attribute DOMString code; + [Pure, SetterThrows] + attribute DOMString codeBase; + [Pure, SetterThrows] + attribute DOMString height; + [Pure, SetterThrows] + attribute unsigned long hspace; + [Pure, SetterThrows] + attribute DOMString name; + [Pure, SetterThrows] + attribute DOMString _object; + [Pure, SetterThrows] + attribute unsigned long vspace; + [Pure, SetterThrows] + attribute DOMString width; +}; + +HTMLAppletElement implements MozImageLoadingContent; +HTMLAppletElement implements MozFrameLoaderOwner; +HTMLAppletElement implements MozObjectLoadingContent; diff --git a/dom/webidl/HTMLEmbedElement.webidl b/dom/webidl/HTMLEmbedElement.webidl new file mode 100644 index 000000000000..313b4fa201d3 --- /dev/null +++ b/dom/webidl/HTMLEmbedElement.webidl @@ -0,0 +1,45 @@ +/* -*- 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-embed-element + * http://www.whatwg.org/specs/web-apps/current-work/#HTMLEmbedElement-partial + * + * © 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-embed-element +[NeedNewResolve] +interface HTMLEmbedElement : HTMLElement { + [Pure, SetterThrows] + attribute DOMString src; + [Pure, SetterThrows] + attribute DOMString type; + [Pure, SetterThrows] + attribute DOMString width; + [Pure, SetterThrows] + attribute DOMString height; + [Throws] + legacycaller any (any... arguments); +}; + +// http://www.whatwg.org/specs/web-apps/current-work/#HTMLEmbedElement-partial +partial interface HTMLEmbedElement { + [Pure, SetterThrows] + attribute DOMString align; + [Pure, SetterThrows] + attribute DOMString name; +}; + +partial interface HTMLEmbedElement { + // nsIDOMGetSVGDocument + Document? getSVGDocument(); +}; + +HTMLEmbedElement implements MozImageLoadingContent; +HTMLEmbedElement implements MozFrameLoaderOwner; +HTMLEmbedElement implements MozObjectLoadingContent;