mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
auto merge of #2611 : Ms2ger/servo/webidl-parser-sync, r=jdm
This commit is contained in:
commit
0ff6a45709
12 changed files with 1239 additions and 286 deletions
|
@ -518,7 +518,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
|
|||
if not isinstance(defaultValue, IDLNullValue):
|
||||
raise TypeError("Can't handle non-null default value here")
|
||||
|
||||
assert type.nullable() or type.isAny() or type.isDictionary()
|
||||
assert type.nullable() or type.isDictionary()
|
||||
return nullValue
|
||||
|
||||
# A helper function for wrapping up the template body for
|
||||
|
@ -752,7 +752,17 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
|
|||
assert not isEnforceRange and not isClamp
|
||||
|
||||
declType = CGGeneric("JSVal")
|
||||
return handleOptional("${val}", declType, handleDefaultNull("NullValue()"))
|
||||
|
||||
if defaultValue is None:
|
||||
default = None
|
||||
elif isinstance(defaultValue, IDLNullValue):
|
||||
default = "NullValue()"
|
||||
elif isinstance(defaultValue, IDLUndefinedValue):
|
||||
default = "UndefinedValue()"
|
||||
else:
|
||||
raise TypeError("Can't handle non-null, non-undefined default value here")
|
||||
|
||||
return handleOptional("${val}", declType, default)
|
||||
|
||||
if type.isObject():
|
||||
raise TypeError("Can't handle object arguments yet")
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -191,7 +191,7 @@ pub trait TestBindingMethods {
|
|||
fn PassOptionalInterface(&self, _: Option<JSRef<Blob>>) {}
|
||||
fn PassOptionalUnion(&self, _: Option<HTMLElementOrLong>) {}
|
||||
fn PassOptionalUnion2(&self, _: Option<EventOrString>) {}
|
||||
fn PassOptionalAny(&self, _: *mut JSContext, _: Option<JSVal>) {}
|
||||
fn PassOptionalAny(&self, _: *mut JSContext, _: JSVal) {}
|
||||
|
||||
fn PassOptionalNullableBoolean(&self, _: Option<Option<bool>>) {}
|
||||
fn PassOptionalNullableByte(&self, _: Option<Option<i8>>) {}
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
||||
*/
|
||||
|
||||
[Constructor(DOMString type, optional CustomEventInit eventInitDict),
|
||||
Exposed=Window,Worker]
|
||||
[Constructor(DOMString type, optional CustomEventInit eventInitDict)/*,
|
||||
Exposed=Window,Worker*/]
|
||||
interface CustomEvent : Event {
|
||||
readonly attribute any detail;
|
||||
|
||||
|
|
|
@ -14,13 +14,12 @@
|
|||
interface DOMImplementation {
|
||||
/*boolean hasFeature(DOMString feature,
|
||||
[TreatNullAs=EmptyString] DOMString version);*/
|
||||
[Creator, Throws]
|
||||
[Throws]
|
||||
DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId,
|
||||
DOMString systemId);
|
||||
[Creator, Throws]
|
||||
[Throws]
|
||||
Document createDocument(DOMString? namespace,
|
||||
[TreatNullAs=EmptyString] DOMString qualifiedName,
|
||||
optional DocumentType? doctype = null);
|
||||
[Creator]
|
||||
Document createHTMLDocument(optional DOMString title);
|
||||
};
|
||||
|
|
|
@ -16,6 +16,6 @@ enum SupportedType {
|
|||
|
||||
[Constructor]
|
||||
interface DOMParser {
|
||||
[Creator, Throws]
|
||||
[Throws]
|
||||
Document parseFromString(DOMString str, SupportedType type);
|
||||
};
|
||||
|
|
|
@ -26,17 +26,14 @@ interface Document : Node {
|
|||
HTMLCollection getElementsByClassName(DOMString classNames);
|
||||
Element? getElementById(DOMString elementId);
|
||||
|
||||
[Creator, Throws]
|
||||
[Throws]
|
||||
Element createElement(DOMString localName);
|
||||
[Creator, Throws]
|
||||
[Throws]
|
||||
Element createElementNS(DOMString? namespace, DOMString qualifiedName);
|
||||
[Creator]
|
||||
DocumentFragment createDocumentFragment();
|
||||
[Creator]
|
||||
Text createTextNode(DOMString data);
|
||||
[Creator]
|
||||
Comment createComment(DOMString data);
|
||||
[Creator, Throws]
|
||||
[Throws]
|
||||
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
|
||||
|
||||
[Throws]
|
||||
|
@ -44,7 +41,7 @@ interface Document : Node {
|
|||
[Throws]
|
||||
Node adoptNode(Node node);
|
||||
|
||||
[Creator, Throws]
|
||||
[Throws]
|
||||
Event createEvent(DOMString interface_);
|
||||
};
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ Navigator implements NavigatorID;
|
|||
//Navigator implements NavigatorPlugins;
|
||||
|
||||
// http://www.whatwg.org/html/#navigatorid
|
||||
[NoInterfaceObject, Exposed=Window,Worker]
|
||||
[NoInterfaceObject/*, Exposed=Window,Worker*/]
|
||||
interface NavigatorID {
|
||||
readonly attribute DOMString appCodeName; // constant "Mozilla"
|
||||
readonly attribute DOMString appName;
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
||||
*/
|
||||
|
||||
[Constructor(DOMString type, optional ProgressEventInit eventInitDict),
|
||||
Exposed=Window,Worker]
|
||||
[Constructor(DOMString type, optional ProgressEventInit eventInitDict)/*,
|
||||
Exposed=Window,Worker*/]
|
||||
interface ProgressEvent : Event {
|
||||
readonly attribute boolean lengthComputable;
|
||||
readonly attribute unsigned long long loaded;
|
||||
|
@ -25,4 +25,4 @@ dictionary ProgressEventInit : EventInit {
|
|||
boolean lengthComputable = false;
|
||||
unsigned long long loaded = 0;
|
||||
unsigned long long total = 0;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// http://www.whatwg.org/html/#window
|
||||
[PrimaryGlobal]
|
||||
//[PrimaryGlobal]
|
||||
/*sealed*/ interface Window : EventTarget {
|
||||
// the current browsing context
|
||||
//[Unforgeable] readonly attribute WindowProxy window;
|
||||
|
|
|
@ -22,8 +22,8 @@ enum XMLHttpRequestResponseType {
|
|||
"text"
|
||||
};
|
||||
|
||||
[Constructor,
|
||||
Exposed=Window,Worker]
|
||||
[Constructor/*,
|
||||
Exposed=Window,Worker*/]
|
||||
interface XMLHttpRequest : XMLHttpRequestEventTarget {
|
||||
// event handler
|
||||
attribute EventHandler onreadystatechange;
|
||||
|
@ -64,5 +64,5 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget {
|
|||
readonly attribute any response;
|
||||
[Throws]
|
||||
readonly attribute DOMString responseText;
|
||||
[Exposed=Window] readonly attribute Document? responseXML;
|
||||
/*[Exposed=Window]*/ readonly attribute Document? responseXML;
|
||||
};
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
||||
*/
|
||||
|
||||
[Exposed=Window,Worker]
|
||||
//[Exposed=Window,Worker]
|
||||
interface XMLHttpRequestUpload : XMLHttpRequestEventTarget {
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue