diff options
author | yvt <i@yvt.jp> | 2021-07-16 01:01:24 +0900 |
---|---|---|
committer | yvt <i@yvt.jp> | 2021-07-16 01:26:05 +0900 |
commit | 41cce140bce74d12d487ff363f0daad54dc7c30f (patch) | |
tree | b49c1cda55c3a2f2f8f623eef407ce9ead8effc7 /components/script/dom/bindings/codegen/Configuration.py | |
parent | 1a033ba8a99bd74fa487a68e81a681441e8eea0b (diff) | |
download | servo-41cce140bce74d12d487ff363f0daad54dc7c30f.tar.gz servo-41cce140bce74d12d487ff363f0daad54dc7c30f.zip |
feat(script): implement some of the non-ordinary internal methods of `Location`
<https://html.spec.whatwg.org/multipage/#the-location-interface>
- `[[GetPrototypeOf]]`: not yet
- `[[SetPrototypeOf]]`: not yet
- `[[IsExtensible]]`: `proxyhandler::is_extensible`
- `[[PreventExtensions]]`: `proxyhandler::prevent_extensions`
- `[[GetOwnProperty]]`: `CGDOMJSProxyHandler_getOwnPropertyDescriptor` (updated)
- `[[DefineOwnProperty]]`: `CGDOMJSProxyHandler_defineProperty` (updated)
- `[[Get]]`: `CGDOMJSProxyHandler_get` (updated)
- `[[Set]]`: not yet
- `[[Delete]]`: `CGDOMJSProxyHandler_delete` (updated)
- `[[OwnPropertyKeys]]`: `CGDOMJSProxyHandler_ownPropertyKeys` (updated)
Diffstat (limited to 'components/script/dom/bindings/codegen/Configuration.py')
-rw-r--r-- | components/script/dom/bindings/codegen/Configuration.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/bindings/codegen/Configuration.py b/components/script/dom/bindings/codegen/Configuration.py index b92f68af3b9..cf6885be265 100644 --- a/components/script/dom/bindings/codegen/Configuration.py +++ b/components/script/dom/bindings/codegen/Configuration.py @@ -299,6 +299,9 @@ class Descriptor(DescriptorProvider): if iface: iface.setUserData('hasConcreteDescendant', True) + if self.isMaybeCrossOriginObject(): + self.proxy = True + if self.proxy: iface = self.interface while iface.parent: @@ -404,6 +407,11 @@ class Descriptor(DescriptorProvider): def supportsIndexedProperties(self): return self.operations['IndexedGetter'] is not None + def isMaybeCrossOriginObject(self): + # If we're isGlobal and have cross-origin members, we're a Window, and + # that's not a cross-origin object. The WindowProxy is. + return self.concrete and self.interface.hasCrossOriginMembers and not self.isGlobal() + def hasDescendants(self): return (self.interface.getUserData("hasConcreteDescendant", False) or self.interface.getUserData("hasProxyDescendant", False)) |