mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Add mach test-webidl command
This commit is contained in:
parent
1483a5de32
commit
18b6817755
6 changed files with 51 additions and 10 deletions
|
@ -501,6 +501,10 @@ class IDLExposureMixins():
|
|||
def isExposedInWindow(self):
|
||||
return 'Window' in self.exposureSet
|
||||
|
||||
def isExposedOnMainThread(self):
|
||||
return (self.isExposedInWindow() or
|
||||
self.isExposedInSystemGlobals())
|
||||
|
||||
def isExposedInAnyWorker(self):
|
||||
return len(self.getWorkerExposureSet()) > 0
|
||||
|
||||
|
@ -564,6 +568,9 @@ class IDLExternalInterface(IDLObjectWithIdentifier, IDLExposureMixins):
|
|||
def isJSImplemented(self):
|
||||
return False
|
||||
|
||||
def isProbablyShortLivingObject(self):
|
||||
return False
|
||||
|
||||
def getNavigatorProperty(self):
|
||||
return None
|
||||
|
||||
|
@ -1409,6 +1416,7 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
|||
identifier == "Unforgeable" or
|
||||
identifier == "UnsafeInPrerendering" or
|
||||
identifier == "LegacyEventInit" or
|
||||
identifier == "ProbablyShortLivingObject" or
|
||||
identifier == "Abstract"):
|
||||
# Known extended attributes that do not take values
|
||||
if not attr.noArguments():
|
||||
|
@ -1523,6 +1531,14 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
|
|||
def isJSImplemented(self):
|
||||
return bool(self.getJSImplementation())
|
||||
|
||||
def isProbablyShortLivingObject(self):
|
||||
current = self
|
||||
while current:
|
||||
if current.getExtendedAttribute("ProbablyShortLivingObject"):
|
||||
return True
|
||||
current = current.parent
|
||||
return False
|
||||
|
||||
def getNavigatorProperty(self):
|
||||
naviProp = self.getExtendedAttribute("NavigatorProperty")
|
||||
if not naviProp:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue