mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Auto merge of #20518 - servo:webgl, r=emilio
Some minor WebGL improvements <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20518) <!-- Reviewable:end -->
This commit is contained in:
commit
122bfa03e1
22 changed files with 341 additions and 615 deletions
|
@ -4800,7 +4800,7 @@ class CGProxySpecialOperation(CGPerSignatureCall):
|
||||||
False, descriptor, operation,
|
False, descriptor, operation,
|
||||||
len(arguments))
|
len(arguments))
|
||||||
|
|
||||||
if operation.isSetter() or operation.isCreator():
|
if operation.isSetter():
|
||||||
# arguments[0] is the index or name of the item that we're setting.
|
# arguments[0] is the index or name of the item that we're setting.
|
||||||
argument = arguments[1]
|
argument = arguments[1]
|
||||||
info = getJSToNativeConversionInfo(
|
info = getJSToNativeConversionInfo(
|
||||||
|
|
|
@ -279,8 +279,6 @@ class Descriptor(DescriptorProvider):
|
||||||
addIndexedOrNamedOperation('Getter', m)
|
addIndexedOrNamedOperation('Getter', m)
|
||||||
if m.isSetter():
|
if m.isSetter():
|
||||||
addIndexedOrNamedOperation('Setter', m)
|
addIndexedOrNamedOperation('Setter', m)
|
||||||
if m.isCreator():
|
|
||||||
addIndexedOrNamedOperation('Creator', m)
|
|
||||||
if m.isDeleter():
|
if m.isDeleter():
|
||||||
addIndexedOrNamedOperation('Deleter', m)
|
addIndexedOrNamedOperation('Deleter', m)
|
||||||
|
|
||||||
|
|
|
@ -1095,12 +1095,12 @@ class IDLInterfaceOrNamespace(IDLObjectWithScope, IDLExposureMixins):
|
||||||
testInterface = testInterface.parent
|
testInterface = testInterface.parent
|
||||||
|
|
||||||
# Ensure that there's at most one of each {named,indexed}
|
# Ensure that there's at most one of each {named,indexed}
|
||||||
# {getter,setter,creator,deleter}, at most one stringifier,
|
# {getter,setter,deleter}, at most one stringifier,
|
||||||
# and at most one legacycaller. Note that this last is not
|
# and at most one legacycaller. Note that this last is not
|
||||||
# quite per spec, but in practice no one overloads
|
# quite per spec, but in practice no one overloads
|
||||||
# legacycallers. Also note that in practice we disallow
|
# legacycallers. Also note that in practice we disallow
|
||||||
# indexed deleters, but it simplifies some other code to
|
# indexed deleters, but it simplifies some other code to
|
||||||
# treat deleter analogously to getter/setter/creator by
|
# treat deleter analogously to getter/setter by
|
||||||
# prefixing it with "named".
|
# prefixing it with "named".
|
||||||
specialMembersSeen = {}
|
specialMembersSeen = {}
|
||||||
for member in self.members:
|
for member in self.members:
|
||||||
|
@ -1111,8 +1111,6 @@ class IDLInterfaceOrNamespace(IDLObjectWithScope, IDLExposureMixins):
|
||||||
memberType = "getters"
|
memberType = "getters"
|
||||||
elif member.isSetter():
|
elif member.isSetter():
|
||||||
memberType = "setters"
|
memberType = "setters"
|
||||||
elif member.isCreator():
|
|
||||||
memberType = "creators"
|
|
||||||
elif member.isDeleter():
|
elif member.isDeleter():
|
||||||
memberType = "deleters"
|
memberType = "deleters"
|
||||||
elif member.isStringifier():
|
elif member.isStringifier():
|
||||||
|
@ -1158,8 +1156,8 @@ class IDLInterfaceOrNamespace(IDLObjectWithScope, IDLExposureMixins):
|
||||||
ancestor = ancestor.parent
|
ancestor = ancestor.parent
|
||||||
|
|
||||||
if self._isOnGlobalProtoChain:
|
if self._isOnGlobalProtoChain:
|
||||||
# Make sure we have no named setters, creators, or deleters
|
# Make sure we have no named setters or deleters
|
||||||
for memberType in ["setter", "creator", "deleter"]:
|
for memberType in ["setter", "deleter"]:
|
||||||
memberId = "named " + memberType + "s"
|
memberId = "named " + memberType + "s"
|
||||||
if memberId in specialMembersSeen:
|
if memberId in specialMembersSeen:
|
||||||
raise WebIDLError("Interface with [Global] has a named %s" %
|
raise WebIDLError("Interface with [Global] has a named %s" %
|
||||||
|
@ -1183,6 +1181,22 @@ class IDLInterfaceOrNamespace(IDLObjectWithScope, IDLExposureMixins):
|
||||||
parent = parent.parent
|
parent = parent.parent
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
|
||||||
|
def checkDuplicateNames(member, name, attributeName):
|
||||||
|
for m in self.members:
|
||||||
|
if m.identifier.name == name:
|
||||||
|
raise WebIDLError("[%s=%s] has same name as interface member" %
|
||||||
|
(attributeName, name),
|
||||||
|
[member.location, m.location])
|
||||||
|
if m.isMethod() and m != member and name in m.aliases:
|
||||||
|
raise WebIDLError("conflicting [%s=%s] definitions" %
|
||||||
|
(attributeName, name),
|
||||||
|
[member.location, m.location])
|
||||||
|
if m.isAttr() and m != member and name in m.bindingAliases:
|
||||||
|
raise WebIDLError("conflicting [%s=%s] definitions" %
|
||||||
|
(attributeName, name),
|
||||||
|
[member.location, m.location])
|
||||||
|
|
||||||
# We don't support consequential unforgeable interfaces. Need to check
|
# We don't support consequential unforgeable interfaces. Need to check
|
||||||
# this here, because in finish() an interface might not know yet that
|
# this here, because in finish() an interface might not know yet that
|
||||||
# it's consequential.
|
# it's consequential.
|
||||||
|
@ -1295,15 +1309,15 @@ class IDLInterfaceOrNamespace(IDLObjectWithScope, IDLExposureMixins):
|
||||||
raise WebIDLError("[Alias] must not be used on an "
|
raise WebIDLError("[Alias] must not be used on an "
|
||||||
"[Unforgeable] operation",
|
"[Unforgeable] operation",
|
||||||
[member.location])
|
[member.location])
|
||||||
for m in self.members:
|
|
||||||
if m.identifier.name == alias:
|
checkDuplicateNames(member, alias, "Alias")
|
||||||
raise WebIDLError("[Alias=%s] has same name as "
|
|
||||||
"interface member" % alias,
|
# Check that the name of a [BindingAlias] doesn't conflict with an
|
||||||
[member.location, m.location])
|
# interface member.
|
||||||
if m.isMethod() and m != member and alias in m.aliases:
|
if member.isAttr():
|
||||||
raise WebIDLError("duplicate [Alias=%s] definitions" %
|
for bindingAlias in member.bindingAliases:
|
||||||
alias,
|
checkDuplicateNames(member, bindingAlias, "BindingAlias")
|
||||||
[member.location, m.location])
|
|
||||||
|
|
||||||
# Conditional exposure makes no sense for interfaces with no
|
# Conditional exposure makes no sense for interfaces with no
|
||||||
# interface object, unless they're navigator properties.
|
# interface object, unless they're navigator properties.
|
||||||
|
@ -1720,10 +1734,10 @@ class IDLInterface(IDLInterfaceOrNamespace):
|
||||||
identifier == "OverrideBuiltins" or
|
identifier == "OverrideBuiltins" or
|
||||||
identifier == "ChromeOnly" or
|
identifier == "ChromeOnly" or
|
||||||
identifier == "Unforgeable" or
|
identifier == "Unforgeable" or
|
||||||
identifier == "UnsafeInPrerendering" or
|
|
||||||
identifier == "LegacyEventInit" or
|
identifier == "LegacyEventInit" or
|
||||||
identifier == "ProbablyShortLivingWrapper" or
|
identifier == "ProbablyShortLivingWrapper" or
|
||||||
identifier == "LegacyUnenumerableNamedProperties" or
|
identifier == "LegacyUnenumerableNamedProperties" or
|
||||||
|
identifier == "RunConstructorInCallerCompartment" or
|
||||||
identifier == "NonOrdinaryGetPrototypeOf" or
|
identifier == "NonOrdinaryGetPrototypeOf" or
|
||||||
identifier == "Abstract" or
|
identifier == "Abstract" or
|
||||||
identifier == "Inline"):
|
identifier == "Inline"):
|
||||||
|
@ -1780,10 +1794,16 @@ class IDLNamespace(IDLInterfaceOrNamespace):
|
||||||
if not attr.hasValue():
|
if not attr.hasValue():
|
||||||
raise WebIDLError("[%s] must have a value" % identifier,
|
raise WebIDLError("[%s] must have a value" % identifier,
|
||||||
[attr.location])
|
[attr.location])
|
||||||
elif identifier == "ProtoObjectHack":
|
elif (identifier == "ProtoObjectHack" or
|
||||||
|
identifier == "ChromeOnly"):
|
||||||
if not attr.noArguments():
|
if not attr.noArguments():
|
||||||
raise WebIDLError("[%s] must not have arguments" % identifier,
|
raise WebIDLError("[%s] must not have arguments" % identifier,
|
||||||
[attr.location])
|
[attr.location])
|
||||||
|
elif identifier == "Pref":
|
||||||
|
# Known extended attributes that take a string value
|
||||||
|
if not attr.hasValue():
|
||||||
|
raise WebIDLError("[%s] must have a value" % identifier,
|
||||||
|
[attr.location])
|
||||||
else:
|
else:
|
||||||
raise WebIDLError("Unknown extended attribute %s on namespace" %
|
raise WebIDLError("Unknown extended attribute %s on namespace" %
|
||||||
identifier,
|
identifier,
|
||||||
|
@ -3581,6 +3601,11 @@ class IDLInterfaceMember(IDLObjectWithIdentifier, IDLExposureMixins):
|
||||||
[self.location])
|
[self.location])
|
||||||
self.aliases.append(alias)
|
self.aliases.append(alias)
|
||||||
|
|
||||||
|
def _addBindingAlias(self, bindingAlias):
|
||||||
|
if bindingAlias in self.bindingAliases:
|
||||||
|
raise WebIDLError("Duplicate [BindingAlias=%s] on attribute" % bindingAlias,
|
||||||
|
[self.location])
|
||||||
|
self.bindingAliases.append(bindingAlias)
|
||||||
|
|
||||||
class IDLMaplikeOrSetlikeOrIterableBase(IDLInterfaceMember):
|
class IDLMaplikeOrSetlikeOrIterableBase(IDLInterfaceMember):
|
||||||
|
|
||||||
|
@ -3701,6 +3726,11 @@ class IDLMaplikeOrSetlikeOrIterableBase(IDLInterfaceMember):
|
||||||
if isIteratorAlias:
|
if isIteratorAlias:
|
||||||
method.addExtendedAttributes(
|
method.addExtendedAttributes(
|
||||||
[IDLExtendedAttribute(self.location, ("Alias", "@@iterator"))])
|
[IDLExtendedAttribute(self.location, ("Alias", "@@iterator"))])
|
||||||
|
# Methods generated for iterables should be enumerable, but the ones for
|
||||||
|
# maplike/setlike should not be.
|
||||||
|
if not self.isIterable():
|
||||||
|
method.addExtendedAttributes(
|
||||||
|
[IDLExtendedAttribute(self.location, ("NonEnumerable",))])
|
||||||
members.append(method)
|
members.append(method)
|
||||||
|
|
||||||
def resolve(self, parentScope):
|
def resolve(self, parentScope):
|
||||||
|
@ -3824,11 +3854,15 @@ class IDLMaplikeOrSetlike(IDLMaplikeOrSetlikeOrIterableBase):
|
||||||
specification during parsing.
|
specification during parsing.
|
||||||
"""
|
"""
|
||||||
# Both maplike and setlike have a size attribute
|
# Both maplike and setlike have a size attribute
|
||||||
members.append(IDLAttribute(self.location,
|
sizeAttr = IDLAttribute(self.location,
|
||||||
IDLUnresolvedIdentifier(BuiltinLocation("<auto-generated-identifier>"), "size"),
|
IDLUnresolvedIdentifier(BuiltinLocation("<auto-generated-identifier>"), "size"),
|
||||||
BuiltinTypes[IDLBuiltinType.Types.unsigned_long],
|
BuiltinTypes[IDLBuiltinType.Types.unsigned_long],
|
||||||
True,
|
True,
|
||||||
maplikeOrSetlike=self))
|
maplikeOrSetlike=self)
|
||||||
|
# This should be non-enumerable.
|
||||||
|
sizeAttr.addExtendedAttributes(
|
||||||
|
[IDLExtendedAttribute(self.location, ("NonEnumerable",))])
|
||||||
|
members.append(sizeAttr)
|
||||||
self.reserved_ro_names = ["size"]
|
self.reserved_ro_names = ["size"]
|
||||||
self.disallowedMemberNames.append("size")
|
self.disallowedMemberNames.append("size")
|
||||||
|
|
||||||
|
@ -3964,7 +3998,9 @@ class IDLConst(IDLInterfaceMember):
|
||||||
elif (identifier == "Pref" or
|
elif (identifier == "Pref" or
|
||||||
identifier == "ChromeOnly" or
|
identifier == "ChromeOnly" or
|
||||||
identifier == "Func" or
|
identifier == "Func" or
|
||||||
identifier == "SecureContext"):
|
identifier == "SecureContext" or
|
||||||
|
identifier == "NonEnumerable" or
|
||||||
|
identifier == "NeedsWindowsUndef"):
|
||||||
# Known attributes that we don't need to do anything with here
|
# Known attributes that we don't need to do anything with here
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -4000,6 +4036,7 @@ class IDLAttribute(IDLInterfaceMember):
|
||||||
self.dependsOn = "Everything"
|
self.dependsOn = "Everything"
|
||||||
self.affects = "Everything"
|
self.affects = "Everything"
|
||||||
self.navigatorObjectGetter = navigatorObjectGetter
|
self.navigatorObjectGetter = navigatorObjectGetter
|
||||||
|
self.bindingAliases = []
|
||||||
|
|
||||||
if static and identifier.name == "prototype":
|
if static and identifier.name == "prototype":
|
||||||
raise WebIDLError("The identifier of a static attribute must not be 'prototype'",
|
raise WebIDLError("The identifier of a static attribute must not be 'prototype'",
|
||||||
|
@ -4138,11 +4175,17 @@ class IDLAttribute(IDLInterfaceMember):
|
||||||
|
|
||||||
def handleExtendedAttribute(self, attr):
|
def handleExtendedAttribute(self, attr):
|
||||||
identifier = attr.identifier()
|
identifier = attr.identifier()
|
||||||
if ((identifier == "SetterThrows" or identifier == "SetterCanOOM")
|
if ((identifier == "SetterThrows" or identifier == "SetterCanOOM" or
|
||||||
|
identifier == "SetterNeedsSubjectPrincipal")
|
||||||
and self.readonly):
|
and self.readonly):
|
||||||
raise WebIDLError("Readonly attributes must not be flagged as "
|
raise WebIDLError("Readonly attributes must not be flagged as "
|
||||||
"[%s]" % identifier,
|
"[%s]" % identifier,
|
||||||
[self.location])
|
[self.location])
|
||||||
|
elif identifier == "BindingAlias":
|
||||||
|
if not attr.hasValue():
|
||||||
|
raise WebIDLError("[BindingAlias] takes an identifier or string",
|
||||||
|
[attr.location])
|
||||||
|
self._addBindingAlias(attr.value())
|
||||||
elif (((identifier == "Throws" or identifier == "GetterThrows" or
|
elif (((identifier == "Throws" or identifier == "GetterThrows" or
|
||||||
identifier == "CanOOM" or identifier == "GetterCanOOM") and
|
identifier == "CanOOM" or identifier == "GetterCanOOM") and
|
||||||
self.getExtendedAttribute("StoreInSlot")) or
|
self.getExtendedAttribute("StoreInSlot")) or
|
||||||
|
@ -4338,11 +4381,13 @@ class IDLAttribute(IDLInterfaceMember):
|
||||||
identifier == "SecureContext" or
|
identifier == "SecureContext" or
|
||||||
identifier == "Frozen" or
|
identifier == "Frozen" or
|
||||||
identifier == "NewObject" or
|
identifier == "NewObject" or
|
||||||
identifier == "UnsafeInPrerendering" or
|
|
||||||
identifier == "NeedsSubjectPrincipal" or
|
identifier == "NeedsSubjectPrincipal" or
|
||||||
|
identifier == "SetterNeedsSubjectPrincipal" or
|
||||||
|
identifier == "GetterNeedsSubjectPrincipal" or
|
||||||
identifier == "NeedsCallerType" or
|
identifier == "NeedsCallerType" or
|
||||||
identifier == "ReturnValueNeedsContainsHack" or
|
identifier == "ReturnValueNeedsContainsHack" or
|
||||||
identifier == "BinaryName"):
|
identifier == "BinaryName" or
|
||||||
|
identifier == "NonEnumerable"):
|
||||||
# Known attributes that we don't need to do anything with here
|
# Known attributes that we don't need to do anything with here
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -4606,7 +4651,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
Special = enum(
|
Special = enum(
|
||||||
'Getter',
|
'Getter',
|
||||||
'Setter',
|
'Setter',
|
||||||
'Creator',
|
|
||||||
'Deleter',
|
'Deleter',
|
||||||
'LegacyCaller',
|
'LegacyCaller',
|
||||||
base=IDLInterfaceMember.Special
|
base=IDLInterfaceMember.Special
|
||||||
|
@ -4619,7 +4663,7 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, location, identifier, returnType, arguments,
|
def __init__(self, location, identifier, returnType, arguments,
|
||||||
static=False, getter=False, setter=False, creator=False,
|
static=False, getter=False, setter=False,
|
||||||
deleter=False, specialType=NamedOrIndexed.Neither,
|
deleter=False, specialType=NamedOrIndexed.Neither,
|
||||||
legacycaller=False, stringifier=False, jsonifier=False,
|
legacycaller=False, stringifier=False, jsonifier=False,
|
||||||
maplikeOrSetlikeOrIterable=None, htmlConstructor=False):
|
maplikeOrSetlikeOrIterable=None, htmlConstructor=False):
|
||||||
|
@ -4640,8 +4684,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
self._getter = getter
|
self._getter = getter
|
||||||
assert isinstance(setter, bool)
|
assert isinstance(setter, bool)
|
||||||
self._setter = setter
|
self._setter = setter
|
||||||
assert isinstance(creator, bool)
|
|
||||||
self._creator = creator
|
|
||||||
assert isinstance(deleter, bool)
|
assert isinstance(deleter, bool)
|
||||||
self._deleter = deleter
|
self._deleter = deleter
|
||||||
assert isinstance(legacycaller, bool)
|
assert isinstance(legacycaller, bool)
|
||||||
|
@ -4682,7 +4724,7 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
assert not arguments[0].optional and not arguments[0].variadic
|
assert not arguments[0].optional and not arguments[0].variadic
|
||||||
assert not self._getter or not overload.returnType.isVoid()
|
assert not self._getter or not overload.returnType.isVoid()
|
||||||
|
|
||||||
if self._setter or self._creator:
|
if self._setter:
|
||||||
assert len(self._overloads) == 1
|
assert len(self._overloads) == 1
|
||||||
arguments = self._overloads[0].arguments
|
arguments = self._overloads[0].arguments
|
||||||
assert len(arguments) == 2
|
assert len(arguments) == 2
|
||||||
|
@ -4715,9 +4757,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
def isSetter(self):
|
def isSetter(self):
|
||||||
return self._setter
|
return self._setter
|
||||||
|
|
||||||
def isCreator(self):
|
|
||||||
return self._creator
|
|
||||||
|
|
||||||
def isDeleter(self):
|
def isDeleter(self):
|
||||||
return self._deleter
|
return self._deleter
|
||||||
|
|
||||||
|
@ -4750,7 +4789,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
def isSpecial(self):
|
def isSpecial(self):
|
||||||
return (self.isGetter() or
|
return (self.isGetter() or
|
||||||
self.isSetter() or
|
self.isSetter() or
|
||||||
self.isCreator() or
|
|
||||||
self.isDeleter() or
|
self.isDeleter() or
|
||||||
self.isLegacycaller() or
|
self.isLegacycaller() or
|
||||||
self.isStringifier() or
|
self.isStringifier() or
|
||||||
|
@ -4806,8 +4844,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
assert not method.isGetter()
|
assert not method.isGetter()
|
||||||
assert not self.isSetter()
|
assert not self.isSetter()
|
||||||
assert not method.isSetter()
|
assert not method.isSetter()
|
||||||
assert not self.isCreator()
|
|
||||||
assert not method.isCreator()
|
|
||||||
assert not self.isDeleter()
|
assert not self.isDeleter()
|
||||||
assert not method.isDeleter()
|
assert not method.isDeleter()
|
||||||
assert not self.isStringifier()
|
assert not self.isStringifier()
|
||||||
|
@ -4984,7 +5020,9 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
if (identifier == "GetterThrows" or
|
if (identifier == "GetterThrows" or
|
||||||
identifier == "SetterThrows" or
|
identifier == "SetterThrows" or
|
||||||
identifier == "GetterCanOOM" or
|
identifier == "GetterCanOOM" or
|
||||||
identifier == "SetterCanOOM"):
|
identifier == "SetterCanOOM" or
|
||||||
|
identifier == "SetterNeedsSubjectPrincipal" or
|
||||||
|
identifier == "GetterNeedsSubjectPrincipal"):
|
||||||
raise WebIDLError("Methods must not be flagged as "
|
raise WebIDLError("Methods must not be flagged as "
|
||||||
"[%s]" % identifier,
|
"[%s]" % identifier,
|
||||||
[attr.location, self.location])
|
[attr.location, self.location])
|
||||||
|
@ -5071,7 +5109,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
identifier == "CanOOM" or
|
identifier == "CanOOM" or
|
||||||
identifier == "NewObject" or
|
identifier == "NewObject" or
|
||||||
identifier == "ChromeOnly" or
|
identifier == "ChromeOnly" or
|
||||||
identifier == "UnsafeInPrerendering" or
|
|
||||||
identifier == "Pref" or
|
identifier == "Pref" or
|
||||||
identifier == "Deprecated" or
|
identifier == "Deprecated" or
|
||||||
identifier == "Func" or
|
identifier == "Func" or
|
||||||
|
@ -5079,7 +5116,8 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
|
||||||
identifier == "BinaryName" or
|
identifier == "BinaryName" or
|
||||||
identifier == "NeedsSubjectPrincipal" or
|
identifier == "NeedsSubjectPrincipal" or
|
||||||
identifier == "NeedsCallerType" or
|
identifier == "NeedsCallerType" or
|
||||||
identifier == "StaticClassOverride"):
|
identifier == "StaticClassOverride" or
|
||||||
|
identifier == "NonEnumerable"):
|
||||||
# Known attributes that we don't need to do anything with here
|
# Known attributes that we don't need to do anything with here
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -5262,7 +5300,6 @@ class Tokenizer(object):
|
||||||
"static": "STATIC",
|
"static": "STATIC",
|
||||||
"getter": "GETTER",
|
"getter": "GETTER",
|
||||||
"setter": "SETTER",
|
"setter": "SETTER",
|
||||||
"creator": "CREATOR",
|
|
||||||
"deleter": "DELETER",
|
"deleter": "DELETER",
|
||||||
"legacycaller": "LEGACYCALLER",
|
"legacycaller": "LEGACYCALLER",
|
||||||
"optional": "OPTIONAL",
|
"optional": "OPTIONAL",
|
||||||
|
@ -5977,13 +6014,12 @@ class Parser(Tokenizer):
|
||||||
|
|
||||||
getter = True if IDLMethod.Special.Getter in p[1] else False
|
getter = True if IDLMethod.Special.Getter in p[1] else False
|
||||||
setter = True if IDLMethod.Special.Setter in p[1] else False
|
setter = True if IDLMethod.Special.Setter in p[1] else False
|
||||||
creator = True if IDLMethod.Special.Creator in p[1] else False
|
|
||||||
deleter = True if IDLMethod.Special.Deleter in p[1] else False
|
deleter = True if IDLMethod.Special.Deleter in p[1] else False
|
||||||
legacycaller = True if IDLMethod.Special.LegacyCaller in p[1] else False
|
legacycaller = True if IDLMethod.Special.LegacyCaller in p[1] else False
|
||||||
|
|
||||||
if getter or deleter:
|
if getter or deleter:
|
||||||
if setter or creator:
|
if setter:
|
||||||
raise WebIDLError("getter and deleter are incompatible with setter and creator",
|
raise WebIDLError("getter and deleter are incompatible with setter",
|
||||||
[self.getLocation(p, 1)])
|
[self.getLocation(p, 1)])
|
||||||
|
|
||||||
(returnType, identifier, arguments) = p[2]
|
(returnType, identifier, arguments) = p[2]
|
||||||
|
@ -6018,10 +6054,9 @@ class Parser(Tokenizer):
|
||||||
if returnType.isVoid():
|
if returnType.isVoid():
|
||||||
raise WebIDLError("getter cannot have void return type",
|
raise WebIDLError("getter cannot have void return type",
|
||||||
[self.getLocation(p, 2)])
|
[self.getLocation(p, 2)])
|
||||||
if setter or creator:
|
if setter:
|
||||||
if len(arguments) != 2:
|
if len(arguments) != 2:
|
||||||
raise WebIDLError("%s has wrong number of arguments" %
|
raise WebIDLError("setter has wrong number of arguments",
|
||||||
("setter" if setter else "creator"),
|
|
||||||
[self.getLocation(p, 2)])
|
[self.getLocation(p, 2)])
|
||||||
argType = arguments[0].type
|
argType = arguments[0].type
|
||||||
if argType == BuiltinTypes[IDLBuiltinType.Types.domstring]:
|
if argType == BuiltinTypes[IDLBuiltinType.Types.domstring]:
|
||||||
|
@ -6029,18 +6064,15 @@ class Parser(Tokenizer):
|
||||||
elif argType == BuiltinTypes[IDLBuiltinType.Types.unsigned_long]:
|
elif argType == BuiltinTypes[IDLBuiltinType.Types.unsigned_long]:
|
||||||
specialType = IDLMethod.NamedOrIndexed.Indexed
|
specialType = IDLMethod.NamedOrIndexed.Indexed
|
||||||
else:
|
else:
|
||||||
raise WebIDLError("%s has wrong argument type (must be DOMString or UnsignedLong)" %
|
raise WebIDLError("settter has wrong argument type (must be DOMString or UnsignedLong)",
|
||||||
("setter" if setter else "creator"),
|
|
||||||
[arguments[0].location])
|
[arguments[0].location])
|
||||||
if arguments[0].optional or arguments[0].variadic:
|
if arguments[0].optional or arguments[0].variadic:
|
||||||
raise WebIDLError("%s cannot have %s argument" %
|
raise WebIDLError("setter cannot have %s argument" %
|
||||||
("setter" if setter else "creator",
|
("optional" if arguments[0].optional else "variadic"),
|
||||||
"optional" if arguments[0].optional else "variadic"),
|
|
||||||
[arguments[0].location])
|
[arguments[0].location])
|
||||||
if arguments[1].optional or arguments[1].variadic:
|
if arguments[1].optional or arguments[1].variadic:
|
||||||
raise WebIDLError("%s cannot have %s argument" %
|
raise WebIDLError("setter cannot have %s argument" %
|
||||||
("setter" if setter else "creator",
|
("optional" if arguments[1].optional else "variadic"),
|
||||||
"optional" if arguments[1].optional else "variadic"),
|
|
||||||
[arguments[1].location])
|
[arguments[1].location])
|
||||||
|
|
||||||
if stringifier:
|
if stringifier:
|
||||||
|
@ -6053,7 +6085,7 @@ class Parser(Tokenizer):
|
||||||
|
|
||||||
# identifier might be None. This is only permitted for special methods.
|
# identifier might be None. This is only permitted for special methods.
|
||||||
if not identifier:
|
if not identifier:
|
||||||
if (not getter and not setter and not creator and
|
if (not getter and not setter and
|
||||||
not deleter and not legacycaller and not stringifier):
|
not deleter and not legacycaller and not stringifier):
|
||||||
raise WebIDLError("Identifier required for non-special methods",
|
raise WebIDLError("Identifier required for non-special methods",
|
||||||
[self.getLocation(p, 2)])
|
[self.getLocation(p, 2)])
|
||||||
|
@ -6061,19 +6093,18 @@ class Parser(Tokenizer):
|
||||||
location = BuiltinLocation("<auto-generated-identifier>")
|
location = BuiltinLocation("<auto-generated-identifier>")
|
||||||
identifier = IDLUnresolvedIdentifier(
|
identifier = IDLUnresolvedIdentifier(
|
||||||
location,
|
location,
|
||||||
"__%s%s%s%s%s%s%s" %
|
"__%s%s%s%s%s%s" %
|
||||||
("named" if specialType == IDLMethod.NamedOrIndexed.Named else
|
("named" if specialType == IDLMethod.NamedOrIndexed.Named else
|
||||||
"indexed" if specialType == IDLMethod.NamedOrIndexed.Indexed else "",
|
"indexed" if specialType == IDLMethod.NamedOrIndexed.Indexed else "",
|
||||||
"getter" if getter else "",
|
"getter" if getter else "",
|
||||||
"setter" if setter else "",
|
"setter" if setter else "",
|
||||||
"deleter" if deleter else "",
|
"deleter" if deleter else "",
|
||||||
"creator" if creator else "",
|
|
||||||
"legacycaller" if legacycaller else "",
|
"legacycaller" if legacycaller else "",
|
||||||
"stringifier" if stringifier else ""),
|
"stringifier" if stringifier else ""),
|
||||||
allowDoubleUnderscore=True)
|
allowDoubleUnderscore=True)
|
||||||
|
|
||||||
method = IDLMethod(self.getLocation(p, 2), identifier, returnType, arguments,
|
method = IDLMethod(self.getLocation(p, 2), identifier, returnType, arguments,
|
||||||
static=static, getter=getter, setter=setter, creator=creator,
|
static=static, getter=getter, setter=setter,
|
||||||
deleter=deleter, specialType=specialType,
|
deleter=deleter, specialType=specialType,
|
||||||
legacycaller=legacycaller, stringifier=stringifier)
|
legacycaller=legacycaller, stringifier=stringifier)
|
||||||
p[0] = method
|
p[0] = method
|
||||||
|
@ -6149,12 +6180,6 @@ class Parser(Tokenizer):
|
||||||
"""
|
"""
|
||||||
p[0] = IDLMethod.Special.Setter
|
p[0] = IDLMethod.Special.Setter
|
||||||
|
|
||||||
def p_SpecialCreator(self, p):
|
|
||||||
"""
|
|
||||||
Special : CREATOR
|
|
||||||
"""
|
|
||||||
p[0] = IDLMethod.Special.Creator
|
|
||||||
|
|
||||||
def p_SpecialDeleter(self, p):
|
def p_SpecialDeleter(self, p):
|
||||||
"""
|
"""
|
||||||
Special : DELETER
|
Special : DELETER
|
||||||
|
@ -6246,7 +6271,6 @@ class Parser(Tokenizer):
|
||||||
| ATTRIBUTE
|
| ATTRIBUTE
|
||||||
| CALLBACK
|
| CALLBACK
|
||||||
| CONST
|
| CONST
|
||||||
| CREATOR
|
|
||||||
| DELETER
|
| DELETER
|
||||||
| DICTIONARY
|
| DICTIONARY
|
||||||
| ENUM
|
| ENUM
|
||||||
|
@ -6396,7 +6420,6 @@ class Parser(Tokenizer):
|
||||||
| BYTE
|
| BYTE
|
||||||
| LEGACYCALLER
|
| LEGACYCALLER
|
||||||
| CONST
|
| CONST
|
||||||
| CREATOR
|
|
||||||
| DELETER
|
| DELETER
|
||||||
| DOUBLE
|
| DOUBLE
|
||||||
| EXCEPTION
|
| EXCEPTION
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
--- WebIDL.py
|
--- WebIDL.py
|
||||||
+++ WebIDL.py
|
+++ WebIDL.py
|
||||||
@@ -1416,7 +1416,8 @@
|
@@ -1744,7 +1744,8 @@
|
||||||
identifier == "LegacyEventInit" or
|
identifier == "ProbablyShortLivingWrapper" or
|
||||||
identifier == "ProbablyShortLivingObject" or
|
|
||||||
identifier == "LegacyUnenumerableNamedProperties" or
|
identifier == "LegacyUnenumerableNamedProperties" or
|
||||||
|
identifier == "RunConstructorInCallerCompartment" or
|
||||||
- identifier == "NonOrdinaryGetPrototypeOf"):
|
- identifier == "NonOrdinaryGetPrototypeOf"):
|
||||||
+ identifier == "NonOrdinaryGetPrototypeOf" or
|
+ identifier == "NonOrdinaryGetPrototypeOf" or
|
||||||
+ identifier == "Abstract"):
|
+ identifier == "Abstract"):
|
||||||
|
|
|
@ -101,21 +101,6 @@ def WebIDLTest(parser, harness):
|
||||||
harness.ok(threw,
|
harness.ok(threw,
|
||||||
"Should have thrown for [CEReactions] used on a named getter")
|
"Should have thrown for [CEReactions] used on a named getter")
|
||||||
|
|
||||||
parser = parser.reset()
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
parser.parse("""
|
|
||||||
interface Foo {
|
|
||||||
[CEReactions] creator boolean (DOMString name, boolean value);
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw,
|
|
||||||
"Should have thrown for [CEReactions] used on a named creator")
|
|
||||||
|
|
||||||
parser = parser.reset()
|
parser = parser.reset()
|
||||||
threw = False
|
threw = False
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -11,7 +11,7 @@ def WebIDLTest(parser, harness):
|
||||||
harness.check(argument.variadic, variadic, "Argument has the right variadic value")
|
harness.check(argument.variadic, variadic, "Argument has the right variadic value")
|
||||||
|
|
||||||
def checkMethod(method, QName, name, signatures,
|
def checkMethod(method, QName, name, signatures,
|
||||||
static=True, getter=False, setter=False, creator=False,
|
static=True, getter=False, setter=False,
|
||||||
deleter=False, legacycaller=False, stringifier=False,
|
deleter=False, legacycaller=False, stringifier=False,
|
||||||
chromeOnly=False, htmlConstructor=False):
|
chromeOnly=False, htmlConstructor=False):
|
||||||
harness.ok(isinstance(method, WebIDL.IDLMethod),
|
harness.ok(isinstance(method, WebIDL.IDLMethod),
|
||||||
|
@ -24,7 +24,6 @@ def WebIDLTest(parser, harness):
|
||||||
harness.check(method.isStatic(), static, "Method has the correct static value")
|
harness.check(method.isStatic(), static, "Method has the correct static value")
|
||||||
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
||||||
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
||||||
harness.check(method.isCreator(), creator, "Method has the correct creator value")
|
|
||||||
harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
|
harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
|
||||||
harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
|
harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
|
||||||
harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
|
harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
|
||||||
|
|
|
@ -27,20 +27,6 @@ def WebIDLTest(parser, harness):
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
harness.ok(threw, "Should have thrown.")
|
||||||
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
parser.parse("""
|
|
||||||
interface DuplicateQualifiers3 {
|
|
||||||
creator creator byte foo(unsigned long index, byte value);
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
|
||||||
|
|
||||||
threw = False
|
threw = False
|
||||||
try:
|
try:
|
||||||
parser.parse("""
|
parser.parse("""
|
||||||
|
@ -68,17 +54,3 @@ def WebIDLTest(parser, harness):
|
||||||
threw = True
|
threw = True
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
harness.ok(threw, "Should have thrown.")
|
||||||
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
results = parser.parse("""
|
|
||||||
interface DuplicateQualifiers6 {
|
|
||||||
creator setter creator byte foo(unsigned long index, byte value);
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
|
||||||
|
|
|
@ -32,24 +32,6 @@ def WebIDLTest(parser, harness):
|
||||||
"Should have thrown for [Global] used on an interface with a "
|
"Should have thrown for [Global] used on an interface with a "
|
||||||
"named setter")
|
"named setter")
|
||||||
|
|
||||||
parser = parser.reset()
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
parser.parse("""
|
|
||||||
[Global]
|
|
||||||
interface Foo {
|
|
||||||
getter any(DOMString name);
|
|
||||||
creator void(DOMString name, any arg);
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw,
|
|
||||||
"Should have thrown for [Global] used on an interface with a "
|
|
||||||
"named creator")
|
|
||||||
|
|
||||||
parser = parser.reset()
|
parser = parser.reset()
|
||||||
threw = False
|
threw = False
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -41,7 +41,7 @@ def WebIDLTest(parser, harness):
|
||||||
harness.check(argument.variadic, variadic, "Argument has the right variadic value")
|
harness.check(argument.variadic, variadic, "Argument has the right variadic value")
|
||||||
|
|
||||||
def checkMethod(method, QName, name, signatures,
|
def checkMethod(method, QName, name, signatures,
|
||||||
static=False, getter=False, setter=False, creator=False,
|
static=False, getter=False, setter=False,
|
||||||
deleter=False, legacycaller=False, stringifier=False):
|
deleter=False, legacycaller=False, stringifier=False):
|
||||||
harness.ok(isinstance(method, WebIDL.IDLMethod),
|
harness.ok(isinstance(method, WebIDL.IDLMethod),
|
||||||
"Should be an IDLMethod")
|
"Should be an IDLMethod")
|
||||||
|
@ -53,7 +53,6 @@ def WebIDLTest(parser, harness):
|
||||||
harness.check(method.isStatic(), static, "Method has the correct static value")
|
harness.check(method.isStatic(), static, "Method has the correct static value")
|
||||||
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
||||||
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
||||||
harness.check(method.isCreator(), creator, "Method has the correct creator value")
|
|
||||||
harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
|
harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
|
||||||
harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
|
harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
|
||||||
harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
|
harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
|
||||||
|
|
|
@ -222,73 +222,3 @@ def WebIDLTest(parser, harness):
|
||||||
threw = True
|
threw = True
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
harness.ok(threw, "Should have thrown.")
|
||||||
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
parser.parse("""
|
|
||||||
interface SpecialMethodSignatureMismatch20 {
|
|
||||||
creator long long foo(long index, long long value);
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
|
||||||
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
parser.parse("""
|
|
||||||
interface SpecialMethodSignatureMismatch22 {
|
|
||||||
creator boolean foo(unsigned long index, boolean value, long long extraArg);
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
|
||||||
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
parser.parse("""
|
|
||||||
interface SpecialMethodSignatureMismatch23 {
|
|
||||||
creator boolean foo(unsigned long index, boolean... value);
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
|
||||||
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
parser.parse("""
|
|
||||||
interface SpecialMethodSignatureMismatch24 {
|
|
||||||
creator boolean foo(unsigned long index, optional boolean value);
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
|
||||||
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
parser.parse("""
|
|
||||||
interface SpecialMethodSignatureMismatch25 {
|
|
||||||
creator boolean foo();
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
|
||||||
|
|
|
@ -5,25 +5,21 @@ def WebIDLTest(parser, harness):
|
||||||
interface SpecialMethods {
|
interface SpecialMethods {
|
||||||
getter long long (unsigned long index);
|
getter long long (unsigned long index);
|
||||||
setter long long (unsigned long index, long long value);
|
setter long long (unsigned long index, long long value);
|
||||||
creator long long (unsigned long index, long long value);
|
|
||||||
getter boolean (DOMString name);
|
getter boolean (DOMString name);
|
||||||
setter boolean (DOMString name, boolean value);
|
setter boolean (DOMString name, boolean value);
|
||||||
creator boolean (DOMString name, boolean value);
|
|
||||||
deleter boolean (DOMString name);
|
deleter boolean (DOMString name);
|
||||||
readonly attribute unsigned long length;
|
readonly attribute unsigned long length;
|
||||||
};
|
};
|
||||||
|
|
||||||
interface SpecialMethodsCombination {
|
interface SpecialMethodsCombination {
|
||||||
setter creator long long (unsigned long index, long long value);
|
|
||||||
getter deleter boolean (DOMString name);
|
getter deleter boolean (DOMString name);
|
||||||
setter creator boolean (DOMString name, boolean value);
|
|
||||||
};
|
};
|
||||||
""")
|
""")
|
||||||
|
|
||||||
results = parser.finish()
|
results = parser.finish()
|
||||||
|
|
||||||
def checkMethod(method, QName, name,
|
def checkMethod(method, QName, name,
|
||||||
static=False, getter=False, setter=False, creator=False,
|
static=False, getter=False, setter=False,
|
||||||
deleter=False, legacycaller=False, stringifier=False):
|
deleter=False, legacycaller=False, stringifier=False):
|
||||||
harness.ok(isinstance(method, WebIDL.IDLMethod),
|
harness.ok(isinstance(method, WebIDL.IDLMethod),
|
||||||
"Should be an IDLMethod")
|
"Should be an IDLMethod")
|
||||||
|
@ -32,7 +28,6 @@ def WebIDLTest(parser, harness):
|
||||||
harness.check(method.isStatic(), static, "Method has the correct static value")
|
harness.check(method.isStatic(), static, "Method has the correct static value")
|
||||||
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
harness.check(method.isGetter(), getter, "Method has the correct getter value")
|
||||||
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
harness.check(method.isSetter(), setter, "Method has the correct setter value")
|
||||||
harness.check(method.isCreator(), creator, "Method has the correct creator value")
|
|
||||||
harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
|
harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
|
||||||
harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
|
harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
|
||||||
harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
|
harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
|
||||||
|
@ -40,32 +35,24 @@ def WebIDLTest(parser, harness):
|
||||||
harness.check(len(results), 2, "Expect 2 interfaces")
|
harness.check(len(results), 2, "Expect 2 interfaces")
|
||||||
|
|
||||||
iface = results[0]
|
iface = results[0]
|
||||||
harness.check(len(iface.members), 8, "Expect 8 members")
|
harness.check(len(iface.members), 6, "Expect 6 members")
|
||||||
|
|
||||||
checkMethod(iface.members[0], "::SpecialMethods::__indexedgetter", "__indexedgetter",
|
checkMethod(iface.members[0], "::SpecialMethods::__indexedgetter", "__indexedgetter",
|
||||||
getter=True)
|
getter=True)
|
||||||
checkMethod(iface.members[1], "::SpecialMethods::__indexedsetter", "__indexedsetter",
|
checkMethod(iface.members[1], "::SpecialMethods::__indexedsetter", "__indexedsetter",
|
||||||
setter=True)
|
setter=True)
|
||||||
checkMethod(iface.members[2], "::SpecialMethods::__indexedcreator", "__indexedcreator",
|
checkMethod(iface.members[2], "::SpecialMethods::__namedgetter", "__namedgetter",
|
||||||
creator=True)
|
|
||||||
checkMethod(iface.members[3], "::SpecialMethods::__namedgetter", "__namedgetter",
|
|
||||||
getter=True)
|
getter=True)
|
||||||
checkMethod(iface.members[4], "::SpecialMethods::__namedsetter", "__namedsetter",
|
checkMethod(iface.members[3], "::SpecialMethods::__namedsetter", "__namedsetter",
|
||||||
setter=True)
|
setter=True)
|
||||||
checkMethod(iface.members[5], "::SpecialMethods::__namedcreator", "__namedcreator",
|
checkMethod(iface.members[4], "::SpecialMethods::__nameddeleter", "__nameddeleter",
|
||||||
creator=True)
|
|
||||||
checkMethod(iface.members[6], "::SpecialMethods::__nameddeleter", "__nameddeleter",
|
|
||||||
deleter=True)
|
deleter=True)
|
||||||
|
|
||||||
iface = results[1]
|
iface = results[1]
|
||||||
harness.check(len(iface.members), 3, "Expect 3 members")
|
harness.check(len(iface.members), 1, "Expect 1 member")
|
||||||
|
|
||||||
checkMethod(iface.members[0], "::SpecialMethodsCombination::__indexedsettercreator",
|
checkMethod(iface.members[0], "::SpecialMethodsCombination::__namedgetterdeleter",
|
||||||
"__indexedsettercreator", setter=True, creator=True)
|
|
||||||
checkMethod(iface.members[1], "::SpecialMethodsCombination::__namedgetterdeleter",
|
|
||||||
"__namedgetterdeleter", getter=True, deleter=True)
|
"__namedgetterdeleter", getter=True, deleter=True)
|
||||||
checkMethod(iface.members[2], "::SpecialMethodsCombination::__namedsettercreator",
|
|
||||||
"__namedsettercreator", setter=True, creator=True)
|
|
||||||
|
|
||||||
parser = parser.reset();
|
parser = parser.reset();
|
||||||
|
|
||||||
|
|
|
@ -31,27 +31,12 @@ def WebIDLTest(parser, harness):
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
harness.ok(threw, "Should have thrown.")
|
||||||
|
|
||||||
threw = False
|
|
||||||
try:
|
|
||||||
parser.parse("""
|
|
||||||
interface SpecialMethodUniqueness1 {
|
|
||||||
setter creator boolean (DOMString name);
|
|
||||||
creator boolean (DOMString name);
|
|
||||||
};
|
|
||||||
""")
|
|
||||||
|
|
||||||
results = parser.finish()
|
|
||||||
except:
|
|
||||||
threw = True
|
|
||||||
|
|
||||||
harness.ok(threw, "Should have thrown.")
|
|
||||||
|
|
||||||
threw = False
|
threw = False
|
||||||
try:
|
try:
|
||||||
parser.parse("""
|
parser.parse("""
|
||||||
interface SpecialMethodUniqueness1 {
|
interface SpecialMethodUniqueness1 {
|
||||||
setter boolean (DOMString name);
|
setter boolean (DOMString name);
|
||||||
creator setter boolean (DOMString name);
|
setter boolean (DOMString name);
|
||||||
};
|
};
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,10 @@ use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding;
|
||||||
use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextMethods;
|
use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextMethods;
|
||||||
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLContextAttributes;
|
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLContextAttributes;
|
||||||
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
|
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
|
||||||
use dom::bindings::codegen::UnionTypes::ArrayBufferOrArrayBufferView;
|
use dom::bindings::codegen::UnionTypes::ArrayBufferViewOrArrayBuffer;
|
||||||
|
use dom::bindings::codegen::UnionTypes::Float32ArrayOrUnrestrictedFloatSequence;
|
||||||
use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;
|
use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;
|
||||||
|
use dom::bindings::codegen::UnionTypes::Int32ArrayOrLongSequence;
|
||||||
use dom::bindings::error::{ErrorResult, Fallible};
|
use dom::bindings::error::{ErrorResult, Fallible};
|
||||||
use dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use dom::bindings::root::{Dom, DomRoot, LayoutDom};
|
use dom::bindings::root::{Dom, DomRoot, LayoutDom};
|
||||||
|
@ -32,7 +34,7 @@ use euclid::Size2D;
|
||||||
use js::jsapi::{JSContext, JSObject};
|
use js::jsapi::{JSContext, JSObject};
|
||||||
use js::jsval::JSVal;
|
use js::jsval::JSVal;
|
||||||
use js::rust::CustomAutoRooterGuard;
|
use js::rust::CustomAutoRooterGuard;
|
||||||
use js::typedarray::{ArrayBufferView, Float32Array, Int32Array};
|
use js::typedarray::ArrayBufferView;
|
||||||
use offscreen_gl_context::GLContextAttributes;
|
use offscreen_gl_context::GLContextAttributes;
|
||||||
use script_layout_interface::HTMLCanvasDataSource;
|
use script_layout_interface::HTMLCanvasDataSource;
|
||||||
use std::ptr::NonNull;
|
use std::ptr::NonNull;
|
||||||
|
@ -239,7 +241,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
||||||
fn BufferSubData(&self, target: u32, offset: i64, data: Option<ArrayBufferOrArrayBufferView>) {
|
fn BufferSubData(&self, target: u32, offset: i64, data: Option<ArrayBufferViewOrArrayBuffer>) {
|
||||||
self.base.BufferSubData(target, offset, data)
|
self.base.BufferSubData(target, offset, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,29 +612,23 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform1iv(&self,
|
fn Uniform1iv(
|
||||||
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Int32Array>) {
|
v: Int32ArrayOrLongSequence,
|
||||||
|
) {
|
||||||
self.base.Uniform1iv(location, v)
|
self.base.Uniform1iv(location, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform1iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
|
fn Uniform1fv(
|
||||||
self.base.Uniform1iv_(location, v);
|
&self,
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn Uniform1fv(&self,
|
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Float32Array>) {
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
|
) {
|
||||||
self.base.Uniform1fv(location, v);
|
self.base.Uniform1fv(location, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn Uniform1fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
|
|
||||||
self.base.Uniform1fv_(location, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform2f(&self,
|
fn Uniform2f(&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
|
@ -641,15 +637,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform2fv(&self,
|
fn Uniform2fv(
|
||||||
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Float32Array>) {
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
self.base.Uniform2fv(location, v)
|
) {
|
||||||
}
|
self.base.Uniform2fv(location, v);
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn Uniform2fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
|
|
||||||
self.base.Uniform2fv_(location, v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
|
@ -660,17 +653,14 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform2iv(&self,
|
fn Uniform2iv(
|
||||||
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Int32Array>) {
|
v: Int32ArrayOrLongSequence,
|
||||||
|
) {
|
||||||
self.base.Uniform2iv(location, v)
|
self.base.Uniform2iv(location, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn Uniform2iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
|
|
||||||
self.base.Uniform2iv_(location, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform3f(&self,
|
fn Uniform3f(&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
|
@ -679,15 +669,12 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform3fv(&self,
|
fn Uniform3fv(
|
||||||
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Float32Array>) {
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
self.base.Uniform3fv(location, v)
|
) {
|
||||||
}
|
self.base.Uniform3fv(location, v);
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn Uniform3fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
|
|
||||||
self.base.Uniform3fv_(location, v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
|
@ -698,19 +685,14 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform3iv(&self,
|
fn Uniform3iv(
|
||||||
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Int32Array>) {
|
v: Int32ArrayOrLongSequence,
|
||||||
|
) {
|
||||||
self.base.Uniform3iv(location, v)
|
self.base.Uniform3iv(location, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn Uniform3iv_(&self,
|
|
||||||
location: Option<&WebGLUniformLocation>,
|
|
||||||
v: Vec<i32>) {
|
|
||||||
self.base.Uniform3iv_(location, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform4i(&self,
|
fn Uniform4i(&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
|
@ -718,21 +700,15 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
self.base.Uniform4i(location, x, y, z, w)
|
self.base.Uniform4i(location, x, y, z, w)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform4iv(&self,
|
fn Uniform4iv(
|
||||||
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Int32Array>) {
|
v: Int32ArrayOrLongSequence,
|
||||||
|
) {
|
||||||
self.base.Uniform4iv(location, v)
|
self.base.Uniform4iv(location, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn Uniform4iv_(&self,
|
|
||||||
location: Option<&WebGLUniformLocation>,
|
|
||||||
v: Vec<i32>) {
|
|
||||||
self.base.Uniform4iv_(location, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform4f(&self,
|
fn Uniform4f(&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
|
@ -741,56 +717,44 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn Uniform4fv(&self,
|
fn Uniform4fv(
|
||||||
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Float32Array>) {
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
self.base.Uniform4fv(location, v)
|
) {
|
||||||
}
|
self.base.Uniform4fv(location, v);
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn Uniform4fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
|
|
||||||
self.base.Uniform4fv_(location, v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn UniformMatrix2fv(&self,
|
fn UniformMatrix2fv(
|
||||||
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
transpose: bool,
|
transpose: bool,
|
||||||
v: CustomAutoRooterGuard<Float32Array>) {
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
|
) {
|
||||||
self.base.UniformMatrix2fv(location, transpose, v)
|
self.base.UniformMatrix2fv(location, transpose, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn UniformMatrix2fv_(&self, location: Option<&WebGLUniformLocation>, transpose: bool, value: Vec<f32>) {
|
fn UniformMatrix3fv(
|
||||||
self.base.UniformMatrix2fv_(location, transpose, value);
|
&self,
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn UniformMatrix3fv(&self,
|
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
transpose: bool,
|
transpose: bool,
|
||||||
v: CustomAutoRooterGuard<Float32Array>) {
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
|
) {
|
||||||
self.base.UniformMatrix3fv(location, transpose, v)
|
self.base.UniformMatrix3fv(location, transpose, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn UniformMatrix3fv_(&self, location: Option<&WebGLUniformLocation>, transpose: bool, value: Vec<f32>) {
|
fn UniformMatrix4fv(
|
||||||
self.base.UniformMatrix3fv_(location, transpose, value);
|
&self,
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn UniformMatrix4fv(&self,
|
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
transpose: bool,
|
transpose: bool,
|
||||||
v: CustomAutoRooterGuard<Float32Array>) {
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
|
) {
|
||||||
self.base.UniformMatrix4fv(location, transpose, v)
|
self.base.UniformMatrix4fv(location, transpose, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn UniformMatrix4fv_(&self, location: Option<&WebGLUniformLocation>, transpose: bool, value: Vec<f32>) {
|
|
||||||
self.base.UniformMatrix4fv_(location, transpose, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||||
fn UseProgram(&self, program: Option<&WebGLProgram>) {
|
fn UseProgram(&self, program: Option<&WebGLProgram>) {
|
||||||
self.base.UseProgram(program)
|
self.base.UseProgram(program)
|
||||||
|
@ -807,60 +771,40 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib1fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
|
fn VertexAttrib1fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
|
||||||
self.base.VertexAttrib1fv(indx, v)
|
self.base.VertexAttrib1fv(indx, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn VertexAttrib1fv_(&self, indx: u32, v: Vec<f32>) {
|
|
||||||
self.base.VertexAttrib1fv_(indx, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib2f(&self, indx: u32, x: f32, y: f32) {
|
fn VertexAttrib2f(&self, indx: u32, x: f32, y: f32) {
|
||||||
self.base.VertexAttrib2f(indx, x, y)
|
self.base.VertexAttrib2f(indx, x, y)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib2fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
|
fn VertexAttrib2fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
|
||||||
self.base.VertexAttrib2fv(indx, v)
|
self.base.VertexAttrib2fv(indx, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn VertexAttrib2fv_(&self, indx: u32, v: Vec<f32>) {
|
|
||||||
self.base.VertexAttrib2fv_(indx, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib3f(&self, indx: u32, x: f32, y: f32, z: f32) {
|
fn VertexAttrib3f(&self, indx: u32, x: f32, y: f32, z: f32) {
|
||||||
self.base.VertexAttrib3f(indx, x, y, z)
|
self.base.VertexAttrib3f(indx, x, y, z)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib3fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
|
fn VertexAttrib3fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
|
||||||
self.base.VertexAttrib3fv(indx, v)
|
self.base.VertexAttrib3fv(indx, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn VertexAttrib3fv_(&self, indx: u32, v: Vec<f32>) {
|
|
||||||
self.base.VertexAttrib3fv_(indx, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib4f(&self, indx: u32, x: f32, y: f32, z: f32, w: f32) {
|
fn VertexAttrib4f(&self, indx: u32, x: f32, y: f32, z: f32, w: f32) {
|
||||||
self.base.VertexAttrib4f(indx, x, y, z, w)
|
self.base.VertexAttrib4f(indx, x, y, z, w)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib4fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
|
fn VertexAttrib4fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
|
||||||
self.base.VertexAttrib4fv(indx, v)
|
self.base.VertexAttrib4fv(indx, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
|
||||||
fn VertexAttrib4fv_(&self, indx: u32, v: Vec<f32>) {
|
|
||||||
self.base.VertexAttrib4fv_(indx, v)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttribPointer(&self, attrib_id: u32, size: i32, data_type: u32,
|
fn VertexAttribPointer(&self, attrib_id: u32, size: i32, data_type: u32,
|
||||||
normalized: bool, stride: i32, offset: i64) {
|
normalized: bool, stride: i32, offset: i64) {
|
||||||
|
|
|
@ -14,10 +14,12 @@ use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2Rende
|
||||||
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes};
|
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes};
|
||||||
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
|
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
|
||||||
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
|
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
|
||||||
use dom::bindings::codegen::UnionTypes::ArrayBufferOrArrayBufferView;
|
use dom::bindings::codegen::UnionTypes::ArrayBufferViewOrArrayBuffer;
|
||||||
|
use dom::bindings::codegen::UnionTypes::Float32ArrayOrUnrestrictedFloatSequence;
|
||||||
use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;
|
use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;
|
||||||
|
use dom::bindings::codegen::UnionTypes::Int32ArrayOrLongSequence;
|
||||||
use dom::bindings::conversions::ToJSValConvertible;
|
use dom::bindings::conversions::ToJSValConvertible;
|
||||||
use dom::bindings::error::{Error, ErrorResult, Fallible};
|
use dom::bindings::error::{Error, ErrorResult};
|
||||||
use dom::bindings::inheritance::Castable;
|
use dom::bindings::inheritance::Castable;
|
||||||
use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
|
use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
|
||||||
use dom::bindings::root::{Dom, DomRoot, LayoutDom, MutNullableDom};
|
use dom::bindings::root::{Dom, DomRoot, LayoutDom, MutNullableDom};
|
||||||
|
@ -50,7 +52,7 @@ use half::f16;
|
||||||
use js::jsapi::{JSContext, JSObject, Type};
|
use js::jsapi::{JSContext, JSObject, Type};
|
||||||
use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UndefinedValue};
|
use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UndefinedValue};
|
||||||
use js::rust::CustomAutoRooterGuard;
|
use js::rust::CustomAutoRooterGuard;
|
||||||
use js::typedarray::{ArrayBufferView, Float32Array, Int32Array};
|
use js::typedarray::ArrayBufferView;
|
||||||
use net_traits::image::base::PixelFormat;
|
use net_traits::image::base::PixelFormat;
|
||||||
use net_traits::image_cache::ImageResponse;
|
use net_traits::image_cache::ImageResponse;
|
||||||
use offscreen_gl_context::{GLContextAttributes, GLLimits};
|
use offscreen_gl_context::{GLContextAttributes, GLLimits};
|
||||||
|
@ -1674,7 +1676,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
||||||
unsafe fn BufferData(&self, cx: *mut JSContext, target: u32, data: *mut JSObject, usage: u32) -> Fallible<()> {
|
unsafe fn BufferData(
|
||||||
|
&self,
|
||||||
|
cx: *mut JSContext,
|
||||||
|
target: u32,
|
||||||
|
data: *mut JSObject,
|
||||||
|
usage: u32,
|
||||||
|
) -> ErrorResult {
|
||||||
if data.is_null() {
|
if data.is_null() {
|
||||||
return Ok(self.webgl_error(InvalidValue));
|
return Ok(self.webgl_error(InvalidValue));
|
||||||
}
|
}
|
||||||
|
@ -1709,7 +1717,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
||||||
fn BufferData_(&self, target: u32, size: i64, usage: u32) -> Fallible<()> {
|
fn BufferData_(&self, target: u32, size: i64, usage: u32) -> ErrorResult {
|
||||||
let bound_buffer = match target {
|
let bound_buffer = match target {
|
||||||
constants::ARRAY_BUFFER => self.bound_buffer_array.get(),
|
constants::ARRAY_BUFFER => self.bound_buffer_array.get(),
|
||||||
constants::ELEMENT_ARRAY_BUFFER => self.bound_buffer_element_array.get(),
|
constants::ELEMENT_ARRAY_BUFFER => self.bound_buffer_element_array.get(),
|
||||||
|
@ -1741,11 +1749,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
||||||
fn BufferSubData(&self, target: u32, offset: i64, data: Option<ArrayBufferOrArrayBufferView>) {
|
fn BufferSubData(&self, target: u32, offset: i64, data: Option<ArrayBufferViewOrArrayBuffer>) {
|
||||||
let data_vec = match data {
|
let data_vec = match data {
|
||||||
// Typed array is rooted, so we can safely temporarily retrieve its slice
|
// Typed array is rooted, so we can safely temporarily retrieve its slice
|
||||||
Some(ArrayBufferOrArrayBufferView::ArrayBuffer(mut inner)) => inner.to_vec(),
|
Some(ArrayBufferViewOrArrayBuffer::ArrayBuffer(mut inner)) => inner.to_vec(),
|
||||||
Some(ArrayBufferOrArrayBufferView::ArrayBufferView(mut inner)) => inner.to_vec(),
|
Some(ArrayBufferViewOrArrayBuffer::ArrayBufferView(mut inner)) => inner.to_vec(),
|
||||||
// Spec: If data is null then an INVALID_VALUE error is generated.
|
// Spec: If data is null then an INVALID_VALUE error is generated.
|
||||||
None => return self.webgl_error(InvalidValue),
|
None => return self.webgl_error(InvalidValue),
|
||||||
};
|
};
|
||||||
|
@ -2867,13 +2875,12 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
fn Uniform1iv(
|
fn Uniform1iv(
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Int32Array>,
|
v: Int32ArrayOrLongSequence,
|
||||||
) {
|
) {
|
||||||
self.Uniform1iv_(location, v.to_vec());
|
let v = match v {
|
||||||
}
|
Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
|
||||||
|
Int32ArrayOrLongSequence::LongSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn Uniform1iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
|
|
||||||
if self.validate_uniform_parameters(location, UniformSetterType::Int, &v) {
|
if self.validate_uniform_parameters(location, UniformSetterType::Int, &v) {
|
||||||
self.send_command(WebGLCommand::Uniform1iv(location.unwrap().id(), v))
|
self.send_command(WebGLCommand::Uniform1iv(location.unwrap().id(), v))
|
||||||
}
|
}
|
||||||
|
@ -2883,13 +2890,12 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
fn Uniform1fv(
|
fn Uniform1fv(
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Float32Array>,
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
) {
|
) {
|
||||||
self.Uniform1fv_(location, v.to_vec());
|
let v = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn Uniform1fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
|
|
||||||
if self.validate_uniform_parameters(location, UniformSetterType::Float, &v) {
|
if self.validate_uniform_parameters(location, UniformSetterType::Float, &v) {
|
||||||
self.send_command(WebGLCommand::Uniform1fv(location.unwrap().id(), v));
|
self.send_command(WebGLCommand::Uniform1fv(location.unwrap().id(), v));
|
||||||
}
|
}
|
||||||
|
@ -2908,16 +2914,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
fn Uniform2fv(
|
fn Uniform2fv(
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Float32Array>,
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
) {
|
) {
|
||||||
self.Uniform2fv_(location, v.to_vec());
|
let v = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn Uniform2fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
|
if self.validate_uniform_parameters(location, UniformSetterType::FloatVec2, &v) {
|
||||||
if self.validate_uniform_parameters(location,
|
|
||||||
UniformSetterType::FloatVec2,
|
|
||||||
&v) {
|
|
||||||
self.send_command(WebGLCommand::Uniform2fv(location.unwrap().id(), v));
|
self.send_command(WebGLCommand::Uniform2fv(location.unwrap().id(), v));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2940,16 +2943,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
fn Uniform2iv(
|
fn Uniform2iv(
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Int32Array>,
|
v: Int32ArrayOrLongSequence,
|
||||||
) {
|
) {
|
||||||
self.Uniform2iv_(location, v.to_vec());
|
let v = match v {
|
||||||
}
|
Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
|
||||||
|
Int32ArrayOrLongSequence::LongSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn Uniform2iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
|
if self.validate_uniform_parameters(location, UniformSetterType::IntVec2, &v) {
|
||||||
if self.validate_uniform_parameters(location,
|
|
||||||
UniformSetterType::IntVec2,
|
|
||||||
&v) {
|
|
||||||
self.send_command(WebGLCommand::Uniform2iv(location.unwrap().id(), v));
|
self.send_command(WebGLCommand::Uniform2iv(location.unwrap().id(), v));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2973,16 +2973,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
fn Uniform3fv(
|
fn Uniform3fv(
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Float32Array>,
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
) {
|
) {
|
||||||
self.Uniform3fv_(location, v.to_vec());
|
let v = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn Uniform3fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
|
if self.validate_uniform_parameters(location, UniformSetterType::FloatVec3, &v) {
|
||||||
if self.validate_uniform_parameters(location,
|
|
||||||
UniformSetterType::FloatVec3,
|
|
||||||
&v) {
|
|
||||||
self.send_command(WebGLCommand::Uniform3fv(location.unwrap().id(), v))
|
self.send_command(WebGLCommand::Uniform3fv(location.unwrap().id(), v))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3002,16 +2999,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
fn Uniform3iv(
|
fn Uniform3iv(
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Int32Array>,
|
v: Int32ArrayOrLongSequence,
|
||||||
) {
|
) {
|
||||||
self.Uniform3iv_(location, v.to_vec());
|
let v = match v {
|
||||||
}
|
Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
|
||||||
|
Int32ArrayOrLongSequence::LongSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn Uniform3iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
|
if self.validate_uniform_parameters(location, UniformSetterType::IntVec3, &v) {
|
||||||
if self.validate_uniform_parameters(location,
|
|
||||||
UniformSetterType::IntVec3,
|
|
||||||
&v) {
|
|
||||||
self.send_command(WebGLCommand::Uniform3iv(location.unwrap().id(), v))
|
self.send_command(WebGLCommand::Uniform3iv(location.unwrap().id(), v))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3037,16 +3031,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
fn Uniform4iv(
|
fn Uniform4iv(
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Int32Array>,
|
v: Int32ArrayOrLongSequence,
|
||||||
) {
|
) {
|
||||||
self.Uniform4iv_(location, v.to_vec());
|
let v = match v {
|
||||||
}
|
Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
|
||||||
|
Int32ArrayOrLongSequence::LongSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn Uniform4iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
|
if self.validate_uniform_parameters(location, UniformSetterType::IntVec4, &v) {
|
||||||
if self.validate_uniform_parameters(location,
|
|
||||||
UniformSetterType::IntVec4,
|
|
||||||
&v) {
|
|
||||||
self.send_command(WebGLCommand::Uniform4iv(location.unwrap().id(), v))
|
self.send_command(WebGLCommand::Uniform4iv(location.unwrap().id(), v))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3071,16 +3062,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
fn Uniform4fv(
|
fn Uniform4fv(
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
v: CustomAutoRooterGuard<Float32Array>,
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
) {
|
) {
|
||||||
self.Uniform4fv_(location, v.to_vec());
|
let v = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn Uniform4fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
|
if self.validate_uniform_parameters(location, UniformSetterType::FloatVec4, &v) {
|
||||||
if self.validate_uniform_parameters(location,
|
|
||||||
UniformSetterType::FloatVec4,
|
|
||||||
&v) {
|
|
||||||
self.send_command(WebGLCommand::Uniform4fv(location.unwrap().id(), v))
|
self.send_command(WebGLCommand::Uniform4fv(location.unwrap().id(), v))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3090,20 +3078,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
transpose: bool,
|
transpose: bool,
|
||||||
v: CustomAutoRooterGuard<Float32Array>,
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
) {
|
) {
|
||||||
self.UniformMatrix2fv_(location, transpose, v.to_vec());
|
let v = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn UniformMatrix2fv_(&self,
|
if self.validate_uniform_parameters(location, UniformSetterType::FloatMat2, &v) {
|
||||||
location: Option<&WebGLUniformLocation>,
|
self.send_command(WebGLCommand::UniformMatrix2fv(location.unwrap().id(), transpose, v));
|
||||||
transpose: bool,
|
|
||||||
value: Vec<f32>) {
|
|
||||||
if self.validate_uniform_parameters(location,
|
|
||||||
UniformSetterType::FloatMat2,
|
|
||||||
&value) {
|
|
||||||
self.send_command(WebGLCommand::UniformMatrix2fv(location.unwrap().id(), transpose, value));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3112,22 +3094,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
transpose: bool,
|
transpose: bool,
|
||||||
v: CustomAutoRooterGuard<Float32Array>,
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
) {
|
) {
|
||||||
self.UniformMatrix3fv_(location, transpose, v.to_vec());
|
let v = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn UniformMatrix3fv_(
|
if self.validate_uniform_parameters(location, UniformSetterType::FloatMat3, &v) {
|
||||||
&self,
|
self.send_command(WebGLCommand::UniformMatrix3fv(location.unwrap().id(), transpose, v));
|
||||||
location: Option<&WebGLUniformLocation>,
|
|
||||||
transpose: bool,
|
|
||||||
value: Vec<f32>,
|
|
||||||
) {
|
|
||||||
if self.validate_uniform_parameters(location,
|
|
||||||
UniformSetterType::FloatMat3,
|
|
||||||
&value) {
|
|
||||||
self.send_command(WebGLCommand::UniformMatrix3fv(location.unwrap().id(), transpose, value));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3136,22 +3110,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
&self,
|
&self,
|
||||||
location: Option<&WebGLUniformLocation>,
|
location: Option<&WebGLUniformLocation>,
|
||||||
transpose: bool,
|
transpose: bool,
|
||||||
v: CustomAutoRooterGuard<Float32Array>,
|
v: Float32ArrayOrUnrestrictedFloatSequence,
|
||||||
) {
|
) {
|
||||||
self.UniformMatrix4fv_(location, transpose, v.to_vec());
|
let v = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn UniformMatrix4fv_(
|
if self.validate_uniform_parameters(location, UniformSetterType::FloatMat4, &v) {
|
||||||
&self,
|
self.send_command(WebGLCommand::UniformMatrix4fv(location.unwrap().id(), transpose, v));
|
||||||
location: Option<&WebGLUniformLocation>,
|
|
||||||
transpose: bool,
|
|
||||||
value: Vec<f32>,
|
|
||||||
) {
|
|
||||||
if self.validate_uniform_parameters(location,
|
|
||||||
UniformSetterType::FloatMat4,
|
|
||||||
&value) {
|
|
||||||
self.send_command(WebGLCommand::UniformMatrix4fv(location.unwrap().id(), transpose, value));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3178,16 +3144,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib1fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
|
fn VertexAttrib1fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
|
||||||
self.VertexAttrib1fv_(indx, v.to_vec());
|
let values = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn VertexAttrib1fv_(&self, indx: u32, values: Vec<f32>) {
|
|
||||||
if values.len() < 1 {
|
if values.len() < 1 {
|
||||||
return self.webgl_error(InvalidOperation);
|
return self.webgl_error(InvalidOperation);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.vertex_attrib(indx, values[0], 0f32, 0f32, 1f32);
|
self.vertex_attrib(indx, values[0], 0f32, 0f32, 1f32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3197,16 +3161,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib2fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
|
fn VertexAttrib2fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
|
||||||
self.VertexAttrib2fv_(indx, v.to_vec());
|
let values = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn VertexAttrib2fv_(&self, indx: u32, values: Vec<f32>) {
|
|
||||||
if values.len() < 2 {
|
if values.len() < 2 {
|
||||||
return self.webgl_error(InvalidOperation);
|
return self.webgl_error(InvalidOperation);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.vertex_attrib(indx, values[0], values[1], 0f32, 1f32);
|
self.vertex_attrib(indx, values[0], values[1], 0f32, 1f32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3216,16 +3178,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib3fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
|
fn VertexAttrib3fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
|
||||||
self.VertexAttrib3fv_(indx, v.to_vec());
|
let values = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn VertexAttrib3fv_(&self, indx: u32, values: Vec<f32>) {
|
|
||||||
if values.len() < 3 {
|
if values.len() < 3 {
|
||||||
return self.webgl_error(InvalidOperation);
|
return self.webgl_error(InvalidOperation);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.vertex_attrib(indx, values[0], values[1], values[2], 1f32);
|
self.vertex_attrib(indx, values[0], values[1], values[2], 1f32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3235,16 +3195,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||||
fn VertexAttrib4fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
|
fn VertexAttrib4fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
|
||||||
self.VertexAttrib4fv_(indx, v.to_vec());
|
let values = match v {
|
||||||
}
|
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
|
||||||
|
Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
};
|
||||||
fn VertexAttrib4fv_(&self, indx: u32, values: Vec<f32>) {
|
|
||||||
if values.len() < 4 {
|
if values.len() < 4 {
|
||||||
return self.webgl_error(InvalidOperation);
|
return self.webgl_error(InvalidOperation);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.vertex_attrib(indx, values[0], values[1], values[2], values[3]);
|
self.vertex_attrib(indx, values[0], values[1], values[2], values[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3304,7 +3262,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
|
||||||
fn TexImage2D(&self,
|
fn TexImage2D(
|
||||||
|
&self,
|
||||||
target: u32,
|
target: u32,
|
||||||
level: i32,
|
level: i32,
|
||||||
internal_format: u32,
|
internal_format: u32,
|
||||||
|
@ -3313,7 +3272,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
border: i32,
|
border: i32,
|
||||||
format: u32,
|
format: u32,
|
||||||
data_type: u32,
|
data_type: u32,
|
||||||
mut pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>) -> Fallible<()> {
|
mut pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>,
|
||||||
|
) -> ErrorResult {
|
||||||
if !self.extension_manager.is_tex_type_enabled(data_type) {
|
if !self.extension_manager.is_tex_type_enabled(data_type) {
|
||||||
return Ok(self.webgl_error(InvalidEnum));
|
return Ok(self.webgl_error(InvalidEnum));
|
||||||
}
|
}
|
||||||
|
@ -3437,7 +3397,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
height: i32,
|
height: i32,
|
||||||
format: u32,
|
format: u32,
|
||||||
data_type: u32,
|
data_type: u32,
|
||||||
source: &HTMLIFrameElement) -> Fallible<()> {
|
source: &HTMLIFrameElement) -> ErrorResult {
|
||||||
// Currently DOMToTexture only supports TEXTURE_2D, RGBA, UNSIGNED_BYTE and no levels.
|
// Currently DOMToTexture only supports TEXTURE_2D, RGBA, UNSIGNED_BYTE and no levels.
|
||||||
if target != constants::TEXTURE_2D || level != 0 || internal_format != constants::RGBA ||
|
if target != constants::TEXTURE_2D || level != 0 || internal_format != constants::RGBA ||
|
||||||
format != constants::RGBA || data_type != constants::UNSIGNED_BYTE {
|
format != constants::RGBA || data_type != constants::UNSIGNED_BYTE {
|
||||||
|
@ -3468,7 +3428,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
|
||||||
fn TexSubImage2D(&self,
|
fn TexSubImage2D(
|
||||||
|
&self,
|
||||||
target: u32,
|
target: u32,
|
||||||
level: i32,
|
level: i32,
|
||||||
xoffset: i32,
|
xoffset: i32,
|
||||||
|
@ -3477,7 +3438,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
height: i32,
|
height: i32,
|
||||||
format: u32,
|
format: u32,
|
||||||
data_type: u32,
|
data_type: u32,
|
||||||
mut pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>) -> Fallible<()> {
|
mut pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>,
|
||||||
|
) -> ErrorResult {
|
||||||
let validator = TexImage2DValidator::new(self, target, level,
|
let validator = TexImage2DValidator::new(self, target, level,
|
||||||
format, width, height,
|
format, width, height,
|
||||||
0, format, data_type);
|
0, format, data_type);
|
||||||
|
|
|
@ -573,10 +573,10 @@ interface WebGL2RenderingContextBase
|
||||||
[WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
|
[WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
|
||||||
void bindVertexArray(WebGLVertexArrayObject? array);*/
|
void bindVertexArray(WebGLVertexArrayObject? array);*/
|
||||||
};
|
};
|
||||||
WebGL2RenderingContextBase implements WebGLRenderingContextBase;
|
|
||||||
|
|
||||||
[Pref="dom.webgl2.enabled"]
|
[Pref="dom.webgl2.enabled"]
|
||||||
interface WebGL2RenderingContext
|
interface WebGL2RenderingContext
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
WebGL2RenderingContext implements WebGLRenderingContextBase;
|
||||||
WebGL2RenderingContext implements WebGL2RenderingContextBase;
|
WebGL2RenderingContext implements WebGL2RenderingContextBase;
|
||||||
|
|
|
@ -28,8 +28,9 @@ typedef (ImageData or
|
||||||
HTMLImageElement or
|
HTMLImageElement or
|
||||||
HTMLCanvasElement or
|
HTMLCanvasElement or
|
||||||
HTMLVideoElement) TexImageSource;
|
HTMLVideoElement) TexImageSource;
|
||||||
typedef (ArrayBuffer or ArrayBufferView) BufferDataSource;
|
|
||||||
|
|
||||||
|
typedef (/*[AllowShared]*/ Float32Array or sequence<GLfloat>) Float32List;
|
||||||
|
typedef (/*[AllowShared]*/ Int32Array or sequence<GLint>) Int32List;
|
||||||
|
|
||||||
dictionary WebGLContextAttributes {
|
dictionary WebGLContextAttributes {
|
||||||
GLboolean alpha = true;
|
GLboolean alpha = true;
|
||||||
|
@ -470,6 +471,7 @@ interface WebGLRenderingContextBase
|
||||||
readonly attribute GLsizei drawingBufferHeight;
|
readonly attribute GLsizei drawingBufferHeight;
|
||||||
|
|
||||||
[WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
|
[WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
|
||||||
|
// FIXME: https://github.com/servo/servo/issues/15266
|
||||||
// [WebGLHandlesContextLoss] boolean isContextLost();
|
// [WebGLHandlesContextLoss] boolean isContextLost();
|
||||||
|
|
||||||
sequence<DOMString>? getSupportedExtensions();
|
sequence<DOMString>? getSupportedExtensions();
|
||||||
|
@ -489,15 +491,12 @@ interface WebGLRenderingContextBase
|
||||||
void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
|
void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
|
||||||
GLenum srcAlpha, GLenum dstAlpha);
|
GLenum srcAlpha, GLenum dstAlpha);
|
||||||
|
|
||||||
// FIXME(xanewok) from CodegenRust.py:
|
// FIXME(xanewok): https://github.com/servo/servo/issues/20513
|
||||||
// 'No support for unions as distinguishing arguments yet' for below
|
|
||||||
// original WebIDL function definition
|
|
||||||
// void bufferData(GLenum target, BufferDataSource? data, GLenum usage);
|
|
||||||
[Throws]
|
[Throws]
|
||||||
void bufferData(GLenum target, object? data, GLenum usage);
|
void bufferData(GLenum target, object? data, GLenum usage);
|
||||||
[Throws]
|
[Throws]
|
||||||
void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
|
void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
|
||||||
void bufferSubData(GLenum target, GLintptr offset, BufferDataSource? data);
|
void bufferSubData(GLenum target, GLintptr offset, /*[AllowShared]*/ BufferSource? data);
|
||||||
|
|
||||||
[WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
|
[WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
|
||||||
void clear(GLbitfield mask);
|
void clear(GLbitfield mask);
|
||||||
|
@ -509,17 +508,15 @@ interface WebGLRenderingContextBase
|
||||||
|
|
||||||
void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||||
GLsizei width, GLsizei height, GLint border,
|
GLsizei width, GLsizei height, GLint border,
|
||||||
ArrayBufferView data);
|
/*[AllowShared]*/ ArrayBufferView data);
|
||||||
void compressedTexSubImage2D(GLenum target, GLint level,
|
void compressedTexSubImage2D(GLenum target, GLint level,
|
||||||
GLint xoffset, GLint yoffset,
|
GLint xoffset, GLint yoffset,
|
||||||
GLsizei width, GLsizei height, GLenum format,
|
GLsizei width, GLsizei height, GLenum format,
|
||||||
ArrayBufferView data);
|
/*[AllowShared]*/ ArrayBufferView data);
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
|
|
||||||
void copyTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
void copyTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||||
GLint x, GLint y, GLsizei width, GLsizei height,
|
GLint x, GLint y, GLsizei width, GLsizei height,
|
||||||
GLint border);
|
GLint border);
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
|
|
||||||
void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||||
|
|
||||||
|
@ -576,6 +573,7 @@ interface WebGLRenderingContextBase
|
||||||
GLenum pname);
|
GLenum pname);
|
||||||
any getProgramParameter(WebGLProgram program, GLenum pname);
|
any getProgramParameter(WebGLProgram program, GLenum pname);
|
||||||
DOMString? getProgramInfoLog(WebGLProgram program);
|
DOMString? getProgramInfoLog(WebGLProgram program);
|
||||||
|
// FIXME: https://github.com/servo/servo/issues/20514
|
||||||
// any getRenderbufferParameter(GLenum target, GLenum pname);
|
// any getRenderbufferParameter(GLenum target, GLenum pname);
|
||||||
any getShaderParameter(WebGLShader shader, GLenum pname);
|
any getShaderParameter(WebGLShader shader, GLenum pname);
|
||||||
WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
|
WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
|
||||||
|
@ -607,7 +605,7 @@ interface WebGLRenderingContextBase
|
||||||
void polygonOffset(GLfloat factor, GLfloat units);
|
void polygonOffset(GLfloat factor, GLfloat units);
|
||||||
|
|
||||||
void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||||
GLenum format, GLenum type, ArrayBufferView? pixels);
|
GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||||
|
|
||||||
void renderbufferStorage(GLenum target, GLenum internalformat,
|
void renderbufferStorage(GLenum target, GLenum internalformat,
|
||||||
GLsizei width, GLsizei height);
|
GLsizei width, GLsizei height);
|
||||||
|
@ -623,11 +621,11 @@ interface WebGLRenderingContextBase
|
||||||
void stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
|
void stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
|
||||||
void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
|
void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
|
||||||
|
|
||||||
// FIXME: Codegen requires that this have [Throws] to match the other one.
|
// FIXME: https://github.com/servo/servo/issues/20516
|
||||||
[Throws]
|
[Throws]
|
||||||
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||||
GLsizei width, GLsizei height, GLint border, GLenum format,
|
GLsizei width, GLsizei height, GLint border, GLenum format,
|
||||||
GLenum type, ArrayBufferView? pixels);
|
GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||||
[Throws]
|
[Throws]
|
||||||
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
void texImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||||
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||||
|
@ -638,78 +636,52 @@ interface WebGLRenderingContextBase
|
||||||
void texParameterf(GLenum target, GLenum pname, GLfloat param);
|
void texParameterf(GLenum target, GLenum pname, GLfloat param);
|
||||||
void texParameteri(GLenum target, GLenum pname, GLint param);
|
void texParameteri(GLenum target, GLenum pname, GLint param);
|
||||||
|
|
||||||
// FIXME: Codegen requires that this have [Throws] to match the other one.
|
// FIXME: https://github.com/servo/servo/issues/20516
|
||||||
[Throws]
|
[Throws]
|
||||||
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||||
GLsizei width, GLsizei height,
|
GLsizei width, GLsizei height,
|
||||||
GLenum format, GLenum type, ArrayBufferView? pixels);
|
GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
|
||||||
[Throws]
|
[Throws]
|
||||||
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||||
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
GLenum format, GLenum type, TexImageSource source); // May throw DOMException
|
||||||
|
|
||||||
void uniform1f(WebGLUniformLocation? location, GLfloat x);
|
void uniform1f(WebGLUniformLocation? location, GLfloat x);
|
||||||
void uniform1fv(WebGLUniformLocation? location, Float32Array v);
|
void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
|
||||||
void uniform1fv(WebGLUniformLocation? location, sequence<GLfloat> v);
|
void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
|
||||||
|
void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||||
|
|
||||||
void uniform1i(WebGLUniformLocation? location, GLint x);
|
void uniform1i(WebGLUniformLocation? location, GLint x);
|
||||||
void uniform1iv(WebGLUniformLocation? location, Int32Array v);
|
|
||||||
void uniform1iv(WebGLUniformLocation? location, sequence<long> v);
|
|
||||||
|
|
||||||
void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
|
|
||||||
void uniform2fv(WebGLUniformLocation? location, Float32Array v);
|
|
||||||
void uniform2fv(WebGLUniformLocation? location, sequence<GLfloat> v);
|
|
||||||
|
|
||||||
void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
|
void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
|
||||||
void uniform2iv(WebGLUniformLocation? location, Int32Array v);
|
|
||||||
void uniform2iv(WebGLUniformLocation? location, sequence<long> v);
|
|
||||||
|
|
||||||
void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
|
|
||||||
void uniform3fv(WebGLUniformLocation? location, Float32Array v);
|
|
||||||
void uniform3fv(WebGLUniformLocation? location, sequence<GLfloat> v);
|
|
||||||
|
|
||||||
void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
|
void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
|
||||||
void uniform3iv(WebGLUniformLocation? location, Int32Array v);
|
|
||||||
void uniform3iv(WebGLUniformLocation? location, sequence<long> v);
|
|
||||||
|
|
||||||
void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
|
||||||
void uniform4fv(WebGLUniformLocation? location, Float32Array v);
|
|
||||||
void uniform4fv(WebGLUniformLocation? location, sequence<GLfloat> v);
|
|
||||||
|
|
||||||
void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
|
void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
|
||||||
void uniform4iv(WebGLUniformLocation? location, Int32Array v);
|
|
||||||
void uniform4iv(WebGLUniformLocation? location, sequence<long> v);
|
|
||||||
|
|
||||||
void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose,
|
void uniform1fv(WebGLUniformLocation? location, Float32List v);
|
||||||
Float32Array value);
|
void uniform2fv(WebGLUniformLocation? location, Float32List v);
|
||||||
void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose,
|
void uniform3fv(WebGLUniformLocation? location, Float32List v);
|
||||||
sequence<GLfloat> value);
|
void uniform4fv(WebGLUniformLocation? location, Float32List v);
|
||||||
void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose,
|
|
||||||
Float32Array value);
|
void uniform1iv(WebGLUniformLocation? location, Int32List v);
|
||||||
void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose,
|
void uniform2iv(WebGLUniformLocation? location, Int32List v);
|
||||||
sequence<GLfloat> value);
|
void uniform3iv(WebGLUniformLocation? location, Int32List v);
|
||||||
void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose,
|
void uniform4iv(WebGLUniformLocation? location, Int32List v);
|
||||||
Float32Array value);
|
|
||||||
void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose,
|
void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
|
||||||
sequence<GLfloat> value);
|
void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
|
||||||
|
void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
|
||||||
|
|
||||||
void useProgram(WebGLProgram? program);
|
void useProgram(WebGLProgram? program);
|
||||||
void validateProgram(WebGLProgram program);
|
void validateProgram(WebGLProgram program);
|
||||||
|
|
||||||
void vertexAttrib1f(GLuint indx, GLfloat x);
|
void vertexAttrib1f(GLuint indx, GLfloat x);
|
||||||
void vertexAttrib1fv(GLuint indx, Float32Array values);
|
|
||||||
void vertexAttrib1fv(GLuint indx, sequence<GLfloat> values);
|
|
||||||
|
|
||||||
void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
|
void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
|
||||||
void vertexAttrib2fv(GLuint indx, Float32Array values);
|
|
||||||
void vertexAttrib2fv(GLuint indx, sequence<GLfloat> values);
|
|
||||||
|
|
||||||
void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
|
void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
|
||||||
void vertexAttrib3fv(GLuint indx, Float32Array values);
|
|
||||||
void vertexAttrib3fv(GLuint indx, sequence<GLfloat> values);
|
|
||||||
|
|
||||||
void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||||
void vertexAttrib4fv(GLuint indx, Float32Array values);
|
|
||||||
void vertexAttrib4fv(GLuint indx, sequence<GLfloat> values);
|
void vertexAttrib1fv(GLuint indx, Float32List values);
|
||||||
|
void vertexAttrib2fv(GLuint indx, Float32List values);
|
||||||
|
void vertexAttrib3fv(GLuint indx, Float32List values);
|
||||||
|
void vertexAttrib4fv(GLuint indx, Float32List values);
|
||||||
|
|
||||||
void vertexAttribPointer(GLuint indx, GLint size, GLenum type,
|
void vertexAttribPointer(GLuint indx, GLint size, GLenum type,
|
||||||
GLboolean normalized, GLsizei stride, GLintptr offset);
|
GLboolean normalized, GLsizei stride, GLintptr offset);
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,3 @@
|
||||||
[WebSockets: Send/Receive blob, blob size less than network array buffer]
|
[WebSockets: Send/Receive blob, blob size less than network array buffer]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
[001.html]
|
|
||||||
|
|
|
@ -3,5 +3,3 @@
|
||||||
[WebSockets: Send/Receive blob, blob size greater than network array buffer]
|
[WebSockets: Send/Receive blob, blob size greater than network array buffer]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
[002.html]
|
|
||||||
|
|
|
@ -3,5 +3,3 @@
|
||||||
[WebSockets: Send/Receive ArrayBuffer, size greater than network array buffer]
|
[WebSockets: Send/Receive ArrayBuffer, size greater than network array buffer]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
[004.html]
|
|
||||||
|
|
|
@ -4,5 +4,3 @@
|
||||||
[WebSockets: Send/Receive ArrayBuffer, size less than network array buffer]
|
[WebSockets: Send/Receive ArrayBuffer, size less than network array buffer]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
[005.html]
|
|
||||||
|
|
|
@ -4,5 +4,3 @@
|
||||||
[WebSockets: bufferedAmount for ArrayBuffer]
|
[WebSockets: bufferedAmount for ArrayBuffer]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
[bufferedAmount-arraybuffer.html]
|
|
||||||
|
|
|
@ -4,5 +4,3 @@
|
||||||
[WebSockets: bufferedAmount for blob]
|
[WebSockets: bufferedAmount for blob]
|
||||||
expected: TIMEOUT
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
[bufferedAmount-blob.html]
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue