mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Introduce [Abstract] to mark non-leaf interfaces
Some interfaces like Node, CharacterData and HTMLTableCellElement are never instantiated directly, only their descendant interfaces are. Those are marked with [Abstract] to set their type_id to None instead of having dummy values in the TypeId enums.
This commit is contained in:
parent
941f7dc04b
commit
c25085f68a
21 changed files with 26 additions and 48 deletions
|
@ -1724,7 +1724,7 @@ class CGNamespace(CGWrapper):
|
|||
|
||||
def EventTargetEnum(desc):
|
||||
protochain = desc.prototypeChain
|
||||
if protochain[0] != "EventTarget":
|
||||
if protochain[0] != "EventTarget" or desc.interface.getExtendedAttribute("Abstract"):
|
||||
return "None"
|
||||
|
||||
inner = ""
|
||||
|
|
|
@ -1357,7 +1357,8 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
|||
identifier == "ChromeOnly" or
|
||||
identifier == "Unforgeable" or
|
||||
identifier == "UnsafeInPrerendering" or
|
||||
identifier == "LegacyEventInit"):
|
||||
identifier == "LegacyEventInit" or
|
||||
identifier == "Abstract"):
|
||||
# Known extended attributes that do not take values
|
||||
if not attr.noArguments():
|
||||
raise WebIDLError("[%s] must take no arguments" % identifier,
|
||||
|
|
12
components/script/dom/bindings/codegen/parser/abstract.patch
Normal file
12
components/script/dom/bindings/codegen/parser/abstract.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
--- WebIDL.py
|
||||
+++ WebIDL.py
|
||||
@@ -1357,7 +1357,8 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
||||
identifier == "ChromeOnly" or
|
||||
identifier == "Unforgeable" or
|
||||
identifier == "UnsafeInPrerendering" or
|
||||
- identifier == "LegacyEventInit"):
|
||||
+ identifier == "LegacyEventInit" or
|
||||
+ identifier == "Abstract"):
|
||||
# Known extended attributes that do not take values
|
||||
if not attr.noArguments():
|
||||
raise WebIDLError("[%s] must take no arguments" % identifier,
|
|
@ -1,3 +1,4 @@
|
|||
wget https://mxr.mozilla.org/mozilla-central/source/dom/bindings/parser/WebIDL.py?raw=1 -O WebIDL.py
|
||||
patch < external.patch
|
||||
patch < module.patch
|
||||
patch < abstract.patch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue