diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/WebIDL/valid | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/WebIDL/valid')
97 files changed, 3402 insertions, 0 deletions
diff --git a/testing/web-platform/tests/WebIDL/valid/idl/allowany.widl b/testing/web-platform/tests/WebIDL/valid/idl/allowany.widl new file mode 100644 index 000000000..2343bb963 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/allowany.widl @@ -0,0 +1,6 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface B { + void g(); + void g(B b); + void g([AllowAny] DOMString s); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/array.widl b/testing/web-platform/tests/WebIDL/valid/idl/array.widl new file mode 100644 index 000000000..22e21fb65 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/array.widl @@ -0,0 +1,5 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +[Constructor] +interface LotteryResults { + readonly attribute unsigned short[][] numbers; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/attributes.widl b/testing/web-platform/tests/WebIDL/valid/idl/attributes.widl new file mode 100644 index 000000000..7e1d691cb --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/attributes.widl @@ -0,0 +1,14 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +exception InvalidName { + DOMString reason; +}; + +exception NoSuchPet { }; + +interface Person { + + // A simple attribute that can be set to any value the range an unsigned + // short can take. + attribute unsigned short age; + +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/callback.widl b/testing/web-platform/tests/WebIDL/valid/idl/callback.widl new file mode 100644 index 000000000..d92f6a18c --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/callback.widl @@ -0,0 +1,5 @@ +callback AsyncOperationCallback = void (DOMString status); + +callback interface EventHandler { + void eventOccurred(DOMString details); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/caller.widl b/testing/web-platform/tests/WebIDL/valid/idl/caller.widl new file mode 100644 index 000000000..92acb1c01 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/caller.widl @@ -0,0 +1,5 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface NumberQuadrupler { + // This operation simply returns four times the given number x. + legacycaller float compute(float x); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/constants.widl b/testing/web-platform/tests/WebIDL/valid/idl/constants.widl new file mode 100644 index 000000000..5e28ae9c1 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/constants.widl @@ -0,0 +1,18 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Util { + const boolean DEBUG = false; + const short negative = -1; + const octet LF = 10; + const unsigned long BIT_MASK = 0x0000fc00; + const float AVOGADRO = 6.022e23; + const unrestricted float sobig = Infinity; + const unrestricted double minusonedividedbyzero = -Infinity; + const short notanumber = NaN; +}; + +exception Error { + const short ERR_UNKNOWN = 0; + const short ERR_OUT_OF_MEMORY = 1; + + short errorCode; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/constructor.widl b/testing/web-platform/tests/WebIDL/valid/idl/constructor.widl new file mode 100644 index 000000000..f93ec08a6 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/constructor.widl @@ -0,0 +1,9 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +[Constructor, + Constructor(float radius)] +interface Circle { + attribute float r; + attribute float cx; + attribute float cy; + readonly attribute float circumference; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/dictionary-inherits.widl b/testing/web-platform/tests/WebIDL/valid/idl/dictionary-inherits.widl new file mode 100644 index 000000000..48f8a0fdc --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/dictionary-inherits.widl @@ -0,0 +1,9 @@ +dictionary PaintOptions { + DOMString? fillPattern = "black"; + DOMString? strokePattern = null; + Point position; +}; + +dictionary WetPaintOptions : PaintOptions { + float hydrometry; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/dictionary.widl b/testing/web-platform/tests/WebIDL/valid/idl/dictionary.widl new file mode 100644 index 000000000..f46b7ba78 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/dictionary.widl @@ -0,0 +1,11 @@ +// Extracted from Web IDL editors draft May 31 2011 +dictionary PaintOptions { + DOMString? fillPattern = "black"; + DOMString? strokePattern = null; + Point position; +}; + +partial dictionary A { + long h; + long d; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/documentation-dos.widl b/testing/web-platform/tests/WebIDL/valid/idl/documentation-dos.widl new file mode 100644 index 000000000..fb801101f --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/documentation-dos.widl @@ -0,0 +1,33 @@ +/**
+* \brief Testing documentation features
+*
+* This is a
+* single paragraph
+*
+* <p>This is valid.</p>
+* <p>This is <em>valid</em>.</p>
+* <p>This is <b>valid</b>.</p>
+* <p>This is <a href=''>valid</a>.</p>
+* <ul>
+* <li>This</li>
+* <li>is</li>
+* <li>valid</li>
+* </ul>
+* <dl>
+* <dt>This</dt>
+* <dd>valid</dd>
+* </dl>
+* <table>
+* <tr>
+* <td>this</td>
+* <td>is</td>
+* </tr>
+* <tr>
+* <td>valid</td>
+* </tr>
+* </table>
+* <p>This is <br> valid.</p>
+* <p>This is <br /> valid.</p>
+* <p>This is <br/> valid.</p>
+*/
+interface Documentation {};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/documentation.widl b/testing/web-platform/tests/WebIDL/valid/idl/documentation.widl new file mode 100644 index 000000000..003e9226f --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/documentation.widl @@ -0,0 +1,34 @@ +/** +* \brief Testing documentation features +* +* This is a +* single paragraph +* +* <p>This is valid.</p> +* <p>This is <em>valid</em>.</p> +* <p>This is <b>valid</b>.</p> +* <p>This is <a href=''>valid</a>.</p> +* <ul> +* <li>This</li> +* <li>is</li> +* <li>valid</li> +* </ul> +* <dl> +* <dt>This</dt> +* <dd>valid</dd> +* </dl> +* <table> +* <tr> +* <td>this</td> +* <td>is</td> +* </tr> +* <tr> +* <td>valid</td> +* </tr> +* </table> +* <p>This is <br> valid.</p> +* <p>This is <br /> valid.</p> +* <p>This is <br/> valid.</p> +* <p><img src="foo.png" alt="Valid"/></p> +*/ +interface Documentation {};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/enum.widl b/testing/web-platform/tests/WebIDL/valid/idl/enum.widl new file mode 100644 index 000000000..851fca2e6 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/enum.widl @@ -0,0 +1,8 @@ +enum MealType { "rice", "noodles", "other" }; + +interface Meal { + attribute MealType type; + attribute float size; // in grams + + void initialize(MealType type, float size); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/equivalent-decl.widl b/testing/web-platform/tests/WebIDL/valid/idl/equivalent-decl.widl new file mode 100644 index 000000000..6b3e0eda2 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/equivalent-decl.widl @@ -0,0 +1,18 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Dictionary { + readonly attribute unsigned long propertyCount; + + getter float getProperty(DOMString propertyName); + setter void setProperty(DOMString propertyName, float propertyValue); +}; + + +interface Dictionary { + readonly attribute unsigned long propertyCount; + + float getProperty(DOMString propertyName); + void setProperty(DOMString propertyName, float propertyValue); + + getter float (DOMString propertyName); + setter void (DOMString propertyName, float propertyValue); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/exception-inheritance.widl b/testing/web-platform/tests/WebIDL/valid/idl/exception-inheritance.widl new file mode 100644 index 000000000..258fdeba6 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/exception-inheritance.widl @@ -0,0 +1,7 @@ +// from http://lists.w3.org/Archives/Public/public-script-coord/2010OctDec/0112.html + exception DOMException { + unsigned short code; + }; + + exception HierarchyRequestError : DOMException { }; + exception NoModificationAllowedError : DOMException { };
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/exception.widl b/testing/web-platform/tests/WebIDL/valid/idl/exception.widl new file mode 100644 index 000000000..f4b6ae29e --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/exception.widl @@ -0,0 +1,8 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Dahut { + attribute DOMString type; +}; + +exception SomeException { +}; + diff --git a/testing/web-platform/tests/WebIDL/valid/idl/getter-setter.widl b/testing/web-platform/tests/WebIDL/valid/idl/getter-setter.widl new file mode 100644 index 000000000..bdf87e1c7 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/getter-setter.widl @@ -0,0 +1,7 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Dictionary { + readonly attribute unsigned long propertyCount; + + getter float (DOMString propertyName); + setter void (DOMString propertyName, float propertyValue); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/identifier-qualified-names.widl b/testing/web-platform/tests/WebIDL/valid/idl/identifier-qualified-names.widl new file mode 100644 index 000000000..33893d4c6 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/identifier-qualified-names.widl @@ -0,0 +1,44 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 + // Typedef identifier: "number" + // Qualified name: "::framework::number" + typedef float number; + + // Exception identifier: "FrameworkException" + // Qualified name: "::framework::FrameworkException" + exception FrameworkException { + + // Constant identifier: "ERR_NOT_FOUND" + // Qualified name: "::framework::FrameworkException::ERR_NOT_FOUND" + const long ERR_NOT_FOUND = 1; + + // Exception field identifier: "code" + long code; + }; + + // Interface identifier: "System" + // Qualified name: "::framework::System" + interface System { + + // Operation identifier: "createObject" + // Operation argument identifier: "interface" + object createObject(DOMString _interface); + + // Operation has no identifier; it declares a getter. + getter DOMString (DOMString keyName); + }; + + + // Interface identifier: "TextField" + // Qualified name: "::framework::gui::TextField" + interface TextField { + + // Attribute identifier: "const" + attribute boolean _const; + + // Attribute identifier: "value" + attribute DOMString? _value; + }; + +interface Foo { + void op(object interface); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/implements.widl b/testing/web-platform/tests/WebIDL/valid/idl/implements.widl new file mode 100644 index 000000000..7a310926f --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/implements.widl @@ -0,0 +1,14 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 + interface Node { + readonly attribute unsigned short nodeType; + // ... + }; + + interface EventTarget { + void addEventListener(DOMString type, + EventListener listener, + boolean useCapture); + // ... + }; + + Node implements EventTarget; diff --git a/testing/web-platform/tests/WebIDL/valid/idl/indexed-properties.widl b/testing/web-platform/tests/WebIDL/valid/idl/indexed-properties.widl new file mode 100644 index 000000000..acf0ed3bf --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/indexed-properties.widl @@ -0,0 +1,12 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface OrderedMap { + readonly attribute unsigned long size; + + getter any getByIndex(unsigned long index); + setter void setByIndex(unsigned long index, any value); + deleter void removeByIndex(unsigned long index); + + getter any get(DOMString name); + setter creator void set(DOMString name, any value); + deleter void remove(DOMString name); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/inherits-getter.widl b/testing/web-platform/tests/WebIDL/valid/idl/inherits-getter.widl new file mode 100644 index 000000000..558e81164 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/inherits-getter.widl @@ -0,0 +1,16 @@ +interface Animal { + + // A simple attribute that can be set to any string value. + readonly attribute DOMString name; +}; + +interface Person : Animal { + + // An attribute whose value cannot be assigned to. + readonly attribute unsigned short age; + + // An attribute that can raise an exception if it is set to an invalid value. + // Its getter behavior is inherited from Animal, and need not be specified + // the description of Person. + inherit attribute DOMString name; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/interface-inherits.widl b/testing/web-platform/tests/WebIDL/valid/idl/interface-inherits.widl new file mode 100644 index 000000000..7921def77 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/interface-inherits.widl @@ -0,0 +1,12 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Animal { + attribute DOMString name; +}; + +interface Human : Animal { + attribute Dog pet; +}; + +interface Dog : Animal { + attribute Human owner; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/iterator.widl b/testing/web-platform/tests/WebIDL/valid/idl/iterator.widl new file mode 100644 index 000000000..3bf1b36de --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/iterator.widl @@ -0,0 +1,35 @@ +interface SessionManager { + Session getSessionForUser(DOMString username); + readonly attribute unsigned long sessionCount; + + Session iterator; +}; + +interface Session { + readonly attribute DOMString username; + // ... +}; + +interface SessionManager2 { + Session2 getSessionForUser(DOMString username); + readonly attribute unsigned long sessionCount; + + Session2 iterator = SessionIterator; +}; + +interface Session2 { + readonly attribute DOMString username; + // ... +}; + +interface SessionIterator { + readonly attribute unsigned long remainingSessions; +}; + + interface NodeList { + Node iterator = NodeIterator; + }; + + interface NodeIterator { + Node iterator object; + };
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/namedconstructor.widl b/testing/web-platform/tests/WebIDL/valid/idl/namedconstructor.widl new file mode 100644 index 000000000..c468b78f8 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/namedconstructor.widl @@ -0,0 +1,6 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +[NamedConstructor=Audio, + NamedConstructor=Audio(DOMString src)] +interface HTMLAudioElement : HTMLMediaElement { + // ... +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/nointerfaceobject.widl b/testing/web-platform/tests/WebIDL/valid/idl/nointerfaceobject.widl new file mode 100644 index 000000000..c17d75ff8 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/nointerfaceobject.widl @@ -0,0 +1,5 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +[NoInterfaceObject] +interface Query { + any lookupEntry(unsigned long key); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/nullable.widl b/testing/web-platform/tests/WebIDL/valid/idl/nullable.widl new file mode 100644 index 000000000..ccbf625ff --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/nullable.widl @@ -0,0 +1,9 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface MyConstants { + const boolean? ARE_WE_THERE_YET = false; +}; + +interface Node { + readonly attribute DOMString? namespaceURI; + // ... +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/nullableobjects.widl b/testing/web-platform/tests/WebIDL/valid/idl/nullableobjects.widl new file mode 100644 index 000000000..83d1d40b2 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/nullableobjects.widl @@ -0,0 +1,13 @@ +// Extracted from WebIDL spec 2011-05-23 + +interface A { + // ... +}; +interface B { + // ... +}; +interface C { + void f(A? x); + void f(B? x); + +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/operation-optional-arg.widl b/testing/web-platform/tests/WebIDL/valid/idl/operation-optional-arg.widl new file mode 100644 index 000000000..379053b45 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/operation-optional-arg.widl @@ -0,0 +1,4 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface ColorCreator { + object createColor(float v1, float v2, float v3, optional float alpha = 3.5); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/overloading.widl b/testing/web-platform/tests/WebIDL/valid/idl/overloading.widl new file mode 100644 index 000000000..ef1288a88 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/overloading.widl @@ -0,0 +1,20 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface A { + // ... +}; + +interface B { + // ... +}; + +interface C { + void f(A x); + void f(B x); +}; + +interface A { + /* f1 */ void f(DOMString a); + /* f2 */ void f([AllowAny] DOMString a, DOMString b, float... c); + /* f3 */ void f(); + /* f4 */ void f(long a, DOMString b, optional DOMString c, float... d); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/overridebuiltins.widl b/testing/web-platform/tests/WebIDL/valid/idl/overridebuiltins.widl new file mode 100644 index 000000000..79211c29e --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/overridebuiltins.widl @@ -0,0 +1,6 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +[OverrideBuiltins] +interface StringMap2 { + readonly attribute unsigned long length; + getter DOMString lookup(DOMString key); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/partial-interface.widl b/testing/web-platform/tests/WebIDL/valid/idl/partial-interface.widl new file mode 100644 index 000000000..90e7e0ea4 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/partial-interface.widl @@ -0,0 +1,7 @@ +interface Foo { + attribute DOMString bar; +}; + +partial interface Foo { + attribute DOMString quux; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/primitives.widl b/testing/web-platform/tests/WebIDL/valid/idl/primitives.widl new file mode 100644 index 000000000..92939601a --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/primitives.widl @@ -0,0 +1,19 @@ +interface Primitives { + attribute boolean truth; + attribute byte character; + attribute octet value; + attribute short number; + attribute unsigned short positive; + attribute long big; + attribute unsigned long bigpositive; + attribute long long bigbig; + attribute unsigned long long bigbigpositive; + attribute float real; + attribute double bigreal; + attribute unrestricted float realwithinfinity; + attribute unrestricted double bigrealwithinfinity; + attribute DOMString string; + attribute ByteString bytes; + attribute Date date; + attribute RegExp regexp; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/prototyperoot.widl b/testing/web-platform/tests/WebIDL/valid/idl/prototyperoot.widl new file mode 100644 index 000000000..30dd5cbca --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/prototyperoot.widl @@ -0,0 +1,5 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +[PrototypeRoot] +interface Node { + readonly attribute unsigned short nodeType; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/putforwards.widl b/testing/web-platform/tests/WebIDL/valid/idl/putforwards.widl new file mode 100644 index 000000000..1e50a4ee3 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/putforwards.widl @@ -0,0 +1,5 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Person { + [PutForwards=full] readonly attribute Name name; + attribute unsigned short age; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/reg-operations.widl b/testing/web-platform/tests/WebIDL/valid/idl/reg-operations.widl new file mode 100644 index 000000000..13997cb1d --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/reg-operations.widl @@ -0,0 +1,17 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Dimensions { + attribute unsigned long width; + attribute unsigned long height; +}; + +exception NoPointerDevice { }; + +interface Button { + + // An operation that takes no arguments, returns a boolean + boolean isMouseOver(); + + // Overloaded operations. + void setDimensions(Dimensions size); + void setDimensions(unsigned long width, unsigned long height); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/replaceable.widl b/testing/web-platform/tests/WebIDL/valid/idl/replaceable.widl new file mode 100644 index 000000000..c14d0c376 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/replaceable.widl @@ -0,0 +1,5 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Counter { + [Replaceable] readonly attribute unsigned long value; + void increment(); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/sequence.widl b/testing/web-platform/tests/WebIDL/valid/idl/sequence.widl new file mode 100644 index 000000000..a1aa931f5 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/sequence.widl @@ -0,0 +1,7 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +// edited to remove sequence as attributes, now invalid +interface Canvas { + void drawPolygon(sequence<float> coordinates); + sequence<float> getInflectionPoints(); + // ... +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/serializer.widl b/testing/web-platform/tests/WebIDL/valid/idl/serializer.widl new file mode 100644 index 000000000..6f6ccd0e8 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/serializer.widl @@ -0,0 +1,64 @@ +interface Transaction { + readonly attribute Account from; + readonly attribute Account to; + readonly attribute float amount; + readonly attribute DOMString description; + readonly attribute unsigned long number; + + serializer; +}; + +interface Account { + attribute DOMString name; + attribute unsigned long number; + serializer DOMString serialize(); +}; + +interface Transaction2 { + readonly attribute Account2 from; + readonly attribute Account2 to; + readonly attribute float amount; + readonly attribute DOMString description; + readonly attribute unsigned long number; + + serializer = { from, to, amount, description }; +}; + +interface Account2 { + attribute DOMString name; + attribute unsigned long number; + serializer = number; +}; + +interface Account3 { + attribute DOMString name; + attribute unsigned long number; + + serializer = { attribute }; +}; + +interface Account4 { + getter object getItem(unsigned long index); + serializer = { getter }; +}; + +interface Account5 : Account { + attribute DOMString secondname; + serializer = { inherit, secondname }; +}; + +interface Account6 : Account { + attribute DOMString secondname; + serializer = { inherit, attribute }; +}; + +interface Account7 { + attribute DOMString name; + attribute unsigned long number; + serializer = [ name, number ]; +}; + +interface Account8 { + getter object getItem(unsigned long index); + serializer = [ getter ]; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/static.widl b/testing/web-platform/tests/WebIDL/valid/idl/static.widl new file mode 100644 index 000000000..5b2cd3659 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/static.widl @@ -0,0 +1,11 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Point { /* ... */ }; + +interface Circle { + attribute float cx; + attribute float cy; + attribute float radius; + + static readonly attribute long triangulationCount; + static Point triangulate(Circle c1, Circle c2, Circle c3); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/stringifier-attribute.widl b/testing/web-platform/tests/WebIDL/valid/idl/stringifier-attribute.widl new file mode 100644 index 000000000..c964ecb93 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/stringifier-attribute.widl @@ -0,0 +1,6 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +[Constructor] +interface Student { + attribute unsigned long id; + stringifier attribute DOMString name; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/stringifier-custom.widl b/testing/web-platform/tests/WebIDL/valid/idl/stringifier-custom.widl new file mode 100644 index 000000000..b5d7c87e7 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/stringifier-custom.widl @@ -0,0 +1,9 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +[Constructor] +interface Student { + attribute unsigned long id; + attribute DOMString? familyName; + attribute DOMString givenName; + + stringifier DOMString (); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/stringifier.widl b/testing/web-platform/tests/WebIDL/valid/idl/stringifier.widl new file mode 100644 index 000000000..4eb483d9b --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/stringifier.widl @@ -0,0 +1,8 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface A { + stringifier DOMString (); +}; + +interface A { + stringifier; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/treatasnull.widl b/testing/web-platform/tests/WebIDL/valid/idl/treatasnull.widl new file mode 100644 index 000000000..d3c55b008 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/treatasnull.widl @@ -0,0 +1,7 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Dog { + attribute DOMString name; + attribute DOMString owner; + + boolean isMemberOfBreed([TreatNullAs=EmptyString] DOMString breedName); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/treatasundefined.widl b/testing/web-platform/tests/WebIDL/valid/idl/treatasundefined.widl new file mode 100644 index 000000000..e30050f84 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/treatasundefined.widl @@ -0,0 +1,7 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface Cat { + attribute DOMString name; + attribute DOMString owner; + + boolean isMemberOfBreed([TreatUndefinedAs=EmptyString] DOMString breedName); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/typedef.widl b/testing/web-platform/tests/WebIDL/valid/idl/typedef.widl new file mode 100644 index 000000000..b4c17d8d3 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/typedef.widl @@ -0,0 +1,22 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 + interface Point { + attribute float x; + attribute float y; + }; + + typedef sequence<Point> PointSequence; + + interface Rect { + attribute Point topleft; + attribute Point bottomright; + }; + + interface Widget { + + readonly attribute Rect bounds; + + boolean pointWithinBounds(Point p); + boolean allPointsWithinBounds(PointSequence ps); + }; + + typedef [Clamp] octet value;
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/typesuffixes.widl b/testing/web-platform/tests/WebIDL/valid/idl/typesuffixes.widl new file mode 100644 index 000000000..95e31c169 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/typesuffixes.widl @@ -0,0 +1,3 @@ +interface Suffixes { + void test(sequence<DOMString[]?>? foo); +}; diff --git a/testing/web-platform/tests/WebIDL/valid/idl/uniontype.widl b/testing/web-platform/tests/WebIDL/valid/idl/uniontype.widl new file mode 100644 index 000000000..4d99f0196 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/uniontype.widl @@ -0,0 +1,3 @@ +interface Union { + attribute (float or (Date or Event) or (Node or DOMString)?) test; +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/idl/variadic-operations.widl b/testing/web-platform/tests/WebIDL/valid/idl/variadic-operations.widl new file mode 100644 index 000000000..51fae4cc1 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/idl/variadic-operations.widl @@ -0,0 +1,7 @@ +// Extracted from http://dev.w3.org/2006/webapi/WebIDL/ on 2011-05-06 +interface IntegerSet { + readonly attribute unsigned long cardinality; + + void union(long... ints); + void intersection(long... ints); +};
\ No newline at end of file diff --git a/testing/web-platform/tests/WebIDL/valid/xml/allowany.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/allowany.widlprocxml new file mode 100644 index 000000000..7da508bcb --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/allowany.widlprocxml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface B { + void g(); + void g(<ref>B</ref> b); + void g([AllowAny] DOMString s); +};</webidl> + <Interface name="B" id="::B"> + <webidl>interface B { + void g(); + void g(<ref>B</ref> b); + void g([AllowAny] DOMString s); +};</webidl> + <Operation name="g" id="::B::g"> + <webidl> void g();</webidl> + <Type type="void"/> + <ArgumentList/> + </Operation> + <Operation name="g" id="::B::g"> + <webidl> void g(<ref>B</ref> b);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="b"> + <Type name="B"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="g" id="::B::g"> + <webidl> void g([AllowAny] DOMString s);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="s"> + <ExtendedAttributeList> + <ExtendedAttribute name="AllowAny"> + <webidl>AllowAny</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/array.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/array.widlprocxml new file mode 100644 index 000000000..3df72ff16 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/array.widlprocxml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>[Constructor] +interface LotteryResults { + readonly attribute unsigned short[][] numbers; +};</webidl> + <Interface name="LotteryResults" id="::LotteryResults"> + <webidl>[Constructor] +interface LotteryResults { + readonly attribute unsigned short[][] numbers; +};</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="Constructor"> + <webidl>Constructor</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Attribute readonly="readonly" name="numbers" id="::LotteryResults::numbers"> + <webidl> readonly attribute unsigned short[][] numbers;</webidl> + <Type type="array"> + <Type type="array"> + <Type type="unsigned short"/> + </Type> + </Type> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/attributes.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/attributes.widlprocxml new file mode 100644 index 000000000..89bd8ac9b --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/attributes.widlprocxml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>exception InvalidName { + DOMString reason; +}; + +exception NoSuchPet { }; + +interface Person { + + attribute unsigned short age; + +};</webidl> + <Exception name="InvalidName" id="::InvalidName"> + <webidl>exception InvalidName { + DOMString reason; +};</webidl> + <ExceptionField name="reason" id="::InvalidName::reason"> + <webidl> DOMString reason;</webidl> + <Type type="DOMString"/> + </ExceptionField> + </Exception> + <Exception name="NoSuchPet" id="::NoSuchPet"> + <webidl>exception NoSuchPet { };</webidl> + </Exception> + <Interface name="Person" id="::Person"> + <webidl>interface Person { + + attribute unsigned short age; + +};</webidl> + <Attribute name="age" id="::Person::age"> + <webidl> attribute unsigned short age;</webidl> + <Type type="unsigned short"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/callback.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/callback.widlprocxml new file mode 100644 index 000000000..9eac06ce2 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/callback.widlprocxml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>callback AsyncOperationCallback = void (DOMString status); + +callback interface EventHandler { + void eventOccurred(DOMString details); +};</webidl> + <Callback name="AsyncOperationCallback" id="::AsyncOperationCallback"> + <webidl>callback AsyncOperationCallback = void (DOMString status);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="status"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Callback> + <Interface name="EventHandler" callback="callback" id="::EventHandler"> + <webidl>callback interface EventHandler { + void eventOccurred(DOMString details); +};</webidl> + <Operation name="eventOccurred" id="::EventHandler::eventOccurred"> + <webidl> void eventOccurred(DOMString details);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="details"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/caller.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/caller.widlprocxml new file mode 100644 index 000000000..9754d4e02 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/caller.widlprocxml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface NumberQuadrupler { + legacycaller float compute(float x); +};</webidl> + <Interface name="NumberQuadrupler" id="::NumberQuadrupler"> + <webidl>interface NumberQuadrupler { + legacycaller float compute(float x); +};</webidl> + <Operation legacycaller="legacycaller" name="compute" id="::NumberQuadrupler::compute"> + <webidl> legacycaller float compute(float x);</webidl> + <Type type="float"/> + <ArgumentList> + <Argument name="x"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/constants.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/constants.widlprocxml new file mode 100644 index 000000000..51cb4331f --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/constants.widlprocxml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Util { + const boolean DEBUG = false; + const short negative = -1; + const octet LF = 10; + const unsigned long BIT_MASK = 0x0000fc00; + const float AVOGADRO = 6.022e23; + const unrestricted float sobig = Infinity; + const unrestricted double minusonedividedbyzero = -Infinity; + const short notanumber = NaN; +}; + +exception Error { + const short ERR_UNKNOWN = 0; + const short ERR_OUT_OF_MEMORY = 1; + + short errorCode; +};</webidl> + <Interface name="Util" id="::Util"> + <webidl>interface Util { + const boolean DEBUG = false; + const short negative = -1; + const octet LF = 10; + const unsigned long BIT_MASK = 0x0000fc00; + const float AVOGADRO = 6.022e23; + const unrestricted float sobig = Infinity; + const unrestricted double minusonedividedbyzero = -Infinity; + const short notanumber = NaN; +};</webidl> + <Const name="DEBUG" value="false" id="::Util::DEBUG"> + <webidl> const boolean DEBUG = false;</webidl> + <Type type="boolean"/> + </Const> + <Const name="negative" value="-1" id="::Util::negative"> + <webidl> const short negative = -1;</webidl> + <Type type="short"/> + </Const> + <Const name="LF" value="10" id="::Util::LF"> + <webidl> const octet LF = 10;</webidl> + <Type type="octet"/> + </Const> + <Const name="BIT_MASK" value="0x0000fc00" id="::Util::BIT_MASK"> + <webidl> const unsigned long BIT_MASK = 0x0000fc00;</webidl> + <Type type="unsigned long"/> + </Const> + <Const name="AVOGADRO" value="6.022e23" id="::Util::AVOGADRO"> + <webidl> const float AVOGADRO = 6.022e23;</webidl> + <Type type="float"/> + </Const> + <Const name="sobig" value="Infinity" id="::Util::sobig"> + <webidl> const unrestricted float sobig = Infinity;</webidl> + <Type type="unrestricted float"/> + </Const> + <Const name="minusonedividedbyzero" value="-Infinity" id="::Util::minusonedividedbyzero"> + <webidl> const unrestricted double minusonedividedbyzero = -Infinity;</webidl> + <Type type="unrestricted double"/> + </Const> + <Const name="notanumber" value="NaN" id="::Util::notanumber"> + <webidl> const short notanumber = NaN;</webidl> + <Type type="short"/> + </Const> + </Interface> + <Exception name="Error" id="::Error"> + <webidl>exception Error { + const short ERR_UNKNOWN = 0; + const short ERR_OUT_OF_MEMORY = 1; + + short errorCode; +};</webidl> + <Const name="ERR_UNKNOWN" value="0" id="::Error::ERR_UNKNOWN"> + <webidl> const short ERR_UNKNOWN = 0;</webidl> + <Type type="short"/> + </Const> + <Const name="ERR_OUT_OF_MEMORY" value="1" id="::Error::ERR_OUT_OF_MEMORY"> + <webidl> const short ERR_OUT_OF_MEMORY = 1;</webidl> + <Type type="short"/> + </Const> + <ExceptionField name="errorCode" id="::Error::errorCode"> + <webidl> short errorCode;</webidl> + <Type type="short"/> + </ExceptionField> + </Exception> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/constructor.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/constructor.widlprocxml new file mode 100644 index 000000000..8e78fbab3 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/constructor.widlprocxml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>[Constructor, + Constructor(float radius)] +interface Circle { + attribute float r; + attribute float cx; + attribute float cy; + readonly attribute float circumference; +};</webidl> + <Interface name="Circle" id="::Circle"> + <webidl>[Constructor, + Constructor(float radius)] +interface Circle { + attribute float r; + attribute float cx; + attribute float cy; + readonly attribute float circumference; +};</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="Constructor"> + <webidl>Constructor</webidl> + </ExtendedAttribute> + <ExtendedAttribute name="Constructor"> + <webidl> Constructor(float radius)</webidl> + <ArgumentList> + <Argument name="radius"> + <Type type="float"/> + </Argument> + </ArgumentList> + </ExtendedAttribute> + </ExtendedAttributeList> + <Attribute name="r" id="::Circle::r"> + <webidl> attribute float r;</webidl> + <Type type="float"/> + </Attribute> + <Attribute name="cx" id="::Circle::cx"> + <webidl> attribute float cx;</webidl> + <Type type="float"/> + </Attribute> + <Attribute name="cy" id="::Circle::cy"> + <webidl> attribute float cy;</webidl> + <Type type="float"/> + </Attribute> + <Attribute readonly="readonly" name="circumference" id="::Circle::circumference"> + <webidl> readonly attribute float circumference;</webidl> + <Type type="float"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/dictionary-inherits.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/dictionary-inherits.widlprocxml new file mode 100644 index 000000000..269a83cd8 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/dictionary-inherits.widlprocxml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>dictionary PaintOptions { + DOMString? fillPattern = "black"; + DOMString? strokePattern = null; + <ref>Point</ref> position; +}; + +dictionary WetPaintOptions : <ref>PaintOptions</ref> { + float hydrometry; +};</webidl> + <Dictionary name="PaintOptions" id="::PaintOptions"> + <webidl>dictionary PaintOptions { + DOMString? fillPattern = "black"; + DOMString? strokePattern = null; + <ref>Point</ref> position; +};</webidl> + <DictionaryMember name="fillPattern" stringvalue="black" id="::PaintOptions::fillPattern"> + <webidl> DOMString? fillPattern = "black";</webidl> + <Type type="DOMString" nullable="nullable"/> + </DictionaryMember> + <DictionaryMember name="strokePattern" value="null" id="::PaintOptions::strokePattern"> + <webidl> DOMString? strokePattern = null;</webidl> + <Type type="DOMString" nullable="nullable"/> + </DictionaryMember> + <DictionaryMember name="position" id="::PaintOptions::position"> + <webidl> <ref>Point</ref> position;</webidl> + <Type name="Point"/> + </DictionaryMember> + </Dictionary> + <Dictionary name="WetPaintOptions" id="::WetPaintOptions"> + <webidl>dictionary WetPaintOptions : <ref>PaintOptions</ref> { + float hydrometry; +};</webidl> + <DictionaryInheritance> + <Name name="PaintOptions"/> + </DictionaryInheritance> + <DictionaryMember name="hydrometry" id="::WetPaintOptions::hydrometry"> + <webidl> float hydrometry;</webidl> + <Type type="float"/> + </DictionaryMember> + </Dictionary> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/dictionary.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/dictionary.widlprocxml new file mode 100644 index 000000000..978ccb4e2 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/dictionary.widlprocxml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>dictionary PaintOptions { + DOMString? fillPattern = "black"; + DOMString? strokePattern = null; + <ref>Point</ref> position; +}; + +partial dictionary A { + long h; + long d; +};</webidl> + <Dictionary name="PaintOptions" id="::PaintOptions"> + <webidl>dictionary PaintOptions { + DOMString? fillPattern = "black"; + DOMString? strokePattern = null; + <ref>Point</ref> position; +};</webidl> + <DictionaryMember name="fillPattern" stringvalue="black" id="::PaintOptions::fillPattern"> + <webidl> DOMString? fillPattern = "black";</webidl> + <Type type="DOMString" nullable="nullable"/> + </DictionaryMember> + <DictionaryMember name="strokePattern" value="null" id="::PaintOptions::strokePattern"> + <webidl> DOMString? strokePattern = null;</webidl> + <Type type="DOMString" nullable="nullable"/> + </DictionaryMember> + <DictionaryMember name="position" id="::PaintOptions::position"> + <webidl> <ref>Point</ref> position;</webidl> + <Type name="Point"/> + </DictionaryMember> + </Dictionary> + <Dictionary name="A" partial="partial" id="::A"> + <webidl>partial dictionary A { + long h; + long d; +};</webidl> + <DictionaryMember name="h" id="::A::h"> + <webidl> long h;</webidl> + <Type type="long"/> + </DictionaryMember> + <DictionaryMember name="d" id="::A::d"> + <webidl> long d;</webidl> + <Type type="long"/> + </DictionaryMember> + </Dictionary> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/documentation-dos.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/documentation-dos.widlprocxml new file mode 100644 index 000000000..1611f0e57 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/documentation-dos.widlprocxml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Documentation {};</webidl> + <Interface name="Documentation" id="::Documentation"> + <webidl>interface Documentation {};</webidl> + <descriptive> + <brief> + Testing documentation features + </brief> + <description> + <p> +This is a +single paragraph + </p> + <p> +This is valid. </p> + <p> +This is <em>valid</em>. </p> + <p> +This is <b>valid</b>. </p> + <p> +This is <a href=''>valid</a>. </p> + <ul> + <li> +This </li> + <li> +is </li> + <li> +valid </li> + </ul> + <dl> + <dt> +This </dt> + <dd> +valid </dd> + </dl> + <table> + <tr> + <td> +this </td> + <td> +is </td> + </tr> + <tr> + <td> +valid </td> + </tr> + </table> + <p> +This is <br/> valid. </p> + <p> +This is <br /> valid. </p> + <p> +This is <br/> valid. </p> + </description> + </descriptive> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/documentation.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/documentation.widlprocxml new file mode 100644 index 000000000..afe4527c2 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/documentation.widlprocxml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Documentation {};</webidl> + <Interface name="Documentation" id="::Documentation"> + <webidl>interface Documentation {};</webidl> + <descriptive> + <brief> + Testing documentation features + </brief> + <description> + <p> +This is a +single paragraph + </p> + <p> +This is valid. </p> + <p> +This is <em>valid</em>. </p> + <p> +This is <b>valid</b>. </p> + <p> +This is <a href=''>valid</a>. </p> + <ul> + <li> +This </li> + <li> +is </li> + <li> +valid </li> + </ul> + <dl> + <dt> +This </dt> + <dd> +valid </dd> + </dl> + <table> + <tr> + <td> +this </td> + <td> +is </td> + </tr> + <tr> + <td> +valid </td> + </tr> + </table> + <p> +This is <br/> valid. </p> + <p> +This is <br /> valid. </p> + <p> +This is <br/> valid. </p> + <p> +<img src="foo.png" alt="Valid"/> </p> + </description> + </descriptive> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/enum.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/enum.widlprocxml new file mode 100644 index 000000000..e1e8258fb --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/enum.widlprocxml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>enum MealType { "rice", "noodles", "other" }; + +interface Meal { + attribute <ref>MealType</ref> type; + attribute float size; + + void initialize(<ref>MealType</ref> type, float size); +};</webidl> + <Enum name="MealType" id="::MealType"> + <webidl>enum MealType { "rice", "noodles", "other" };</webidl> + <EnumValue stringvalue="rice"> + <webidl> "rice</webidl> + </EnumValue> + <EnumValue stringvalue="noodles"> + <webidl> "noodles</webidl> + </EnumValue> + <EnumValue stringvalue="other"> + <webidl> "other</webidl> + </EnumValue> + </Enum> + <Interface name="Meal" id="::Meal"> + <webidl>interface Meal { + attribute <ref>MealType</ref> type; + attribute float size; + + void initialize(<ref>MealType</ref> type, float size); +};</webidl> + <Attribute name="type" id="::Meal::type"> + <webidl> attribute <ref>MealType</ref> type;</webidl> + <Type name="MealType"/> + </Attribute> + <Attribute name="size" id="::Meal::size"> + <webidl> attribute float size;</webidl> + <Type type="float"/> + </Attribute> + <Operation name="initialize" id="::Meal::initialize"> + <webidl> void initialize(<ref>MealType</ref> type, float size);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="type"> + <Type name="MealType"/> + </Argument> + <Argument name="size"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/equivalent-decl.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/equivalent-decl.widlprocxml new file mode 100644 index 000000000..c322d0a5e --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/equivalent-decl.widlprocxml @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Dictionary { + readonly attribute unsigned long propertyCount; + + getter float getProperty(DOMString propertyName); + setter void setProperty(DOMString propertyName, float propertyValue); +}; + + +interface Dictionary { + readonly attribute unsigned long propertyCount; + + float getProperty(DOMString propertyName); + void setProperty(DOMString propertyName, float propertyValue); + + getter float (DOMString propertyName); + setter void (DOMString propertyName, float propertyValue); +};</webidl> + <Interface name="Dictionary" id="::Dictionary"> + <webidl>interface Dictionary { + readonly attribute unsigned long propertyCount; + + getter float getProperty(DOMString propertyName); + setter void setProperty(DOMString propertyName, float propertyValue); +};</webidl> + <Attribute readonly="readonly" name="propertyCount" id="::Dictionary::propertyCount"> + <webidl> readonly attribute unsigned long propertyCount;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Operation getter="getter" name="getProperty" id="::Dictionary::getProperty"> + <webidl> getter float getProperty(DOMString propertyName);</webidl> + <Type type="float"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Operation setter="setter" name="setProperty" id="::Dictionary::setProperty"> + <webidl> setter void setProperty(DOMString propertyName, float propertyValue);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + <Argument name="propertyValue"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> + <Interface name="Dictionary" id="::Dictionary"> + <webidl>interface Dictionary { + readonly attribute unsigned long propertyCount; + + float getProperty(DOMString propertyName); + void setProperty(DOMString propertyName, float propertyValue); + + getter float (DOMString propertyName); + setter void (DOMString propertyName, float propertyValue); +};</webidl> + <Attribute readonly="readonly" name="propertyCount" id="::Dictionary::propertyCount"> + <webidl> readonly attribute unsigned long propertyCount;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Operation name="getProperty" id="::Dictionary::getProperty"> + <webidl> float getProperty(DOMString propertyName);</webidl> + <Type type="float"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="setProperty" id="::Dictionary::setProperty"> + <webidl> void setProperty(DOMString propertyName, float propertyValue);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + <Argument name="propertyValue"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + <Operation getter="getter"> + <webidl> getter float (DOMString propertyName);</webidl> + <Type type="float"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Operation setter="setter"> + <webidl> setter void (DOMString propertyName, float propertyValue);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + <Argument name="propertyValue"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/exception-inheritance.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/exception-inheritance.widlprocxml new file mode 100644 index 000000000..3a1f868a4 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/exception-inheritance.widlprocxml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl> exception DOMException { + unsigned short code; + }; + + exception HierarchyRequestError : <ref>DOMException</ref> { }; + exception NoModificationAllowedError : <ref>DOMException</ref> { };</webidl> + <Exception name="DOMException" id="::DOMException"> + <webidl> exception DOMException { + unsigned short code; + };</webidl> + <ExceptionField name="code" id="::DOMException::code"> + <webidl> unsigned short code;</webidl> + <Type type="unsigned short"/> + </ExceptionField> + </Exception> + <Exception name="HierarchyRequestError" id="::HierarchyRequestError"> + <webidl> exception HierarchyRequestError : <ref>DOMException</ref> { };</webidl> + <ExceptionInheritance> + <Name name="DOMException"/> + </ExceptionInheritance> + </Exception> + <Exception name="NoModificationAllowedError" id="::NoModificationAllowedError"> + <webidl> exception NoModificationAllowedError : <ref>DOMException</ref> { };</webidl> + <ExceptionInheritance> + <Name name="DOMException"/> + </ExceptionInheritance> + </Exception> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/exception.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/exception.widlprocxml new file mode 100644 index 000000000..ac93320fe --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/exception.widlprocxml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Dahut { + attribute DOMString type; +}; + +exception SomeException { +};</webidl> + <Interface name="Dahut" id="::Dahut"> + <webidl>interface Dahut { + attribute DOMString type; +};</webidl> + <Attribute name="type" id="::Dahut::type"> + <webidl> attribute DOMString type;</webidl> + <Type type="DOMString"/> + </Attribute> + </Interface> + <Exception name="SomeException" id="::SomeException"> + <webidl>exception SomeException { +};</webidl> + </Exception> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/getter-setter.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/getter-setter.widlprocxml new file mode 100644 index 000000000..76afc058c --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/getter-setter.widlprocxml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Dictionary { + readonly attribute unsigned long propertyCount; + + getter float (DOMString propertyName); + setter void (DOMString propertyName, float propertyValue); +};</webidl> + <Interface name="Dictionary" id="::Dictionary"> + <webidl>interface Dictionary { + readonly attribute unsigned long propertyCount; + + getter float (DOMString propertyName); + setter void (DOMString propertyName, float propertyValue); +};</webidl> + <Attribute readonly="readonly" name="propertyCount" id="::Dictionary::propertyCount"> + <webidl> readonly attribute unsigned long propertyCount;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Operation getter="getter"> + <webidl> getter float (DOMString propertyName);</webidl> + <Type type="float"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Operation setter="setter"> + <webidl> setter void (DOMString propertyName, float propertyValue);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + <Argument name="propertyValue"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/identifier-qualified-names.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/identifier-qualified-names.widlprocxml new file mode 100644 index 000000000..b6024e5ff --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/identifier-qualified-names.widlprocxml @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl> typedef float number; + + exception FrameworkException { + + const long ERR_NOT_FOUND = 1; + + long code; + }; + + interface System { + + object createObject(DOMString _interface); + + getter DOMString (DOMString keyName); + }; + + + interface TextField { + + attribute boolean _const; + + attribute DOMString? _value; + }; + +interface Foo { + void op(object interface); +};</webidl> + <Typedef name="number" id="::number"> + <webidl> typedef float number;</webidl> + <Type type="float"/> + </Typedef> + <Exception name="FrameworkException" id="::FrameworkException"> + <webidl> exception FrameworkException { + + const long ERR_NOT_FOUND = 1; + + long code; + };</webidl> + <Const name="ERR_NOT_FOUND" value="1" id="::FrameworkException::ERR_NOT_FOUND"> + <webidl> const long ERR_NOT_FOUND = 1;</webidl> + <Type type="long"/> + </Const> + <ExceptionField name="code" id="::FrameworkException::code"> + <webidl> long code;</webidl> + <Type type="long"/> + </ExceptionField> + </Exception> + <Interface name="System" id="::System"> + <webidl> interface System { + + object createObject(DOMString _interface); + + getter DOMString (DOMString keyName); + };</webidl> + <Operation name="createObject" id="::System::createObject"> + <webidl> object createObject(DOMString _interface);</webidl> + <Type type="object"/> + <ArgumentList> + <Argument name="_interface"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Operation getter="getter"> + <webidl> getter DOMString (DOMString keyName);</webidl> + <Type type="DOMString"/> + <ArgumentList> + <Argument name="keyName"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> + <Interface name="TextField" id="::TextField"> + <webidl> interface TextField { + + attribute boolean _const; + + attribute DOMString? _value; + };</webidl> + <Attribute name="_const" id="::TextField::_const"> + <webidl> attribute boolean _const;</webidl> + <Type type="boolean"/> + </Attribute> + <Attribute name="_value" id="::TextField::_value"> + <webidl> attribute DOMString? _value;</webidl> + <Type type="DOMString" nullable="nullable"/> + </Attribute> + </Interface> + <Interface name="Foo" id="::Foo"> + <webidl>interface Foo { + void op(object interface); +};</webidl> + <Operation name="op" id="::Foo::op"> + <webidl> void op(object interface);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="interface"> + <Type type="object"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/implements.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/implements.widlprocxml new file mode 100644 index 000000000..3d1c1ab84 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/implements.widlprocxml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl> interface Node { + readonly attribute unsigned short nodeType; + }; + + interface EventTarget { + void addEventListener(DOMString type, + <ref>EventListener</ref> listener, + boolean useCapture); + }; + + <ref>Node</ref> implements <ref>EventTarget</ref>;</webidl> + <Interface name="Node" id="::Node"> + <webidl> interface Node { + readonly attribute unsigned short nodeType; + };</webidl> + <Attribute readonly="readonly" name="nodeType" id="::Node::nodeType"> + <webidl> readonly attribute unsigned short nodeType;</webidl> + <Type type="unsigned short"/> + </Attribute> + </Interface> + <Interface name="EventTarget" id="::EventTarget"> + <webidl> interface EventTarget { + void addEventListener(DOMString type, + <ref>EventListener</ref> listener, + boolean useCapture); + };</webidl> + <Operation name="addEventListener" id="::EventTarget::addEventListener"> + <webidl> void addEventListener(DOMString type, + <ref>EventListener</ref> listener, + boolean useCapture);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="type"> + <Type type="DOMString"/> + </Argument> + <Argument name="listener"> + <Type name="EventListener"/> + </Argument> + <Argument name="useCapture"> + <Type type="boolean"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> + <Implements name1="Node" name2="EventTarget"> + <webidl> <ref>Node</ref> implements <ref>EventTarget</ref>;</webidl> + </Implements> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/indexed-properties.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/indexed-properties.widlprocxml new file mode 100644 index 000000000..fb83621b6 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/indexed-properties.widlprocxml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface OrderedMap { + readonly attribute unsigned long size; + + getter any getByIndex(unsigned long index); + setter void setByIndex(unsigned long index, any value); + deleter void removeByIndex(unsigned long index); + + getter any get(DOMString name); + setter creator void set(DOMString name, any value); + deleter void remove(DOMString name); +};</webidl> + <Interface name="OrderedMap" id="::OrderedMap"> + <webidl>interface OrderedMap { + readonly attribute unsigned long size; + + getter any getByIndex(unsigned long index); + setter void setByIndex(unsigned long index, any value); + deleter void removeByIndex(unsigned long index); + + getter any get(DOMString name); + setter creator void set(DOMString name, any value); + deleter void remove(DOMString name); +};</webidl> + <Attribute readonly="readonly" name="size" id="::OrderedMap::size"> + <webidl> readonly attribute unsigned long size;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Operation getter="getter" name="getByIndex" id="::OrderedMap::getByIndex"> + <webidl> getter any getByIndex(unsigned long index);</webidl> + <Type type="any"/> + <ArgumentList> + <Argument name="index"> + <Type type="unsigned long"/> + </Argument> + </ArgumentList> + </Operation> + <Operation setter="setter" name="setByIndex" id="::OrderedMap::setByIndex"> + <webidl> setter void setByIndex(unsigned long index, any value);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="index"> + <Type type="unsigned long"/> + </Argument> + <Argument name="value"> + <Type type="any"/> + </Argument> + </ArgumentList> + </Operation> + <Operation deleter="deleter" name="removeByIndex" id="::OrderedMap::removeByIndex"> + <webidl> deleter void removeByIndex(unsigned long index);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="index"> + <Type type="unsigned long"/> + </Argument> + </ArgumentList> + </Operation> + <Operation getter="getter" name="get" id="::OrderedMap::get"> + <webidl> getter any get(DOMString name);</webidl> + <Type type="any"/> + <ArgumentList> + <Argument name="name"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Operation setter="setter" creator="creator" name="set" id="::OrderedMap::set"> + <webidl> setter creator void set(DOMString name, any value);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="name"> + <Type type="DOMString"/> + </Argument> + <Argument name="value"> + <Type type="any"/> + </Argument> + </ArgumentList> + </Operation> + <Operation deleter="deleter" name="remove" id="::OrderedMap::remove"> + <webidl> deleter void remove(DOMString name);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="name"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/inherits-getter.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/inherits-getter.widlprocxml new file mode 100644 index 000000000..55e7a317f --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/inherits-getter.widlprocxml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Animal { + + readonly attribute DOMString name; +}; + +interface Person : <ref>Animal</ref> { + + readonly attribute unsigned short age; + + inherit attribute DOMString name; +};</webidl> + <Interface name="Animal" id="::Animal"> + <webidl>interface Animal { + + readonly attribute DOMString name; +};</webidl> + <Attribute readonly="readonly" name="name" id="::Animal::name"> + <webidl> readonly attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + </Interface> + <Interface name="Person" id="::Person"> + <webidl>interface Person : <ref>Animal</ref> { + + readonly attribute unsigned short age; + + inherit attribute DOMString name; +};</webidl> + <InterfaceInheritance> + <Name name="Animal"/> + </InterfaceInheritance> + <Attribute readonly="readonly" name="age" id="::Person::age"> + <webidl> readonly attribute unsigned short age;</webidl> + <Type type="unsigned short"/> + </Attribute> + <Attribute inherit="inherit" name="name" id="::Person::name"> + <webidl> inherit attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/interface-inherits.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/interface-inherits.widlprocxml new file mode 100644 index 000000000..94f0e29df --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/interface-inherits.widlprocxml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Animal { + attribute DOMString name; +}; + +interface Human : <ref>Animal</ref> { + attribute <ref>Dog</ref> pet; +}; + +interface Dog : <ref>Animal</ref> { + attribute <ref>Human</ref> owner; +};</webidl> + <Interface name="Animal" id="::Animal"> + <webidl>interface Animal { + attribute DOMString name; +};</webidl> + <Attribute name="name" id="::Animal::name"> + <webidl> attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + </Interface> + <Interface name="Human" id="::Human"> + <webidl>interface Human : <ref>Animal</ref> { + attribute <ref>Dog</ref> pet; +};</webidl> + <InterfaceInheritance> + <Name name="Animal"/> + </InterfaceInheritance> + <Attribute name="pet" id="::Human::pet"> + <webidl> attribute <ref>Dog</ref> pet;</webidl> + <Type name="Dog"/> + </Attribute> + </Interface> + <Interface name="Dog" id="::Dog"> + <webidl>interface Dog : <ref>Animal</ref> { + attribute <ref>Human</ref> owner; +};</webidl> + <InterfaceInheritance> + <Name name="Animal"/> + </InterfaceInheritance> + <Attribute name="owner" id="::Dog::owner"> + <webidl> attribute <ref>Human</ref> owner;</webidl> + <Type name="Human"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/iterator.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/iterator.widlprocxml new file mode 100644 index 000000000..8ca95fbbd --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/iterator.widlprocxml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface SessionManager { + <ref>Session</ref> getSessionForUser(DOMString username); + readonly attribute unsigned long sessionCount; + + <ref>Session</ref> iterator; +}; + +interface Session { + readonly attribute DOMString username; +}; + +interface SessionManager2 { + <ref>Session2</ref> getSessionForUser(DOMString username); + readonly attribute unsigned long sessionCount; + + <ref>Session2</ref> iterator = SessionIterator; +}; + +interface Session2 { + readonly attribute DOMString username; +}; + +interface SessionIterator { + readonly attribute unsigned long remainingSessions; +}; + + interface NodeList { + <ref>Node</ref> iterator = NodeIterator; + }; + + interface NodeIterator { + <ref>Node</ref> iterator object; + };</webidl> + <Interface name="SessionManager" id="::SessionManager"> + <webidl>interface SessionManager { + <ref>Session</ref> getSessionForUser(DOMString username); + readonly attribute unsigned long sessionCount; + + <ref>Session</ref> iterator; +};</webidl> + <Operation name="getSessionForUser" id="::SessionManager::getSessionForUser"> + <webidl> <ref>Session</ref> getSessionForUser(DOMString username);</webidl> + <Type name="Session"/> + <ArgumentList> + <Argument name="username"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Attribute readonly="readonly" name="sessionCount" id="::SessionManager::sessionCount"> + <webidl> readonly attribute unsigned long sessionCount;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Iterator> + <webidl> <ref>Session</ref> iterator;</webidl> + <Type name="Session"/> + </Iterator> + </Interface> + <Interface name="Session" id="::Session"> + <webidl>interface Session { + readonly attribute DOMString username; +};</webidl> + <Attribute readonly="readonly" name="username" id="::Session::username"> + <webidl> readonly attribute DOMString username;</webidl> + <Type type="DOMString"/> + </Attribute> + </Interface> + <Interface name="SessionManager2" id="::SessionManager2"> + <webidl>interface SessionManager2 { + <ref>Session2</ref> getSessionForUser(DOMString username); + readonly attribute unsigned long sessionCount; + + <ref>Session2</ref> iterator = SessionIterator; +};</webidl> + <Operation name="getSessionForUser" id="::SessionManager2::getSessionForUser"> + <webidl> <ref>Session2</ref> getSessionForUser(DOMString username);</webidl> + <Type name="Session2"/> + <ArgumentList> + <Argument name="username"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Attribute readonly="readonly" name="sessionCount" id="::SessionManager2::sessionCount"> + <webidl> readonly attribute unsigned long sessionCount;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Iterator interface="SessionIterator"> + <webidl> <ref>Session2</ref> iterator = SessionIterator;</webidl> + <Type name="Session2"/> + </Iterator> + </Interface> + <Interface name="Session2" id="::Session2"> + <webidl>interface Session2 { + readonly attribute DOMString username; +};</webidl> + <Attribute readonly="readonly" name="username" id="::Session2::username"> + <webidl> readonly attribute DOMString username;</webidl> + <Type type="DOMString"/> + </Attribute> + </Interface> + <Interface name="SessionIterator" id="::SessionIterator"> + <webidl>interface SessionIterator { + readonly attribute unsigned long remainingSessions; +};</webidl> + <Attribute readonly="readonly" name="remainingSessions" id="::SessionIterator::remainingSessions"> + <webidl> readonly attribute unsigned long remainingSessions;</webidl> + <Type type="unsigned long"/> + </Attribute> + </Interface> + <Interface name="NodeList" id="::NodeList"> + <webidl> interface NodeList { + <ref>Node</ref> iterator = NodeIterator; + };</webidl> + <Iterator interface="NodeIterator"> + <webidl> <ref>Node</ref> iterator = NodeIterator;</webidl> + <Type name="Node"/> + </Iterator> + </Interface> + <Interface name="NodeIterator" id="::NodeIterator"> + <webidl> interface NodeIterator { + <ref>Node</ref> iterator object; + };</webidl> + <IteratorObject> + <webidl> <ref>Node</ref> iterator object;</webidl> + <Type name="Node"/> + </IteratorObject> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/module.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/module.widlprocxml new file mode 100644 index 000000000..b575b8705 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/module.widlprocxml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <Module name="gfx" id="::gfx"> + <webidl>module gfx { + + module geom { + interface Shape { }; + interface Rectangle : <ref>Shape</ref> { }; + interface Path : <ref>Shape</ref> { }; + }; + + interface GraphicsContext { + void fillShape(<ref>geom::Shape</ref> s); + void strokeShape(<ref>geom::Shape</ref> s); + }; +};</webidl> + <Module name="geom" id="::gfx::geom"> + <webidl> module geom { + interface Shape { }; + interface Rectangle : <ref>Shape</ref> { }; + interface Path : <ref>Shape</ref> { }; + };</webidl> + <Interface name="Shape" id="::gfx::geom::Shape"> + <webidl> interface Shape { };</webidl> + </Interface> + <Interface name="Rectangle" id="::gfx::geom::Rectangle"> + <webidl> interface Rectangle : <ref>Shape</ref> { };</webidl> + <InterfaceInheritance> + <Name name="Shape"/> + </InterfaceInheritance> + </Interface> + <Interface name="Path" id="::gfx::geom::Path"> + <webidl> interface Path : <ref>Shape</ref> { };</webidl> + <InterfaceInheritance> + <Name name="Shape"/> + </InterfaceInheritance> + </Interface> + </Module> + <Interface name="GraphicsContext" id="::gfx::GraphicsContext"> + <webidl> interface GraphicsContext { + void fillShape(<ref>geom::Shape</ref> s); + void strokeShape(<ref>geom::Shape</ref> s); + };</webidl> + <Operation name="fillShape" id="::gfx::GraphicsContext::fillShape"> + <webidl> void fillShape(<ref>geom::Shape</ref> s);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="s"> + <Type name="geom::Shape"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="strokeShape" id="::gfx::GraphicsContext::strokeShape"> + <webidl> void strokeShape(<ref>geom::Shape</ref> s);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="s"> + <Type name="geom::Shape"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> + </Module> + <Module name="gui" id="::gui"> + <webidl>module gui { + + interface Widget { }; + + interface Window : <ref>Widget</ref> { + <ref>gfx::GraphicsContext</ref> getGraphicsContext(); + }; + + interface Button : <ref>Widget</ref> { }; +};</webidl> + <Interface name="Widget" id="::gui::Widget"> + <webidl> interface Widget { };</webidl> + </Interface> + <Interface name="Window" id="::gui::Window"> + <webidl> interface Window : <ref>Widget</ref> { + <ref>gfx::GraphicsContext</ref> getGraphicsContext(); + };</webidl> + <InterfaceInheritance> + <Name name="Widget"/> + </InterfaceInheritance> + <Operation name="getGraphicsContext" id="::gui::Window::getGraphicsContext"> + <webidl> <ref>gfx::GraphicsContext</ref> getGraphicsContext();</webidl> + <Type name="gfx::GraphicsContext"/> + <ArgumentList/> + </Operation> + </Interface> + <Interface name="Button" id="::gui::Button"> + <webidl> interface Button : <ref>Widget</ref> { };</webidl> + <InterfaceInheritance> + <Name name="Widget"/> + </InterfaceInheritance> + </Interface> + </Module> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/namedconstructor.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/namedconstructor.widlprocxml new file mode 100644 index 000000000..9f6616128 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/namedconstructor.widlprocxml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>[NamedConstructor=Audio, + NamedConstructor=Audio(DOMString src)] +interface HTMLAudioElement : <ref>HTMLMediaElement</ref> { +};</webidl> + <Interface name="HTMLAudioElement" id="::HTMLAudioElement"> + <webidl>[NamedConstructor=Audio, + NamedConstructor=Audio(DOMString src)] +interface HTMLAudioElement : <ref>HTMLMediaElement</ref> { +};</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="NamedConstructor" value="Audio"> + <webidl>NamedConstructor</webidl> + </ExtendedAttribute> + <ExtendedAttribute name="NamedConstructor" value="Audio"> + <webidl> NamedConstructor=Audio(DOMString src)</webidl> + <ArgumentList> + <Argument name="src"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </ExtendedAttribute> + </ExtendedAttributeList> + <InterfaceInheritance> + <Name name="HTMLMediaElement"/> + </InterfaceInheritance> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/namespaceobject.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/namespaceobject.widlprocxml new file mode 100644 index 000000000..af0cde937 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/namespaceobject.widlprocxml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <Module name="acme" id="::acme"> + <webidl>[NamespaceObject] +module acme { + + exception DeviceException { }; + + module pim { + + [Constructor] + interface Contact { }; + + [Constructor, + NamedConstructor=RecurringEvent(long freq)] + interface CalendarEvent { }; + }; +};</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="NamespaceObject"/> + </ExtendedAttributeList> + <Exception name="DeviceException" id="::acme::DeviceException"> + <webidl> exception DeviceException { };</webidl> + </Exception> + <Module name="pim" id="::acme::pim"> + <webidl> module pim { + + [Constructor] + interface Contact { }; + + [Constructor, + NamedConstructor=RecurringEvent(long freq)] + interface CalendarEvent { }; + };</webidl> + <Interface name="Contact" id="::acme::pim::Contact"> + <webidl> [Constructor] + interface Contact { };</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="Constructor"/> + </ExtendedAttributeList> + </Interface> + <Interface name="CalendarEvent" id="::acme::pim::CalendarEvent"> + <webidl> [Constructor, + NamedConstructor=RecurringEvent(long freq)] + interface CalendarEvent { };</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="Constructor"/> + <ExtendedAttribute name="NamedConstructor" value="RecurringEvent"> + <ArgumentList> + <Argument name="freq"> + <Type type="long"/> + </Argument> + </ArgumentList> + </ExtendedAttribute> + </ExtendedAttributeList> + </Interface> + </Module> + </Module> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/nointerfaceobject.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/nointerfaceobject.widlprocxml new file mode 100644 index 000000000..f64f116b6 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/nointerfaceobject.widlprocxml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>[NoInterfaceObject] +interface Query { + any lookupEntry(unsigned long key); +};</webidl> + <Interface name="Query" id="::Query"> + <webidl>[NoInterfaceObject] +interface Query { + any lookupEntry(unsigned long key); +};</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="NoInterfaceObject"> + <webidl>NoInterfaceObject</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Operation name="lookupEntry" id="::Query::lookupEntry"> + <webidl> any lookupEntry(unsigned long key);</webidl> + <Type type="any"/> + <ArgumentList> + <Argument name="key"> + <Type type="unsigned long"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/nullable.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/nullable.widlprocxml new file mode 100644 index 000000000..8739e4432 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/nullable.widlprocxml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface MyConstants { + const boolean? ARE_WE_THERE_YET = false; +}; + +interface Node { + readonly attribute DOMString? namespaceURI; +};</webidl> + <Interface name="MyConstants" id="::MyConstants"> + <webidl>interface MyConstants { + const boolean? ARE_WE_THERE_YET = false; +};</webidl> + <Const name="ARE_WE_THERE_YET" value="false" id="::MyConstants::ARE_WE_THERE_YET"> + <webidl> const boolean? ARE_WE_THERE_YET = false;</webidl> + <Type type="boolean" nullable="nullable"/> + </Const> + </Interface> + <Interface name="Node" id="::Node"> + <webidl>interface Node { + readonly attribute DOMString? namespaceURI; +};</webidl> + <Attribute readonly="readonly" name="namespaceURI" id="::Node::namespaceURI"> + <webidl> readonly attribute DOMString? namespaceURI;</webidl> + <Type type="DOMString" nullable="nullable"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/nullableobjects.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/nullableobjects.widlprocxml new file mode 100644 index 000000000..22d9fdd25 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/nullableobjects.widlprocxml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface A { +}; +interface B { +}; +interface C { + void f(<ref>A</ref>? x); + void f(<ref>B</ref>? x); + +};</webidl> + <Interface name="A" id="::A"> + <webidl>interface A { +};</webidl> + </Interface> + <Interface name="B" id="::B"> + <webidl>interface B { +};</webidl> + </Interface> + <Interface name="C" id="::C"> + <webidl>interface C { + void f(<ref>A</ref>? x); + void f(<ref>B</ref>? x); + +};</webidl> + <Operation name="f" id="::C::f"> + <webidl> void f(<ref>A</ref>? x);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="x"> + <Type name="A" nullable="nullable"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="f" id="::C::f"> + <webidl> void f(<ref>B</ref>? x);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="x"> + <Type name="B" nullable="nullable"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/operation-optional-arg.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/operation-optional-arg.widlprocxml new file mode 100644 index 000000000..54aef1f87 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/operation-optional-arg.widlprocxml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface ColorCreator { + object createColor(float v1, float v2, float v3, optional float alpha = 3.5); +};</webidl> + <Interface name="ColorCreator" id="::ColorCreator"> + <webidl>interface ColorCreator { + object createColor(float v1, float v2, float v3, optional float alpha = 3.5); +};</webidl> + <Operation name="createColor" id="::ColorCreator::createColor"> + <webidl> object createColor(float v1, float v2, float v3, optional float alpha = 3.5);</webidl> + <Type type="object"/> + <ArgumentList> + <Argument name="v1"> + <Type type="float"/> + </Argument> + <Argument name="v2"> + <Type type="float"/> + </Argument> + <Argument name="v3"> + <Type type="float"/> + </Argument> + <Argument optional="optional" name="alpha" value="3.5"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/overloading.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/overloading.widlprocxml new file mode 100644 index 000000000..db6da7a68 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/overloading.widlprocxml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface A { +}; + +interface B { +}; + +interface C { + void f(<ref>A</ref> x); + void f(<ref>B</ref> x); +}; + +interface A { +void f(DOMString a); +void f([AllowAny] DOMString a, DOMString b, float... c); +void f(); +void f(long a, DOMString b, optional DOMString c, float... d); +};</webidl> + <Interface name="A" id="::A"> + <webidl>interface A { +};</webidl> + </Interface> + <Interface name="B" id="::B"> + <webidl>interface B { +};</webidl> + </Interface> + <Interface name="C" id="::C"> + <webidl>interface C { + void f(<ref>A</ref> x); + void f(<ref>B</ref> x); +};</webidl> + <Operation name="f" id="::C::f"> + <webidl> void f(<ref>A</ref> x);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="x"> + <Type name="A"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="f" id="::C::f"> + <webidl> void f(<ref>B</ref> x);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="x"> + <Type name="B"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> + <Interface name="A" id="::A"> + <webidl>interface A { +void f(DOMString a); +void f([AllowAny] DOMString a, DOMString b, float... c); +void f(); +void f(long a, DOMString b, optional DOMString c, float... d); +};</webidl> + <Operation name="f" id="::A::f"> + <webidl> void f(DOMString a);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="a"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="f" id="::A::f"> + <webidl> void f([AllowAny] DOMString a, DOMString b, float... c);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="a"> + <ExtendedAttributeList> + <ExtendedAttribute name="AllowAny"> + <webidl>AllowAny</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Type type="DOMString"/> + </Argument> + <Argument name="b"> + <Type type="DOMString"/> + </Argument> + <Argument ellipsis="ellipsis" name="c"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="f" id="::A::f"> + <webidl> void f();</webidl> + <Type type="void"/> + <ArgumentList/> + </Operation> + <Operation name="f" id="::A::f"> + <webidl> void f(long a, DOMString b, optional DOMString c, float... d);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="a"> + <Type type="long"/> + </Argument> + <Argument name="b"> + <Type type="DOMString"/> + </Argument> + <Argument optional="optional" name="c"> + <Type type="DOMString"/> + </Argument> + <Argument ellipsis="ellipsis" name="d"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/overridebuiltins.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/overridebuiltins.widlprocxml new file mode 100644 index 000000000..56c92517b --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/overridebuiltins.widlprocxml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>[OverrideBuiltins] +interface StringMap2 { + readonly attribute unsigned long length; + getter DOMString lookup(DOMString key); +};</webidl> + <Interface name="StringMap2" id="::StringMap2"> + <webidl>[OverrideBuiltins] +interface StringMap2 { + readonly attribute unsigned long length; + getter DOMString lookup(DOMString key); +};</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="OverrideBuiltins"> + <webidl>OverrideBuiltins</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Attribute readonly="readonly" name="length" id="::StringMap2::length"> + <webidl> readonly attribute unsigned long length;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Operation getter="getter" name="lookup" id="::StringMap2::lookup"> + <webidl> getter DOMString lookup(DOMString key);</webidl> + <Type type="DOMString"/> + <ArgumentList> + <Argument name="key"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/partial-interface.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/partial-interface.widlprocxml new file mode 100644 index 000000000..8d7dcb4e4 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/partial-interface.widlprocxml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Foo { + attribute DOMString bar; +}; + +partial interface Foo { + attribute DOMString quux; +};</webidl> + <Interface name="Foo" id="::Foo"> + <webidl>interface Foo { + attribute DOMString bar; +};</webidl> + <Attribute name="bar" id="::Foo::bar"> + <webidl> attribute DOMString bar;</webidl> + <Type type="DOMString"/> + </Attribute> + </Interface> + <Interface name="Foo" partial="partial" id="::Foo"> + <webidl>partial interface Foo { + attribute DOMString quux; +};</webidl> + <Attribute name="quux" id="::Foo::quux"> + <webidl> attribute DOMString quux;</webidl> + <Type type="DOMString"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/primitives.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/primitives.widlprocxml new file mode 100644 index 000000000..46977a2d7 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/primitives.widlprocxml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Primitives { + attribute boolean truth; + attribute byte character; + attribute octet value; + attribute short number; + attribute unsigned short positive; + attribute long big; + attribute unsigned long bigpositive; + attribute long long bigbig; + attribute unsigned long long bigbigpositive; + attribute float real; + attribute double bigreal; + attribute unrestricted float realwithinfinity; + attribute unrestricted double bigrealwithinfinity; + attribute DOMString string; + attribute ByteString bytes; + attribute Date date; + attribute RegExp regexp; +};</webidl> + <Interface name="Primitives" id="::Primitives"> + <webidl>interface Primitives { + attribute boolean truth; + attribute byte character; + attribute octet value; + attribute short number; + attribute unsigned short positive; + attribute long big; + attribute unsigned long bigpositive; + attribute long long bigbig; + attribute unsigned long long bigbigpositive; + attribute float real; + attribute double bigreal; + attribute unrestricted float realwithinfinity; + attribute unrestricted double bigrealwithinfinity; + attribute DOMString string; + attribute ByteString bytes; + attribute Date date; + attribute RegExp regexp; +};</webidl> + <Attribute name="truth" id="::Primitives::truth"> + <webidl> attribute boolean truth;</webidl> + <Type type="boolean"/> + </Attribute> + <Attribute name="character" id="::Primitives::character"> + <webidl> attribute byte character;</webidl> + <Type type="byte"/> + </Attribute> + <Attribute name="value" id="::Primitives::value"> + <webidl> attribute octet value;</webidl> + <Type type="octet"/> + </Attribute> + <Attribute name="number" id="::Primitives::number"> + <webidl> attribute short number;</webidl> + <Type type="short"/> + </Attribute> + <Attribute name="positive" id="::Primitives::positive"> + <webidl> attribute unsigned short positive;</webidl> + <Type type="unsigned short"/> + </Attribute> + <Attribute name="big" id="::Primitives::big"> + <webidl> attribute long big;</webidl> + <Type type="long"/> + </Attribute> + <Attribute name="bigpositive" id="::Primitives::bigpositive"> + <webidl> attribute unsigned long bigpositive;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Attribute name="bigbig" id="::Primitives::bigbig"> + <webidl> attribute long long bigbig;</webidl> + <Type type="long long"/> + </Attribute> + <Attribute name="bigbigpositive" id="::Primitives::bigbigpositive"> + <webidl> attribute unsigned long long bigbigpositive;</webidl> + <Type type="unsigned long long"/> + </Attribute> + <Attribute name="real" id="::Primitives::real"> + <webidl> attribute float real;</webidl> + <Type type="float"/> + </Attribute> + <Attribute name="bigreal" id="::Primitives::bigreal"> + <webidl> attribute double bigreal;</webidl> + <Type type="double"/> + </Attribute> + <Attribute name="realwithinfinity" id="::Primitives::realwithinfinity"> + <webidl> attribute unrestricted float realwithinfinity;</webidl> + <Type type="unrestricted float"/> + </Attribute> + <Attribute name="bigrealwithinfinity" id="::Primitives::bigrealwithinfinity"> + <webidl> attribute unrestricted double bigrealwithinfinity;</webidl> + <Type type="unrestricted double"/> + </Attribute> + <Attribute name="string" id="::Primitives::string"> + <webidl> attribute DOMString string;</webidl> + <Type type="DOMString"/> + </Attribute> + <Attribute name="bytes" id="::Primitives::bytes"> + <webidl> attribute ByteString bytes;</webidl> + <Type type="ByteString"/> + </Attribute> + <Attribute name="date" id="::Primitives::date"> + <webidl> attribute Date date;</webidl> + <Type type="Date"/> + </Attribute> + <Attribute name="regexp" id="::Primitives::regexp"> + <webidl> attribute RegExp regexp;</webidl> + <Type type="RegExp"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/prototyperoot.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/prototyperoot.widlprocxml new file mode 100644 index 000000000..2e56cd75e --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/prototyperoot.widlprocxml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>[PrototypeRoot] +interface Node { + readonly attribute unsigned short nodeType; +};</webidl> + <Interface name="Node" id="::Node"> + <webidl>[PrototypeRoot] +interface Node { + readonly attribute unsigned short nodeType; +};</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="PrototypeRoot"> + <webidl>PrototypeRoot</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Attribute readonly="readonly" name="nodeType" id="::Node::nodeType"> + <webidl> readonly attribute unsigned short nodeType;</webidl> + <Type type="unsigned short"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/putforwards.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/putforwards.widlprocxml new file mode 100644 index 000000000..634fad55a --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/putforwards.widlprocxml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Person { + [PutForwards=full] readonly attribute <ref>Name</ref> name; + attribute unsigned short age; +};</webidl> + <Interface name="Person" id="::Person"> + <webidl>interface Person { + [PutForwards=full] readonly attribute <ref>Name</ref> name; + attribute unsigned short age; +};</webidl> + <Attribute readonly="readonly" name="name" id="::Person::name"> + <webidl> [PutForwards=full] readonly attribute <ref>Name</ref> name;</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="PutForwards" value="full"> + <webidl>PutForwards</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Type name="Name"/> + </Attribute> + <Attribute name="age" id="::Person::age"> + <webidl> attribute unsigned short age;</webidl> + <Type type="unsigned short"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/reg-operations.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/reg-operations.widlprocxml new file mode 100644 index 000000000..3b756ed68 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/reg-operations.widlprocxml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Dimensions { + attribute unsigned long width; + attribute unsigned long height; +}; + +exception NoPointerDevice { }; + +interface Button { + + boolean isMouseOver(); + + void setDimensions(<ref>Dimensions</ref> size); + void setDimensions(unsigned long width, unsigned long height); +};</webidl> + <Interface name="Dimensions" id="::Dimensions"> + <webidl>interface Dimensions { + attribute unsigned long width; + attribute unsigned long height; +};</webidl> + <Attribute name="width" id="::Dimensions::width"> + <webidl> attribute unsigned long width;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Attribute name="height" id="::Dimensions::height"> + <webidl> attribute unsigned long height;</webidl> + <Type type="unsigned long"/> + </Attribute> + </Interface> + <Exception name="NoPointerDevice" id="::NoPointerDevice"> + <webidl>exception NoPointerDevice { };</webidl> + </Exception> + <Interface name="Button" id="::Button"> + <webidl>interface Button { + + boolean isMouseOver(); + + void setDimensions(<ref>Dimensions</ref> size); + void setDimensions(unsigned long width, unsigned long height); +};</webidl> + <Operation name="isMouseOver" id="::Button::isMouseOver"> + <webidl> boolean isMouseOver();</webidl> + <Type type="boolean"/> + <ArgumentList/> + </Operation> + <Operation name="setDimensions" id="::Button::setDimensions"> + <webidl> void setDimensions(<ref>Dimensions</ref> size);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="size"> + <Type name="Dimensions"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="setDimensions" id="::Button::setDimensions"> + <webidl> void setDimensions(unsigned long width, unsigned long height);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="width"> + <Type type="unsigned long"/> + </Argument> + <Argument name="height"> + <Type type="unsigned long"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/replaceable.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/replaceable.widlprocxml new file mode 100644 index 000000000..f97621668 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/replaceable.widlprocxml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Counter { + [Replaceable] readonly attribute unsigned long value; + void increment(); +};</webidl> + <Interface name="Counter" id="::Counter"> + <webidl>interface Counter { + [Replaceable] readonly attribute unsigned long value; + void increment(); +};</webidl> + <Attribute readonly="readonly" name="value" id="::Counter::value"> + <webidl> [Replaceable] readonly attribute unsigned long value;</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="Replaceable"> + <webidl>Replaceable</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Type type="unsigned long"/> + </Attribute> + <Operation name="increment" id="::Counter::increment"> + <webidl> void increment();</webidl> + <Type type="void"/> + <ArgumentList/> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/sequence.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/sequence.widlprocxml new file mode 100644 index 000000000..d5f456417 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/sequence.widlprocxml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Canvas { + void drawPolygon(sequence<float> coordinates); + sequence<float> getInflectionPoints(); +};</webidl> + <Interface name="Canvas" id="::Canvas"> + <webidl>interface Canvas { + void drawPolygon(sequence<float> coordinates); + sequence<float> getInflectionPoints(); +};</webidl> + <Operation name="drawPolygon" id="::Canvas::drawPolygon"> + <webidl> void drawPolygon(sequence<float> coordinates);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="coordinates"> + <Type type="sequence"> + <Type type="float"/> + </Type> + </Argument> + </ArgumentList> + </Operation> + <Operation name="getInflectionPoints" id="::Canvas::getInflectionPoints"> + <webidl> sequence<float> getInflectionPoints();</webidl> + <Type type="sequence"> + <Type type="float"/> + </Type> + <ArgumentList/> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/serializer.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/serializer.widlprocxml new file mode 100644 index 000000000..eb4219f8a --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/serializer.widlprocxml @@ -0,0 +1,296 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Transaction { + readonly attribute <ref>Account</ref> from; + readonly attribute <ref>Account</ref> to; + readonly attribute float amount; + readonly attribute DOMString description; + readonly attribute unsigned long number; + + serializer; +}; + +interface Account { + attribute DOMString name; + attribute unsigned long number; + serializer DOMString serialize(); +}; + +interface Transaction2 { + readonly attribute <ref>Account2</ref> from; + readonly attribute <ref>Account2</ref> to; + readonly attribute float amount; + readonly attribute DOMString description; + readonly attribute unsigned long number; + + serializer = { from, to, amount, description }; +}; + +interface Account2 { + attribute DOMString name; + attribute unsigned long number; + serializer = number; +}; + +interface Account3 { + attribute DOMString name; + attribute unsigned long number; + + serializer = { attribute }; +}; + +interface Account4 { + getter object getItem(unsigned long index); + serializer = { getter }; +}; + +interface Account5 : <ref>Account</ref> { + attribute DOMString secondname; + serializer = { inherit, secondname }; +}; + +interface Account6 : <ref>Account</ref> { + attribute DOMString secondname; + serializer = { inherit, attribute }; +}; + +interface Account7 { + attribute DOMString name; + attribute unsigned long number; + serializer = [ name, number ]; +}; + +interface Account8 { + getter object getItem(unsigned long index); + serializer = [ getter ]; +};</webidl> + <Interface name="Transaction" id="::Transaction"> + <webidl>interface Transaction { + readonly attribute <ref>Account</ref> from; + readonly attribute <ref>Account</ref> to; + readonly attribute float amount; + readonly attribute DOMString description; + readonly attribute unsigned long number; + + serializer; +};</webidl> + <Attribute readonly="readonly" name="from" id="::Transaction::from"> + <webidl> readonly attribute <ref>Account</ref> from;</webidl> + <Type name="Account"/> + </Attribute> + <Attribute readonly="readonly" name="to" id="::Transaction::to"> + <webidl> readonly attribute <ref>Account</ref> to;</webidl> + <Type name="Account"/> + </Attribute> + <Attribute readonly="readonly" name="amount" id="::Transaction::amount"> + <webidl> readonly attribute float amount;</webidl> + <Type type="float"/> + </Attribute> + <Attribute readonly="readonly" name="description" id="::Transaction::description"> + <webidl> readonly attribute DOMString description;</webidl> + <Type type="DOMString"/> + </Attribute> + <Attribute readonly="readonly" name="number" id="::Transaction::number"> + <webidl> readonly attribute unsigned long number;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Serializer> + <webidl> serializer;</webidl> + </Serializer> + </Interface> + <Interface name="Account" id="::Account"> + <webidl>interface Account { + attribute DOMString name; + attribute unsigned long number; + serializer DOMString serialize(); +};</webidl> + <Attribute name="name" id="::Account::name"> + <webidl> attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + <Attribute name="number" id="::Account::number"> + <webidl> attribute unsigned long number;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Operation serializer="serializer" name="serialize" id="::Account::serialize"> + <webidl> serializer DOMString serialize();</webidl> + <Type type="DOMString"/> + <ArgumentList/> + </Operation> + </Interface> + <Interface name="Transaction2" id="::Transaction2"> + <webidl>interface Transaction2 { + readonly attribute <ref>Account2</ref> from; + readonly attribute <ref>Account2</ref> to; + readonly attribute float amount; + readonly attribute DOMString description; + readonly attribute unsigned long number; + + serializer = { from, to, amount, description }; +};</webidl> + <Attribute readonly="readonly" name="from" id="::Transaction2::from"> + <webidl> readonly attribute <ref>Account2</ref> from;</webidl> + <Type name="Account2"/> + </Attribute> + <Attribute readonly="readonly" name="to" id="::Transaction2::to"> + <webidl> readonly attribute <ref>Account2</ref> to;</webidl> + <Type name="Account2"/> + </Attribute> + <Attribute readonly="readonly" name="amount" id="::Transaction2::amount"> + <webidl> readonly attribute float amount;</webidl> + <Type type="float"/> + </Attribute> + <Attribute readonly="readonly" name="description" id="::Transaction2::description"> + <webidl> readonly attribute DOMString description;</webidl> + <Type type="DOMString"/> + </Attribute> + <Attribute readonly="readonly" name="number" id="::Transaction2::number"> + <webidl> readonly attribute unsigned long number;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Serializer> + <webidl> serializer = { from, to, amount, description };</webidl> + <Map pattern="selection"> + <PatternAttribute name="from"/> + <PatternAttribute name="to"/> + <PatternAttribute name="amount"/> + <PatternAttribute name="description"/> + </Map> + </Serializer> + </Interface> + <Interface name="Account2" id="::Account2"> + <webidl>interface Account2 { + attribute DOMString name; + attribute unsigned long number; + serializer = number; +};</webidl> + <Attribute name="name" id="::Account2::name"> + <webidl> attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + <Attribute name="number" id="::Account2::number"> + <webidl> attribute unsigned long number;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Serializer attribute="number"> + <webidl> serializer = number;</webidl> + </Serializer> + </Interface> + <Interface name="Account3" id="::Account3"> + <webidl>interface Account3 { + attribute DOMString name; + attribute unsigned long number; + + serializer = { attribute }; +};</webidl> + <Attribute name="name" id="::Account3::name"> + <webidl> attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + <Attribute name="number" id="::Account3::number"> + <webidl> attribute unsigned long number;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Serializer> + <webidl> serializer = { attribute };</webidl> + <Map pattern="all"/> + </Serializer> + </Interface> + <Interface name="Account4" id="::Account4"> + <webidl>interface Account4 { + getter object getItem(unsigned long index); + serializer = { getter }; +};</webidl> + <Operation getter="getter" name="getItem" id="::Account4::getItem"> + <webidl> getter object getItem(unsigned long index);</webidl> + <Type type="object"/> + <ArgumentList> + <Argument name="index"> + <Type type="unsigned long"/> + </Argument> + </ArgumentList> + </Operation> + <Serializer> + <webidl> serializer = { getter };</webidl> + <Map pattern="getter"/> + </Serializer> + </Interface> + <Interface name="Account5" id="::Account5"> + <webidl>interface Account5 : <ref>Account</ref> { + attribute DOMString secondname; + serializer = { inherit, secondname }; +};</webidl> + <InterfaceInheritance> + <Name name="Account"/> + </InterfaceInheritance> + <Attribute name="secondname" id="::Account5::secondname"> + <webidl> attribute DOMString secondname;</webidl> + <Type type="DOMString"/> + </Attribute> + <Serializer> + <webidl> serializer = { inherit, secondname };</webidl> + <Map inherit="inherit" pattern="selection"> + <PatternAttribute name="secondname"/> + </Map> + </Serializer> + </Interface> + <Interface name="Account6" id="::Account6"> + <webidl>interface Account6 : <ref>Account</ref> { + attribute DOMString secondname; + serializer = { inherit, attribute }; +};</webidl> + <InterfaceInheritance> + <Name name="Account"/> + </InterfaceInheritance> + <Attribute name="secondname" id="::Account6::secondname"> + <webidl> attribute DOMString secondname;</webidl> + <Type type="DOMString"/> + </Attribute> + <Serializer> + <webidl> serializer = { inherit, attribute };</webidl> + <Map inherit="inherit" pattern="all"/> + </Serializer> + </Interface> + <Interface name="Account7" id="::Account7"> + <webidl>interface Account7 { + attribute DOMString name; + attribute unsigned long number; + serializer = [ name, number ]; +};</webidl> + <Attribute name="name" id="::Account7::name"> + <webidl> attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + <Attribute name="number" id="::Account7::number"> + <webidl> attribute unsigned long number;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Serializer> + <webidl> serializer = [ name, number ];</webidl> + <List pattern="selection"> + <PatternAttribute name="name"/> + <PatternAttribute name="number"/> + </List> + </Serializer> + </Interface> + <Interface name="Account8" id="::Account8"> + <webidl>interface Account8 { + getter object getItem(unsigned long index); + serializer = [ getter ]; +};</webidl> + <Operation getter="getter" name="getItem" id="::Account8::getItem"> + <webidl> getter object getItem(unsigned long index);</webidl> + <Type type="object"/> + <ArgumentList> + <Argument name="index"> + <Type type="unsigned long"/> + </Argument> + </ArgumentList> + </Operation> + <Serializer> + <webidl> serializer = [ getter ];</webidl> + <List pattern="getter"/> + </Serializer> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/special-omittable.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/special-omittable.widlprocxml new file mode 100644 index 000000000..1986d190a --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/special-omittable.widlprocxml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <Interface name="Dictionary" id="::Dictionary"> + <webidl>interface Dictionary { + readonly attribute unsigned long propertyCount; + + omittable getter float getProperty(DOMString propertyName); + omittable setter void setProperty(DOMString propertyName, float propertyValue); +};</webidl> + <Attribute readonly="readonly" name="propertyCount" id="::Dictionary::propertyCount"> + <webidl> readonly attribute unsigned long propertyCount;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Operation omittable="omittable" getter="getter" name="getProperty" id="::Dictionary::getProperty"> + <webidl> omittable getter float getProperty(DOMString propertyName);</webidl> + <Type type="float"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + <Operation omittable="omittable" setter="setter" name="setProperty" id="::Dictionary::setProperty"> + <webidl> omittable setter void setProperty(DOMString propertyName, float propertyValue);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="propertyName"> + <Type type="DOMString"/> + </Argument> + <Argument name="propertyValue"> + <Type type="float"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/static.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/static.widlprocxml new file mode 100644 index 000000000..03c14e16e --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/static.widlprocxml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Point { }; + +interface Circle { + attribute float cx; + attribute float cy; + attribute float radius; + + static readonly attribute long triangulationCount; + static <ref>Point</ref> triangulate(<ref>Circle</ref> c1, <ref>Circle</ref> c2, <ref>Circle</ref> c3); +};</webidl> + <Interface name="Point" id="::Point"> + <webidl>interface Point { };</webidl> + </Interface> + <Interface name="Circle" id="::Circle"> + <webidl>interface Circle { + attribute float cx; + attribute float cy; + attribute float radius; + + static readonly attribute long triangulationCount; + static <ref>Point</ref> triangulate(<ref>Circle</ref> c1, <ref>Circle</ref> c2, <ref>Circle</ref> c3); +};</webidl> + <Attribute name="cx" id="::Circle::cx"> + <webidl> attribute float cx;</webidl> + <Type type="float"/> + </Attribute> + <Attribute name="cy" id="::Circle::cy"> + <webidl> attribute float cy;</webidl> + <Type type="float"/> + </Attribute> + <Attribute name="radius" id="::Circle::radius"> + <webidl> attribute float radius;</webidl> + <Type type="float"/> + </Attribute> + <Attribute static="static" readonly="readonly" name="triangulationCount" id="::Circle::triangulationCount"> + <webidl> static readonly attribute long triangulationCount;</webidl> + <Type type="long"/> + </Attribute> + <Operation static="static" name="triangulate" id="::Circle::triangulate"> + <webidl> static <ref>Point</ref> triangulate(<ref>Circle</ref> c1, <ref>Circle</ref> c2, <ref>Circle</ref> c3);</webidl> + <Type name="Point"/> + <ArgumentList> + <Argument name="c1"> + <Type name="Circle"/> + </Argument> + <Argument name="c2"> + <Type name="Circle"/> + </Argument> + <Argument name="c3"> + <Type name="Circle"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/stringifier-attribute.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/stringifier-attribute.widlprocxml new file mode 100644 index 000000000..082ce4d34 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/stringifier-attribute.widlprocxml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>[Constructor] +interface Student { + attribute unsigned long id; + stringifier attribute DOMString name; +};</webidl> + <Interface name="Student" id="::Student"> + <webidl>[Constructor] +interface Student { + attribute unsigned long id; + stringifier attribute DOMString name; +};</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="Constructor"> + <webidl>Constructor</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Attribute name="id" id="::Student::id"> + <webidl> attribute unsigned long id;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Attribute stringifier="stringifier" name="name" id="::Student::name"> + <webidl> stringifier attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/stringifier-custom.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/stringifier-custom.widlprocxml new file mode 100644 index 000000000..cdab1ccfc --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/stringifier-custom.widlprocxml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>[Constructor] +interface Student { + attribute unsigned long id; + attribute DOMString? familyName; + attribute DOMString givenName; + + stringifier DOMString (); +};</webidl> + <Interface name="Student" id="::Student"> + <webidl>[Constructor] +interface Student { + attribute unsigned long id; + attribute DOMString? familyName; + attribute DOMString givenName; + + stringifier DOMString (); +};</webidl> + <ExtendedAttributeList> + <ExtendedAttribute name="Constructor"> + <webidl>Constructor</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Attribute name="id" id="::Student::id"> + <webidl> attribute unsigned long id;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Attribute name="familyName" id="::Student::familyName"> + <webidl> attribute DOMString? familyName;</webidl> + <Type type="DOMString" nullable="nullable"/> + </Attribute> + <Attribute name="givenName" id="::Student::givenName"> + <webidl> attribute DOMString givenName;</webidl> + <Type type="DOMString"/> + </Attribute> + <Operation stringifier="stringifier"> + <webidl> stringifier DOMString ();</webidl> + <Type type="DOMString"/> + <ArgumentList/> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/stringifier.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/stringifier.widlprocxml new file mode 100644 index 000000000..4a18b80b7 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/stringifier.widlprocxml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface A { + stringifier DOMString (); +}; + +interface A { + stringifier; +};</webidl> + <Interface name="A" id="::A"> + <webidl>interface A { + stringifier DOMString (); +};</webidl> + <Operation stringifier="stringifier"> + <webidl> stringifier DOMString ();</webidl> + <Type type="DOMString"/> + <ArgumentList/> + </Operation> + </Interface> + <Interface name="A" id="::A"> + <webidl>interface A { + stringifier; +};</webidl> + <Stringifier> + <webidl> stringifier;</webidl> + </Stringifier> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/treatasnull.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/treatasnull.widlprocxml new file mode 100644 index 000000000..a57ae163f --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/treatasnull.widlprocxml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Dog { + attribute DOMString name; + attribute DOMString owner; + + boolean isMemberOfBreed([TreatNullAs=EmptyString] DOMString breedName); +};</webidl> + <Interface name="Dog" id="::Dog"> + <webidl>interface Dog { + attribute DOMString name; + attribute DOMString owner; + + boolean isMemberOfBreed([TreatNullAs=EmptyString] DOMString breedName); +};</webidl> + <Attribute name="name" id="::Dog::name"> + <webidl> attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + <Attribute name="owner" id="::Dog::owner"> + <webidl> attribute DOMString owner;</webidl> + <Type type="DOMString"/> + </Attribute> + <Operation name="isMemberOfBreed" id="::Dog::isMemberOfBreed"> + <webidl> boolean isMemberOfBreed([TreatNullAs=EmptyString] DOMString breedName);</webidl> + <Type type="boolean"/> + <ArgumentList> + <Argument name="breedName"> + <ExtendedAttributeList> + <ExtendedAttribute name="TreatNullAs" value="EmptyString"> + <webidl>TreatNullAs</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/treatasundefined.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/treatasundefined.widlprocxml new file mode 100644 index 000000000..17e71081d --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/treatasundefined.widlprocxml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Cat { + attribute DOMString name; + attribute DOMString owner; + + boolean isMemberOfBreed([TreatUndefinedAs=EmptyString] DOMString breedName); +};</webidl> + <Interface name="Cat" id="::Cat"> + <webidl>interface Cat { + attribute DOMString name; + attribute DOMString owner; + + boolean isMemberOfBreed([TreatUndefinedAs=EmptyString] DOMString breedName); +};</webidl> + <Attribute name="name" id="::Cat::name"> + <webidl> attribute DOMString name;</webidl> + <Type type="DOMString"/> + </Attribute> + <Attribute name="owner" id="::Cat::owner"> + <webidl> attribute DOMString owner;</webidl> + <Type type="DOMString"/> + </Attribute> + <Operation name="isMemberOfBreed" id="::Cat::isMemberOfBreed"> + <webidl> boolean isMemberOfBreed([TreatUndefinedAs=EmptyString] DOMString breedName);</webidl> + <Type type="boolean"/> + <ArgumentList> + <Argument name="breedName"> + <ExtendedAttributeList> + <ExtendedAttribute name="TreatUndefinedAs" value="EmptyString"> + <webidl>TreatUndefinedAs</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + <Type type="DOMString"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/typedef.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/typedef.widlprocxml new file mode 100644 index 000000000..785f6706e --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/typedef.widlprocxml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl> interface Point { + attribute float x; + attribute float y; + }; + + typedef sequence<<ref>Point</ref>> PointSequence; + + interface Rect { + attribute <ref>Point</ref> topleft; + attribute <ref>Point</ref> bottomright; + }; + + interface Widget { + + readonly attribute <ref>Rect</ref> bounds; + + boolean pointWithinBounds(<ref>Point</ref> p); + boolean allPointsWithinBounds(<ref>PointSequence</ref> ps); + }; + + typedef [Clamp] octet value;</webidl> + <Interface name="Point" id="::Point"> + <webidl> interface Point { + attribute float x; + attribute float y; + };</webidl> + <Attribute name="x" id="::Point::x"> + <webidl> attribute float x;</webidl> + <Type type="float"/> + </Attribute> + <Attribute name="y" id="::Point::y"> + <webidl> attribute float y;</webidl> + <Type type="float"/> + </Attribute> + </Interface> + <Typedef name="PointSequence" id="::PointSequence"> + <webidl> typedef sequence<<ref>Point</ref>> PointSequence;</webidl> + <Type type="sequence"> + <Type name="Point"/> + </Type> + </Typedef> + <Interface name="Rect" id="::Rect"> + <webidl> interface Rect { + attribute <ref>Point</ref> topleft; + attribute <ref>Point</ref> bottomright; + };</webidl> + <Attribute name="topleft" id="::Rect::topleft"> + <webidl> attribute <ref>Point</ref> topleft;</webidl> + <Type name="Point"/> + </Attribute> + <Attribute name="bottomright" id="::Rect::bottomright"> + <webidl> attribute <ref>Point</ref> bottomright;</webidl> + <Type name="Point"/> + </Attribute> + </Interface> + <Interface name="Widget" id="::Widget"> + <webidl> interface Widget { + + readonly attribute <ref>Rect</ref> bounds; + + boolean pointWithinBounds(<ref>Point</ref> p); + boolean allPointsWithinBounds(<ref>PointSequence</ref> ps); + };</webidl> + <Attribute readonly="readonly" name="bounds" id="::Widget::bounds"> + <webidl> readonly attribute <ref>Rect</ref> bounds;</webidl> + <Type name="Rect"/> + </Attribute> + <Operation name="pointWithinBounds" id="::Widget::pointWithinBounds"> + <webidl> boolean pointWithinBounds(<ref>Point</ref> p);</webidl> + <Type type="boolean"/> + <ArgumentList> + <Argument name="p"> + <Type name="Point"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="allPointsWithinBounds" id="::Widget::allPointsWithinBounds"> + <webidl> boolean allPointsWithinBounds(<ref>PointSequence</ref> ps);</webidl> + <Type type="boolean"/> + <ArgumentList> + <Argument name="ps"> + <Type name="PointSequence"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> + <Typedef name="value" id="::value"> + <webidl> typedef [Clamp] octet value;</webidl> + <Type type="octet"> + <ExtendedAttributeList> + <ExtendedAttribute name="Clamp"> + <webidl>Clamp</webidl> + </ExtendedAttribute> + </ExtendedAttributeList> + </Type> + </Typedef> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/typesuffixes.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/typesuffixes.widlprocxml new file mode 100644 index 000000000..830fe62bc --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/typesuffixes.widlprocxml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Suffixes { + void test(sequence<DOMString[]?>? foo); +};</webidl> + <Interface name="Suffixes" id="::Suffixes"> + <webidl>interface Suffixes { + void test(sequence<DOMString[]?>? foo); +};</webidl> + <Operation name="test" id="::Suffixes::test"> + <webidl> void test(sequence<DOMString[]?>? foo);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument name="foo"> + <Type type="sequence" nullable="nullable"> + <Type type="array" nullable="nullable"> + <Type type="DOMString"/> + </Type> + </Type> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/uniontype.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/uniontype.widlprocxml new file mode 100644 index 000000000..7d0880799 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/uniontype.widlprocxml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface Union { + attribute (float or (Date or <ref>Event</ref>) or (<ref>Node</ref> or DOMString)?) test; +};</webidl> + <Interface name="Union" id="::Union"> + <webidl>interface Union { + attribute (float or (Date or <ref>Event</ref>) or (<ref>Node</ref> or DOMString)?) test; +};</webidl> + <Attribute name="test" id="::Union::test"> + <webidl> attribute (float or (Date or <ref>Event</ref>) or (<ref>Node</ref> or DOMString)?) test;</webidl> + <Type type="union"> + <Type type="float"/> + <Type type="union"> + <Type type="Date"/> + <Type name="Event"/> + </Type> + <Type type="union" nullable="nullable"> + <Type name="Node"/> + <Type type="DOMString"/> + </Type> + </Type> + </Attribute> + </Interface> +</Definitions> diff --git a/testing/web-platform/tests/WebIDL/valid/xml/variadic-operations.widlprocxml b/testing/web-platform/tests/WebIDL/valid/xml/variadic-operations.widlprocxml new file mode 100644 index 000000000..0bc9f7844 --- /dev/null +++ b/testing/web-platform/tests/WebIDL/valid/xml/variadic-operations.widlprocxml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE Definitions SYSTEM "widlprocxml.dtd"> +<Definitions> + <webidl>interface IntegerSet { + readonly attribute unsigned long cardinality; + + void union(long... ints); + void intersection(long... ints); +};</webidl> + <Interface name="IntegerSet" id="::IntegerSet"> + <webidl>interface IntegerSet { + readonly attribute unsigned long cardinality; + + void union(long... ints); + void intersection(long... ints); +};</webidl> + <Attribute readonly="readonly" name="cardinality" id="::IntegerSet::cardinality"> + <webidl> readonly attribute unsigned long cardinality;</webidl> + <Type type="unsigned long"/> + </Attribute> + <Operation name="union" id="::IntegerSet::union"> + <webidl> void union(long... ints);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument ellipsis="ellipsis" name="ints"> + <Type type="long"/> + </Argument> + </ArgumentList> + </Operation> + <Operation name="intersection" id="::IntegerSet::intersection"> + <webidl> void intersection(long... ints);</webidl> + <Type type="void"/> + <ArgumentList> + <Argument ellipsis="ellipsis" name="ints"> + <Type type="long"/> + </Argument> + </ArgumentList> + </Operation> + </Interface> +</Definitions> |