aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorNgo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>2024-06-15 13:22:42 +0900
committerGitHub <noreply@github.com>2024-06-15 04:22:42 +0000
commit8eed3b442b214f678b80dbcc7dca07eeaa1e26ff (patch)
treef8a232e86616e8e5fd234e7bbb32bed4ff7077f2 /components/script
parent19067366df28c9131dcbc436bc96a27e64e0a194 (diff)
downloadservo-8eed3b442b214f678b80dbcc7dca07eeaa1e26ff.tar.gz
servo-8eed3b442b214f678b80dbcc7dca07eeaa1e26ff.zip
Update WebIDL.py (#32495)
* Update WebIDL.py * Update WebIDL.py * Add builtin-array.patch * Fix CodegenRust.py and Configuration.py * Fix missing downcasts * mach fmt * Update check and comment to explain why we need this check * Update Global of DissimilarOriginWindow.webidl
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/bindings/codegen/Configuration.py10
-rw-r--r--components/script/dom/testbinding.rs13
-rw-r--r--components/script/dom/webidls/DissimilarOriginWindow.webidl2
-rw-r--r--components/script/dom/xmlhttprequest.rs2
4 files changed, 13 insertions, 14 deletions
diff --git a/components/script/dom/bindings/codegen/Configuration.py b/components/script/dom/bindings/codegen/Configuration.py
index a220df2b73d..81ebe68d8bb 100644
--- a/components/script/dom/bindings/codegen/Configuration.py
+++ b/components/script/dom/bindings/codegen/Configuration.py
@@ -76,7 +76,7 @@ class Configuration:
for key, val in filters.items():
if key == 'webIDLFile':
def getter(x):
- return x.interface.filename()
+ return x.interface.location.filename
elif key == 'hasInterfaceObject':
def getter(x):
return x.interface.hasInterfaceObject()
@@ -108,10 +108,10 @@ class Configuration:
return curr
def getEnums(self, webIDLFile):
- return [e for e in self.enums if e.filename() == webIDLFile]
+ return [e for e in self.enums if e.filename == webIDLFile]
def getTypedefs(self, webIDLFile):
- return [e for e in self.typedefs if e.filename() == webIDLFile]
+ return [e for e in self.typedefs if e.filename == webIDLFile]
@staticmethod
def _filterForFile(items, webIDLFile=""):
@@ -119,7 +119,7 @@ class Configuration:
if not webIDLFile:
return items
- return [x for x in items if x.filename() == webIDLFile]
+ return [x for x in items if x.filename == webIDLFile]
def getDictionaries(self, webIDLFile=""):
return self._filterForFile(self.dictionaries, webIDLFile=webIDLFile)
@@ -471,7 +471,7 @@ def MakeNativeName(name):
def getIdlFileName(object):
- return os.path.basename(object.location.filename()).split('.webidl')[0]
+ return os.path.basename(object.location.filename).split('.webidl')[0]
def getModuleFromObject(object):
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs
index 13ae19333b5..388af65e23c 100644
--- a/components/script/dom/testbinding.rs
+++ b/components/script/dom/testbinding.rs
@@ -28,11 +28,10 @@ use crate::dom::bindings::codegen::Bindings::TestBindingBinding::{
use crate::dom::bindings::codegen::UnionTypes;
use crate::dom::bindings::codegen::UnionTypes::{
BlobOrBlobSequence, BlobOrBoolean, BlobOrString, BlobOrUnsignedLong, ByteStringOrLong,
- ByteStringSequenceOrLong, ByteStringSequenceOrLongOrString, DocumentOrTestTypedef,
- EventOrString, EventOrUSVString, HTMLElementOrLong, HTMLElementOrUnsignedLongOrStringOrBoolean,
- LongOrLongSequenceSequence, LongSequenceOrBoolean, LongSequenceOrTestTypedef, StringOrBoolean,
- StringOrLongSequence, StringOrStringSequence, StringOrUnsignedLong,
- StringSequenceOrUnsignedLong, UnsignedLongOrBoolean,
+ ByteStringSequenceOrLong, ByteStringSequenceOrLongOrString, EventOrString, EventOrUSVString,
+ HTMLElementOrLong, HTMLElementOrUnsignedLongOrStringOrBoolean, LongOrLongSequenceSequence,
+ LongSequenceOrBoolean, StringOrBoolean, StringOrLongSequence, StringOrStringSequence,
+ StringOrUnsignedLong, StringSequenceOrUnsignedLong, UnsignedLongOrBoolean,
};
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::num::Finite;
@@ -655,8 +654,8 @@ impl TestBindingMethods for TestBinding {
fn PassUnion9(&self, _: UnionTypes::TestDictionaryOrLong) {}
fn PassUnion10(&self, _: SafeJSContext, _: UnionTypes::StringOrObject) {}
fn PassUnion11(&self, _: UnionTypes::ArrayBufferOrArrayBufferView) {}
- fn PassUnionWithTypedef(&self, _: DocumentOrTestTypedef) {}
- fn PassUnionWithTypedef2(&self, _: LongSequenceOrTestTypedef) {}
+ fn PassUnionWithTypedef(&self, _: UnionTypes::DocumentOrStringOrURLOrBlob) {}
+ fn PassUnionWithTypedef2(&self, _: UnionTypes::LongSequenceOrStringOrURLOrBlob) {}
fn PassAny(&self, _: SafeJSContext, _: HandleValue) {}
fn PassObject(&self, _: SafeJSContext, _: *mut JSObject) {}
fn PassCallbackFunction(&self, _: Rc<Function>) {}
diff --git a/components/script/dom/webidls/DissimilarOriginWindow.webidl b/components/script/dom/webidls/DissimilarOriginWindow.webidl
index 0f77aba7d05..bce8bddb572 100644
--- a/components/script/dom/webidls/DissimilarOriginWindow.webidl
+++ b/components/script/dom/webidls/DissimilarOriginWindow.webidl
@@ -13,7 +13,7 @@
// way to enforce security policy.
// https://html.spec.whatwg.org/multipage/#window
-[Global, Exposed=(Window,DissimilarOriginWindow), LegacyNoInterfaceObject]
+[Global=DissimilarOriginWindow, Exposed=(Window,DissimilarOriginWindow), LegacyNoInterfaceObject]
interface DissimilarOriginWindow : GlobalScope {
[LegacyUnforgeable] readonly attribute WindowProxy window;
[BinaryName="Self_", Replaceable] readonly attribute WindowProxy self;
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index e9966f22774..9b4e5b2cbdc 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -46,7 +46,7 @@ use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use crate::dom::bindings::codegen::Bindings::XMLHttpRequestBinding::{
XMLHttpRequestMethods, XMLHttpRequestResponseType,
};
-use crate::dom::bindings::codegen::UnionTypes::DocumentOrXMLHttpRequestBodyInit;
+use crate::dom::bindings::codegen::UnionTypes::DocumentOrBlobOrArrayBufferViewOrArrayBufferOrFormDataOrStringOrURLSearchParams as DocumentOrXMLHttpRequestBodyInit;
use crate::dom::bindings::conversions::ToJSValConvertible;
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
use crate::dom::bindings::inheritance::Castable;