mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Add a script to update the WebIDL parser.
This commit is contained in:
parent
3f17a49564
commit
eb6eee513f
3 changed files with 64 additions and 0 deletions
|
@ -0,0 +1,49 @@
|
||||||
|
--- WebIDL.py
|
||||||
|
+++ WebIDL.py
|
||||||
|
@@ -450,44 +450,8 @@ class IDLIdentifierPlaceholder(IDLObjectWithIdentifier):
|
||||||
|
|
||||||
|
class IDLExternalInterface(IDLObjectWithIdentifier):
|
||||||
|
def __init__(self, location, parentScope, identifier):
|
||||||
|
- assert isinstance(identifier, IDLUnresolvedIdentifier)
|
||||||
|
- assert isinstance(parentScope, IDLScope)
|
||||||
|
- self.parent = None
|
||||||
|
- IDLObjectWithIdentifier.__init__(self, location, parentScope, identifier)
|
||||||
|
- IDLObjectWithIdentifier.resolve(self, parentScope)
|
||||||
|
-
|
||||||
|
- def finish(self, scope):
|
||||||
|
- pass
|
||||||
|
-
|
||||||
|
- def validate(self):
|
||||||
|
- pass
|
||||||
|
-
|
||||||
|
- def isExternal(self):
|
||||||
|
- return True
|
||||||
|
-
|
||||||
|
- def isInterface(self):
|
||||||
|
- return True
|
||||||
|
-
|
||||||
|
- def isConsequential(self):
|
||||||
|
- return False
|
||||||
|
-
|
||||||
|
- def addExtendedAttributes(self, attrs):
|
||||||
|
- assert len(attrs) == 0
|
||||||
|
-
|
||||||
|
- def resolve(self, parentScope):
|
||||||
|
- pass
|
||||||
|
-
|
||||||
|
- def getJSImplementation(self):
|
||||||
|
- return None
|
||||||
|
-
|
||||||
|
- def isJSImplemented(self):
|
||||||
|
- return False
|
||||||
|
-
|
||||||
|
- def getNavigatorProperty(self):
|
||||||
|
- return None
|
||||||
|
-
|
||||||
|
- def _getDependentObjects(self):
|
||||||
|
- return set()
|
||||||
|
+ raise WebIDLError("Servo does not support external interfaces.",
|
||||||
|
+ [self.location])
|
||||||
|
|
||||||
|
class IDLPartialInterface(IDLObject):
|
||||||
|
def __init__(self, location, name, members, nonPartialInterface):
|
|
@ -0,0 +1,12 @@
|
||||||
|
--- WebIDL.py
|
||||||
|
+++ WebIDL.py
|
||||||
|
@@ -3398,6 +3398,9 @@ class IDLCallbackType(IDLType, IDLObjectWithScope):
|
||||||
|
self._treatNonCallableAsNull = False
|
||||||
|
self._treatNonObjectAsNull = False
|
||||||
|
|
||||||
|
+ def module(self):
|
||||||
|
+ return self.location.filename().split('/')[-1].split('.webidl')[0] + 'Binding'
|
||||||
|
+
|
||||||
|
def isCallback(self):
|
||||||
|
return True
|
||||||
|
|
3
src/components/script/dom/bindings/codegen/parser/update.sh
Executable file
3
src/components/script/dom/bindings/codegen/parser/update.sh
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
wget https://mxr.mozilla.org/mozilla-central/source/dom/bindings/parser/WebIDL.py?raw=1 -O WebIDL.py
|
||||||
|
patch < external.patch
|
||||||
|
patch < module.patch
|
Loading…
Add table
Add a link
Reference in a new issue