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):
|
if not isinstance(defaultValue, IDLNullValue):
|
||||||
raise TypeError("Can't handle non-null default value here")
|
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
|
return nullValue
|
||||||
|
|
||||||
# A helper function for wrapping up the template body for
|
# 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
|
assert not isEnforceRange and not isClamp
|
||||||
|
|
||||||
declType = CGGeneric("JSVal")
|
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():
|
if type.isObject():
|
||||||
raise TypeError("Can't handle object arguments yet")
|
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 PassOptionalInterface(&self, _: Option<JSRef<Blob>>) {}
|
||||||
fn PassOptionalUnion(&self, _: Option<HTMLElementOrLong>) {}
|
fn PassOptionalUnion(&self, _: Option<HTMLElementOrLong>) {}
|
||||||
fn PassOptionalUnion2(&self, _: Option<EventOrString>) {}
|
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 PassOptionalNullableBoolean(&self, _: Option<Option<bool>>) {}
|
||||||
fn PassOptionalNullableByte(&self, _: Option<Option<i8>>) {}
|
fn PassOptionalNullableByte(&self, _: Option<Option<i8>>) {}
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[Constructor(DOMString type, optional CustomEventInit eventInitDict),
|
[Constructor(DOMString type, optional CustomEventInit eventInitDict)/*,
|
||||||
Exposed=Window,Worker]
|
Exposed=Window,Worker*/]
|
||||||
interface CustomEvent : Event {
|
interface CustomEvent : Event {
|
||||||
readonly attribute any detail;
|
readonly attribute any detail;
|
||||||
|
|
||||||
|
|
|
@ -14,13 +14,12 @@
|
||||||
interface DOMImplementation {
|
interface DOMImplementation {
|
||||||
/*boolean hasFeature(DOMString feature,
|
/*boolean hasFeature(DOMString feature,
|
||||||
[TreatNullAs=EmptyString] DOMString version);*/
|
[TreatNullAs=EmptyString] DOMString version);*/
|
||||||
[Creator, Throws]
|
[Throws]
|
||||||
DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId,
|
DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId,
|
||||||
DOMString systemId);
|
DOMString systemId);
|
||||||
[Creator, Throws]
|
[Throws]
|
||||||
Document createDocument(DOMString? namespace,
|
Document createDocument(DOMString? namespace,
|
||||||
[TreatNullAs=EmptyString] DOMString qualifiedName,
|
[TreatNullAs=EmptyString] DOMString qualifiedName,
|
||||||
optional DocumentType? doctype = null);
|
optional DocumentType? doctype = null);
|
||||||
[Creator]
|
|
||||||
Document createHTMLDocument(optional DOMString title);
|
Document createHTMLDocument(optional DOMString title);
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,6 +16,6 @@ enum SupportedType {
|
||||||
|
|
||||||
[Constructor]
|
[Constructor]
|
||||||
interface DOMParser {
|
interface DOMParser {
|
||||||
[Creator, Throws]
|
[Throws]
|
||||||
Document parseFromString(DOMString str, SupportedType type);
|
Document parseFromString(DOMString str, SupportedType type);
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,17 +26,14 @@ interface Document : Node {
|
||||||
HTMLCollection getElementsByClassName(DOMString classNames);
|
HTMLCollection getElementsByClassName(DOMString classNames);
|
||||||
Element? getElementById(DOMString elementId);
|
Element? getElementById(DOMString elementId);
|
||||||
|
|
||||||
[Creator, Throws]
|
[Throws]
|
||||||
Element createElement(DOMString localName);
|
Element createElement(DOMString localName);
|
||||||
[Creator, Throws]
|
[Throws]
|
||||||
Element createElementNS(DOMString? namespace, DOMString qualifiedName);
|
Element createElementNS(DOMString? namespace, DOMString qualifiedName);
|
||||||
[Creator]
|
|
||||||
DocumentFragment createDocumentFragment();
|
DocumentFragment createDocumentFragment();
|
||||||
[Creator]
|
|
||||||
Text createTextNode(DOMString data);
|
Text createTextNode(DOMString data);
|
||||||
[Creator]
|
|
||||||
Comment createComment(DOMString data);
|
Comment createComment(DOMString data);
|
||||||
[Creator, Throws]
|
[Throws]
|
||||||
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
|
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
|
||||||
|
|
||||||
[Throws]
|
[Throws]
|
||||||
|
@ -44,7 +41,7 @@ interface Document : Node {
|
||||||
[Throws]
|
[Throws]
|
||||||
Node adoptNode(Node node);
|
Node adoptNode(Node node);
|
||||||
|
|
||||||
[Creator, Throws]
|
[Throws]
|
||||||
Event createEvent(DOMString interface_);
|
Event createEvent(DOMString interface_);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ Navigator implements NavigatorID;
|
||||||
//Navigator implements NavigatorPlugins;
|
//Navigator implements NavigatorPlugins;
|
||||||
|
|
||||||
// http://www.whatwg.org/html/#navigatorid
|
// http://www.whatwg.org/html/#navigatorid
|
||||||
[NoInterfaceObject, Exposed=Window,Worker]
|
[NoInterfaceObject/*, Exposed=Window,Worker*/]
|
||||||
interface NavigatorID {
|
interface NavigatorID {
|
||||||
readonly attribute DOMString appCodeName; // constant "Mozilla"
|
readonly attribute DOMString appCodeName; // constant "Mozilla"
|
||||||
readonly attribute DOMString appName;
|
readonly attribute DOMString appName;
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[Constructor(DOMString type, optional ProgressEventInit eventInitDict),
|
[Constructor(DOMString type, optional ProgressEventInit eventInitDict)/*,
|
||||||
Exposed=Window,Worker]
|
Exposed=Window,Worker*/]
|
||||||
interface ProgressEvent : Event {
|
interface ProgressEvent : Event {
|
||||||
readonly attribute boolean lengthComputable;
|
readonly attribute boolean lengthComputable;
|
||||||
readonly attribute unsigned long long loaded;
|
readonly attribute unsigned long long loaded;
|
||||||
|
@ -25,4 +25,4 @@ dictionary ProgressEventInit : EventInit {
|
||||||
boolean lengthComputable = false;
|
boolean lengthComputable = false;
|
||||||
unsigned long long loaded = 0;
|
unsigned long long loaded = 0;
|
||||||
unsigned long long total = 0;
|
unsigned long long total = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// http://www.whatwg.org/html/#window
|
// http://www.whatwg.org/html/#window
|
||||||
[PrimaryGlobal]
|
//[PrimaryGlobal]
|
||||||
/*sealed*/ interface Window : EventTarget {
|
/*sealed*/ interface Window : EventTarget {
|
||||||
// the current browsing context
|
// the current browsing context
|
||||||
//[Unforgeable] readonly attribute WindowProxy window;
|
//[Unforgeable] readonly attribute WindowProxy window;
|
||||||
|
|
|
@ -22,8 +22,8 @@ enum XMLHttpRequestResponseType {
|
||||||
"text"
|
"text"
|
||||||
};
|
};
|
||||||
|
|
||||||
[Constructor,
|
[Constructor/*,
|
||||||
Exposed=Window,Worker]
|
Exposed=Window,Worker*/]
|
||||||
interface XMLHttpRequest : XMLHttpRequestEventTarget {
|
interface XMLHttpRequest : XMLHttpRequestEventTarget {
|
||||||
// event handler
|
// event handler
|
||||||
attribute EventHandler onreadystatechange;
|
attribute EventHandler onreadystatechange;
|
||||||
|
@ -64,5 +64,5 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget {
|
||||||
readonly attribute any response;
|
readonly attribute any response;
|
||||||
[Throws]
|
[Throws]
|
||||||
readonly attribute DOMString responseText;
|
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.
|
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[Exposed=Window,Worker]
|
//[Exposed=Window,Worker]
|
||||||
interface XMLHttpRequestUpload : XMLHttpRequestEventTarget {
|
interface XMLHttpRequestUpload : XMLHttpRequestEventTarget {
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue