servo: Merge #20518 - Some minor WebGL improvements (from servo:webgl); r=emilio
authorAnthony Ramine <n.oxyde@gmail.com>
Tue, 03 Apr 2018 11:06:26 -0400
changeset 411547 5dc2a9ab8a1c0deea901aef8ba28c040691ef556
parent 411546 1dd761da1344317a99e7198fa0423356bc254c11
child 411548 e7a004dce76eea63c9d5e08083960fb95a366ebc
push id101686
push useraciure@mozilla.com
push dateTue, 03 Apr 2018 21:59:31 +0000
treeherdermozilla-inbound@8d846598d35d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #20518 - Some minor WebGL improvements (from servo:webgl); r=emilio Source-Repo: https://github.com/servo/servo Source-Revision: 122bfa03e1fba01dc7d52e63268a83492d994b53
servo/components/script/dom/bindings/codegen/CodegenRust.py
servo/components/script/dom/bindings/codegen/Configuration.py
servo/components/script/dom/bindings/codegen/parser/WebIDL.py
servo/components/script/dom/bindings/codegen/parser/abstract.patch
servo/components/script/dom/bindings/codegen/parser/tests/test_cereactions.py
servo/components/script/dom/bindings/codegen/parser/tests/test_constructor.py
servo/components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py
servo/components/script/dom/bindings/codegen/parser/tests/test_global_extended_attr.py
servo/components/script/dom/bindings/codegen/parser/tests/test_method.py
servo/components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py
servo/components/script/dom/bindings/codegen/parser/tests/test_special_methods.py
servo/components/script/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py
servo/components/script/dom/webgl2renderingcontext.rs
servo/components/script/dom/webglrenderingcontext.rs
servo/components/script/dom/webidls/WebGL2RenderingContext.webidl
servo/components/script/dom/webidls/WebGLRenderingContext.webidl
--- a/servo/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/servo/components/script/dom/bindings/codegen/CodegenRust.py
@@ -4795,17 +4795,17 @@ class CGProxySpecialOperation(CGPerSigna
             returnType = IDLNullableType(returnType.location, returnType)
 
         # We pass len(arguments) as the final argument so that the
         # CGPerSignatureCall won't do any argument conversion of its own.
         CGPerSignatureCall.__init__(self, returnType, "", arguments, nativeName,
                                     False, descriptor, operation,
                                     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.
             argument = arguments[1]
             info = getJSToNativeConversionInfo(
                 argument.type, descriptor, treatNullAs=argument.treatNullAs,
                 exceptionCode="return false;")
             template = info.template
             declType = info.declType
 
--- a/servo/components/script/dom/bindings/codegen/Configuration.py
+++ b/servo/components/script/dom/bindings/codegen/Configuration.py
@@ -274,18 +274,16 @@ class Descriptor(DescriptorProvider):
                             assert m.isNamed()
                             operation = 'Named' + operation
                         addOperation(operation, m)
 
                     if m.isGetter():
                         addIndexedOrNamedOperation('Getter', m)
                     if m.isSetter():
                         addIndexedOrNamedOperation('Setter', m)
-                    if m.isCreator():
-                        addIndexedOrNamedOperation('Creator', m)
                     if m.isDeleter():
                         addIndexedOrNamedOperation('Deleter', m)
 
                 iface = iface.parent
                 if iface:
                     iface.setUserData('hasConcreteDescendant', True)
 
             if self.proxy:
--- a/servo/components/script/dom/bindings/codegen/parser/WebIDL.py
+++ b/servo/components/script/dom/bindings/codegen/parser/WebIDL.py
@@ -1090,34 +1090,32 @@ class IDLInterfaceOrNamespace(IDLObjectW
             isAncestor = False
             while testInterface:
                 self.maplikeOrSetlikeOrIterable.checkCollisions(testInterface.members,
                                                                 isAncestor)
                 isAncestor = True
                 testInterface = testInterface.parent
 
         # 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
         # quite per spec, but in practice no one overloads
         # legacycallers.  Also note that in practice we disallow
         # 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".
         specialMembersSeen = {}
         for member in self.members:
             if not member.isMethod():
                 continue
 
             if member.isGetter():
                 memberType = "getters"
             elif member.isSetter():
                 memberType = "setters"
-            elif member.isCreator():
-                memberType = "creators"
             elif member.isDeleter():
                 memberType = "deleters"
             elif member.isStringifier():
                 memberType = "stringifiers"
             elif member.isJsonifier():
                 memberType = "jsonifiers"
             elif member.isLegacycaller():
                 memberType = "legacycallers"
@@ -1153,18 +1151,18 @@ class IDLInterfaceOrNamespace(IDLObjectW
                     raise WebIDLError(
                         "Interface with [LegacyUnenumerableNamedProperties] "
                         "inherits from another interface with "
                         "[LegacyUnenumerableNamedProperties]",
                         [self.location, ancestor.location])
                 ancestor = ancestor.parent
 
         if self._isOnGlobalProtoChain:
-            # Make sure we have no named setters, creators, or deleters
-            for memberType in ["setter", "creator", "deleter"]:
+            # Make sure we have no named setters or deleters
+            for memberType in ["setter", "deleter"]:
                 memberId = "named " + memberType + "s"
                 if memberId in specialMembersSeen:
                     raise WebIDLError("Interface with [Global] has a named %s" %
                                       memberType,
                                       [self.location,
                                        specialMembersSeen[memberId].location])
             # Make sure we're not [OverrideBuiltins]
             if self.getExtendedAttribute("OverrideBuiltins"):
@@ -1178,16 +1176,32 @@ class IDLInterfaceOrNamespace(IDLObjectW
                 if parent.getExtendedAttribute("OverrideBuiltins"):
                     raise WebIDLError("Interface with [Global] inherits from "
                                       "interface with [OverrideBuiltins]",
                                       [self.location, parent.location])
                 parent._isOnGlobalProtoChain = True
                 parent = parent.parent
 
     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
         # this here, because in finish() an interface might not know yet that
         # it's consequential.
         if self.getExtendedAttribute("Unforgeable") and self.isConsequential():
             raise WebIDLError(
                 "%s is an unforgeable consequential interface" %
                 self.identifier.name,
                 [self.location] +
@@ -1290,25 +1304,25 @@ class IDLInterfaceOrNamespace(IDLObjectW
                     if member.isIdentifierLess():
                         raise WebIDLError("[Alias] must not be used on an "
                                           "identifierless operation",
                                           [member.location])
                     if member.isUnforgeable():
                         raise WebIDLError("[Alias] must not be used on an "
                                           "[Unforgeable] operation",
                                           [member.location])
-                    for m in self.members:
-                        if m.identifier.name == alias:
-                            raise WebIDLError("[Alias=%s] has same name as "
-                                              "interface member" % alias,
-                                              [member.location, m.location])
-                        if m.isMethod() and m != member and alias in m.aliases:
-                            raise WebIDLError("duplicate [Alias=%s] definitions" %
-                                              alias,
-                                              [member.location, m.location])
+
+                    checkDuplicateNames(member, alias, "Alias")
+
+            # Check that the name of a [BindingAlias] doesn't conflict with an
+            # interface member.
+            if member.isAttr():
+                for bindingAlias in member.bindingAliases:
+                    checkDuplicateNames(member, bindingAlias, "BindingAlias")
+
 
         # Conditional exposure makes no sense for interfaces with no
         # interface object, unless they're navigator properties.
         # And SecureContext makes sense for interfaces with no interface object,
         # since it is also propagated to interface members.
         if (self.isExposedConditionally(exclusions=["SecureContext"]) and
             not self.hasInterfaceObject() and
             not self.isNavigatorProperty()):
@@ -1715,20 +1729,20 @@ class IDLInterface(IDLInterfaceOrNamespa
                                           "an interface member and on the "
                                           "interface itself",
                                           [member.location, attr.location])
                     member.addExtendedAttributes([attr])
             elif (identifier == "NeedResolve" or
                   identifier == "OverrideBuiltins" or
                   identifier == "ChromeOnly" or
                   identifier == "Unforgeable" or
-                  identifier == "UnsafeInPrerendering" or
                   identifier == "LegacyEventInit" or
                   identifier == "ProbablyShortLivingWrapper" or
                   identifier == "LegacyUnenumerableNamedProperties" or
+                  identifier == "RunConstructorInCallerCompartment" or
                   identifier == "NonOrdinaryGetPrototypeOf" or
                   identifier == "Abstract" or
                   identifier == "Inline"):
                 # Known extended attributes that do not take values
                 if not attr.noArguments():
                     raise WebIDLError("[%s] must take no arguments" % identifier,
                                       [attr.location])
             elif identifier == "Exposed":
@@ -1775,20 +1789,26 @@ class IDLNamespace(IDLInterfaceOrNamespa
                 convertExposedAttrToGlobalNameSet(attr,
                                                   self._exposureGlobalNames)
             elif identifier == "ClassString":
                 # Takes a string value to override the default "Object" if
                 # desired.
                 if not attr.hasValue():
                     raise WebIDLError("[%s] must have a value" % identifier,
                                       [attr.location])
-            elif identifier == "ProtoObjectHack":
+            elif (identifier == "ProtoObjectHack" or
+                  identifier == "ChromeOnly"):
                 if not attr.noArguments():
                     raise WebIDLError("[%s] must not have arguments" % identifier,
                                       [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:
                 raise WebIDLError("Unknown extended attribute %s on namespace" %
                                   identifier,
                                   [attr.location])
 
             attrlist = attr.listValue()
             self._extendedAttrDict[identifier] = attrlist if len(attrlist) else True
 
@@ -3576,16 +3596,21 @@ class IDLInterfaceMember(IDLObjectWithId
         self.affects = affects
 
     def _addAlias(self, alias):
         if alias in self.aliases:
             raise WebIDLError("Duplicate [Alias=%s] on attribute" % alias,
                               [self.location])
         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):
 
     def __init__(self, location, identifier, ifaceType, keyType, valueType, ifaceKind):
         IDLInterfaceMember.__init__(self, location, identifier, ifaceKind)
         if keyType is not None:
             assert isinstance(keyType, IDLType)
         else:
@@ -3696,16 +3721,21 @@ class IDLMaplikeOrSetlikeOrIterableBase(
                 [IDLExtendedAttribute(self.location, ("DependsOn", "Everything")),
                  IDLExtendedAttribute(self.location, ("Affects", "Nothing"))])
         if newObject:
             method.addExtendedAttributes(
                 [IDLExtendedAttribute(self.location, ("NewObject",))])
         if isIteratorAlias:
             method.addExtendedAttributes(
                 [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)
 
     def resolve(self, parentScope):
         if self.keyType:
             self.keyType.resolveType(parentScope)
         if self.valueType:
             self.valueType.resolveType(parentScope)
 
@@ -3819,21 +3849,25 @@ class IDLMaplikeOrSetlike(IDLMaplikeOrSe
 
     def expand(self, members, isJSImplemented):
         """
         In order to take advantage of all of the method machinery in Codegen,
         we generate our functions as if they were part of the interface
         specification during parsing.
         """
         # Both maplike and setlike have a size attribute
-        members.append(IDLAttribute(self.location,
-                                    IDLUnresolvedIdentifier(BuiltinLocation("<auto-generated-identifier>"), "size"),
-                                    BuiltinTypes[IDLBuiltinType.Types.unsigned_long],
-                                    True,
-                                    maplikeOrSetlike=self))
+        sizeAttr = IDLAttribute(self.location,
+                                IDLUnresolvedIdentifier(BuiltinLocation("<auto-generated-identifier>"), "size"),
+                                BuiltinTypes[IDLBuiltinType.Types.unsigned_long],
+                                True,
+                                maplikeOrSetlike=self)
+        # This should be non-enumerable.
+        sizeAttr.addExtendedAttributes(
+                [IDLExtendedAttribute(self.location, ("NonEnumerable",))])
+        members.append(sizeAttr)
         self.reserved_ro_names = ["size"]
         self.disallowedMemberNames.append("size")
 
         # object entries()
         self.addMethod("entries", members, False, BuiltinTypes[IDLBuiltinType.Types.object],
                        affectsNothing=True, isIteratorAlias=self.isMaplike())
         # object keys()
         self.addMethod("keys", members, False, BuiltinTypes[IDLBuiltinType.Types.object],
@@ -3959,17 +3993,19 @@ class IDLConst(IDLInterfaceMember):
 
     def handleExtendedAttribute(self, attr):
         identifier = attr.identifier()
         if identifier == "Exposed":
             convertExposedAttrToGlobalNameSet(attr, self._exposureGlobalNames)
         elif (identifier == "Pref" or
               identifier == "ChromeOnly" 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
             pass
         else:
             raise WebIDLError("Unknown extended attribute %s on constant" % identifier,
                               [attr.location])
         IDLInterfaceMember.handleExtendedAttribute(self, attr)
 
     def _getDependentObjects(self):
@@ -3995,16 +4031,17 @@ class IDLAttribute(IDLInterfaceMember):
         self.enforceRange = False
         self.clamp = False
         self.slotIndices = None
         assert maplikeOrSetlike is None or isinstance(maplikeOrSetlike, IDLMaplikeOrSetlike)
         self.maplikeOrSetlike = maplikeOrSetlike
         self.dependsOn = "Everything"
         self.affects = "Everything"
         self.navigatorObjectGetter = navigatorObjectGetter
+        self.bindingAliases = []
 
         if static and identifier.name == "prototype":
             raise WebIDLError("The identifier of a static attribute must not be 'prototype'",
                               [location])
 
         if readonly and inherit:
             raise WebIDLError("An attribute cannot be both 'readonly' and 'inherit'",
                               [self.location])
@@ -4133,21 +4170,27 @@ class IDLAttribute(IDLInterfaceMember):
         if self.getExtendedAttribute("CEReactions"):
             if self.readonly:
                 raise WebIDLError("[CEReactions] is not allowed on "
                                   "readonly attributes",
                                   [self.location])
 
     def handleExtendedAttribute(self, attr):
         identifier = attr.identifier()
-        if ((identifier == "SetterThrows" or identifier == "SetterCanOOM")
+        if ((identifier == "SetterThrows" or identifier == "SetterCanOOM" or
+             identifier == "SetterNeedsSubjectPrincipal")
             and self.readonly):
             raise WebIDLError("Readonly attributes must not be flagged as "
                               "[%s]" % identifier,
                               [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
                 identifier == "CanOOM" or identifier == "GetterCanOOM") and
                self.getExtendedAttribute("StoreInSlot")) or
               (identifier == "StoreInSlot" and
                (self.getExtendedAttribute("Throws") or
                 self.getExtendedAttribute("GetterThrows") or
                 self.getExtendedAttribute("CanOOM") or
                 self.getExtendedAttribute("GetterCanOOM")))):
@@ -4333,21 +4376,23 @@ class IDLAttribute(IDLInterfaceMember):
               identifier == "SetterCanOOM" or
               identifier == "CanOOM" or
               identifier == "GetterCanOOM" or
               identifier == "ChromeOnly" or
               identifier == "Func" or
               identifier == "SecureContext" or
               identifier == "Frozen" or
               identifier == "NewObject" or
-              identifier == "UnsafeInPrerendering" or
               identifier == "NeedsSubjectPrincipal" or
+              identifier == "SetterNeedsSubjectPrincipal" or
+              identifier == "GetterNeedsSubjectPrincipal" or
               identifier == "NeedsCallerType" or
               identifier == "ReturnValueNeedsContainsHack" or
-              identifier == "BinaryName"):
+              identifier == "BinaryName" or
+              identifier == "NonEnumerable"):
             # Known attributes that we don't need to do anything with here
             pass
         else:
             raise WebIDLError("Unknown extended attribute %s on attribute" % identifier,
                               [attr.location])
         IDLInterfaceMember.handleExtendedAttribute(self, attr)
 
     def resolve(self, parentScope):
@@ -4601,30 +4646,29 @@ class IDLMethodOverload:
         return deps
 
 
 class IDLMethod(IDLInterfaceMember, IDLScope):
 
     Special = enum(
         'Getter',
         'Setter',
-        'Creator',
         'Deleter',
         'LegacyCaller',
         base=IDLInterfaceMember.Special
     )
 
     NamedOrIndexed = enum(
         'Neither',
         'Named',
         'Indexed'
     )
 
     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,
                  legacycaller=False, stringifier=False, jsonifier=False,
                  maplikeOrSetlikeOrIterable=None, htmlConstructor=False):
         # REVIEW: specialType is NamedOrIndexed -- wow, this is messed up.
         IDLInterfaceMember.__init__(self, location, identifier,
                                     IDLInterfaceMember.Tags.Method)
 
         self._hasOverloads = False
@@ -4635,18 +4679,16 @@ class IDLMethod(IDLInterfaceMember, IDLS
         self._overloads = [IDLMethodOverload(returnType, arguments, location)]
 
         assert isinstance(static, bool)
         self._static = static
         assert isinstance(getter, bool)
         self._getter = getter
         assert isinstance(setter, bool)
         self._setter = setter
-        assert isinstance(creator, bool)
-        self._creator = creator
         assert isinstance(deleter, bool)
         self._deleter = deleter
         assert isinstance(legacycaller, bool)
         self._legacycaller = legacycaller
         assert isinstance(stringifier, bool)
         self._stringifier = stringifier
         assert isinstance(jsonifier, bool)
         self._jsonifier = jsonifier
@@ -4677,17 +4719,17 @@ class IDLMethod(IDLInterfaceMember, IDLS
             overload = self._overloads[0]
             arguments = overload.arguments
             assert len(arguments) == 1
             assert (arguments[0].type == BuiltinTypes[IDLBuiltinType.Types.domstring] or
                     arguments[0].type == BuiltinTypes[IDLBuiltinType.Types.unsigned_long])
             assert not arguments[0].optional and not arguments[0].variadic
             assert not self._getter or not overload.returnType.isVoid()
 
-        if self._setter or self._creator:
+        if self._setter:
             assert len(self._overloads) == 1
             arguments = self._overloads[0].arguments
             assert len(arguments) == 2
             assert (arguments[0].type == BuiltinTypes[IDLBuiltinType.Types.domstring] or
                     arguments[0].type == BuiltinTypes[IDLBuiltinType.Types.unsigned_long])
             assert not arguments[0].optional and not arguments[0].variadic
             assert not arguments[1].optional and not arguments[1].variadic
 
@@ -4710,19 +4752,16 @@ class IDLMethod(IDLInterfaceMember, IDLS
         self._static = True
 
     def isGetter(self):
         return self._getter
 
     def isSetter(self):
         return self._setter
 
-    def isCreator(self):
-        return self._creator
-
     def isDeleter(self):
         return self._deleter
 
     def isNamed(self):
         assert (self._specialType == IDLMethod.NamedOrIndexed.Named or
                 self._specialType == IDLMethod.NamedOrIndexed.Indexed)
         return self._specialType == IDLMethod.NamedOrIndexed.Named
 
@@ -4745,17 +4784,16 @@ class IDLMethod(IDLInterfaceMember, IDLS
         True if this method was generated as part of a
         maplike/setlike/etc interface (e.g. has/get methods)
         """
         return self.maplikeOrSetlikeOrIterable is not None
 
     def isSpecial(self):
         return (self.isGetter() or
                 self.isSetter() or
-                self.isCreator() or
                 self.isDeleter() or
                 self.isLegacycaller() or
                 self.isStringifier() or
                 self.isJsonifier())
 
     def isHTMLConstructor(self):
         return self._htmlConstructor
 
@@ -4801,18 +4839,16 @@ class IDLMethod(IDLInterfaceMember, IDLS
             raise WebIDLError("Overloaded identifier %s appears with different values of the 'legacycaller' attribute" % method.identifier,
                               [method.location])
 
         # Can't overload special things!
         assert not self.isGetter()
         assert not method.isGetter()
         assert not self.isSetter()
         assert not method.isSetter()
-        assert not self.isCreator()
-        assert not method.isCreator()
         assert not self.isDeleter()
         assert not method.isDeleter()
         assert not self.isStringifier()
         assert not method.isStringifier()
         assert not self.isJsonifier()
         assert not method.isJsonifier()
         assert not self.isHTMLConstructor()
         assert not method.isHTMLConstructor()
@@ -4979,17 +5015,19 @@ class IDLMethod(IDLInterfaceMember, IDLS
                           "distinguishable" % (argc, self.identifier.name),
                           locations)
 
     def handleExtendedAttribute(self, attr):
         identifier = attr.identifier()
         if (identifier == "GetterThrows" or
             identifier == "SetterThrows" or
             identifier == "GetterCanOOM" or
-            identifier == "SetterCanOOM"):
+            identifier == "SetterCanOOM" or
+            identifier == "SetterNeedsSubjectPrincipal" or
+            identifier == "GetterNeedsSubjectPrincipal"):
             raise WebIDLError("Methods must not be flagged as "
                               "[%s]" % identifier,
                               [attr.location, self.location])
         elif identifier == "Unforgeable":
             if self.isStatic():
                 raise WebIDLError("[Unforgeable] is only allowed on non-static "
                                   "methods", [attr.location, self.location])
             self._unforgeable = True
@@ -5066,25 +5104,25 @@ class IDLMethod(IDLInterfaceMember, IDLS
             if self.isSpecial() and not self.isSetter() and not self.isDeleter():
                 raise WebIDLError("[CEReactions] is only allowed on operation, "
                                   "attribute, setter, and deleter",
                                   [attr.location, self.location])
         elif (identifier == "Throws" or
               identifier == "CanOOM" or
               identifier == "NewObject" or
               identifier == "ChromeOnly" or
-              identifier == "UnsafeInPrerendering" or
               identifier == "Pref" or
               identifier == "Deprecated" or
               identifier == "Func" or
               identifier == "SecureContext" or
               identifier == "BinaryName" or
               identifier == "NeedsSubjectPrincipal" or
               identifier == "NeedsCallerType" or
-              identifier == "StaticClassOverride"):
+              identifier == "StaticClassOverride" or
+              identifier == "NonEnumerable"):
             # Known attributes that we don't need to do anything with here
             pass
         else:
             raise WebIDLError("Unknown extended attribute %s on method" % identifier,
                               [attr.location])
         IDLInterfaceMember.handleExtendedAttribute(self, attr)
 
     def returnsPromise(self):
@@ -5257,17 +5295,16 @@ class Tokenizer(object):
         "jsonifier": "JSONIFIER",
         "unrestricted": "UNRESTRICTED",
         "attribute": "ATTRIBUTE",
         "readonly": "READONLY",
         "inherit": "INHERIT",
         "static": "STATIC",
         "getter": "GETTER",
         "setter": "SETTER",
-        "creator": "CREATOR",
         "deleter": "DELETER",
         "legacycaller": "LEGACYCALLER",
         "optional": "OPTIONAL",
         "...": "ELLIPSIS",
         "::": "SCOPE",
         "Date": "DATE",
         "DOMString": "DOMSTRING",
         "ByteString": "BYTESTRING",
@@ -5972,23 +6009,22 @@ class Parser(Tokenizer):
 
         stringifier = IDLInterfaceMember.Special.Stringifier in p[1]
         # If stringifier is there that's all that's allowed.  This is disallowed
         # by the parser, so we can assert here.
         assert not stringifier or len(qualifiers) == 1
 
         getter = True if IDLMethod.Special.Getter 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
         legacycaller = True if IDLMethod.Special.LegacyCaller in p[1] else False
 
         if getter or deleter:
-            if setter or creator:
-                raise WebIDLError("getter and deleter are incompatible with setter and creator",
+            if setter:
+                raise WebIDLError("getter and deleter are incompatible with setter",
                                   [self.getLocation(p, 1)])
 
         (returnType, identifier, arguments) = p[2]
 
         assert isinstance(returnType, IDLType)
 
         specialType = IDLMethod.NamedOrIndexed.Neither
 
@@ -6013,72 +6049,67 @@ class Parser(Tokenizer):
                 raise WebIDLError("%s cannot have %s argument" %
                                   ("getter" if getter else "deleter",
                                    "optional" if arguments[0].optional else "variadic"),
                                   [arguments[0].location])
         if getter:
             if returnType.isVoid():
                 raise WebIDLError("getter cannot have void return type",
                                   [self.getLocation(p, 2)])
-        if setter or creator:
+        if setter:
             if len(arguments) != 2:
-                raise WebIDLError("%s has wrong number of arguments" %
-                                  ("setter" if setter else "creator"),
+                raise WebIDLError("setter has wrong number of arguments",
                                   [self.getLocation(p, 2)])
             argType = arguments[0].type
             if argType == BuiltinTypes[IDLBuiltinType.Types.domstring]:
                 specialType = IDLMethod.NamedOrIndexed.Named
             elif argType == BuiltinTypes[IDLBuiltinType.Types.unsigned_long]:
                 specialType = IDLMethod.NamedOrIndexed.Indexed
             else:
-                raise WebIDLError("%s has wrong argument type (must be DOMString or UnsignedLong)" %
-                                  ("setter" if setter else "creator"),
+                raise WebIDLError("settter has wrong argument type (must be DOMString or UnsignedLong)",
                                   [arguments[0].location])
             if arguments[0].optional or arguments[0].variadic:
-                raise WebIDLError("%s cannot have %s argument" %
-                                  ("setter" if setter else "creator",
-                                   "optional" if arguments[0].optional else "variadic"),
+                raise WebIDLError("setter cannot have %s argument" %
+                                   ("optional" if arguments[0].optional else "variadic"),
                                   [arguments[0].location])
             if arguments[1].optional or arguments[1].variadic:
-                raise WebIDLError("%s cannot have %s argument" %
-                                  ("setter" if setter else "creator",
-                                   "optional" if arguments[1].optional else "variadic"),
+                raise WebIDLError("setter cannot have %s argument" %
+                                   ("optional" if arguments[1].optional else "variadic"),
                                   [arguments[1].location])
 
         if stringifier:
             if len(arguments) != 0:
                 raise WebIDLError("stringifier has wrong number of arguments",
                                   [self.getLocation(p, 2)])
             if not returnType.isDOMString():
                 raise WebIDLError("stringifier must have DOMString return type",
                                   [self.getLocation(p, 2)])
 
         # identifier might be None.  This is only permitted for special methods.
         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):
                 raise WebIDLError("Identifier required for non-special methods",
                                   [self.getLocation(p, 2)])
 
             location = BuiltinLocation("<auto-generated-identifier>")
             identifier = IDLUnresolvedIdentifier(
                 location,
-                "__%s%s%s%s%s%s%s" %
+                "__%s%s%s%s%s%s" %
                 ("named" if specialType == IDLMethod.NamedOrIndexed.Named else
                  "indexed" if specialType == IDLMethod.NamedOrIndexed.Indexed else "",
                  "getter" if getter else "",
                  "setter" if setter else "",
                  "deleter" if deleter else "",
-                 "creator" if creator else "",
                  "legacycaller" if legacycaller else "",
                  "stringifier" if stringifier else ""),
                 allowDoubleUnderscore=True)
 
         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,
                            legacycaller=legacycaller, stringifier=stringifier)
         p[0] = method
 
     def p_Stringifier(self, p):
         """
             Operation : STRINGIFIER SEMICOLON
         """
@@ -6144,22 +6175,16 @@ class Parser(Tokenizer):
         p[0] = IDLMethod.Special.Getter
 
     def p_SpecialSetter(self, p):
         """
             Special : SETTER
         """
         p[0] = IDLMethod.Special.Setter
 
-    def p_SpecialCreator(self, p):
-        """
-            Special : CREATOR
-        """
-        p[0] = IDLMethod.Special.Creator
-
     def p_SpecialDeleter(self, p):
         """
             Special : DELETER
         """
         p[0] = IDLMethod.Special.Deleter
 
     def p_SpecialLegacyCaller(self, p):
         """
@@ -6241,17 +6266,16 @@ class Parser(Tokenizer):
         p[0].addExtendedAttributes(p[1])
 
     def p_ArgumentName(self, p):
         """
             ArgumentName : IDENTIFIER
                          | ATTRIBUTE
                          | CALLBACK
                          | CONST
-                         | CREATOR
                          | DELETER
                          | DICTIONARY
                          | ENUM
                          | EXCEPTION
                          | GETTER
                          | IMPLEMENTS
                          | INHERIT
                          | INTERFACE
@@ -6391,17 +6415,16 @@ class Parser(Tokenizer):
                   | BYTESTRING
                   | USVSTRING
                   | ANY
                   | ATTRIBUTE
                   | BOOLEAN
                   | BYTE
                   | LEGACYCALLER
                   | CONST
-                  | CREATOR
                   | DELETER
                   | DOUBLE
                   | EXCEPTION
                   | FALSE
                   | FLOAT
                   | GETTER
                   | IMPLEMENTS
                   | INHERIT
--- a/servo/components/script/dom/bindings/codegen/parser/abstract.patch
+++ b/servo/components/script/dom/bindings/codegen/parser/abstract.patch
@@ -1,12 +1,12 @@
 --- WebIDL.py
 +++ WebIDL.py
-@@ -1416,7 +1416,8 @@
-                   identifier == "LegacyEventInit" or
-                   identifier == "ProbablyShortLivingObject" or
+@@ -1744,7 +1744,8 @@
+                   identifier == "ProbablyShortLivingWrapper" or
                    identifier == "LegacyUnenumerableNamedProperties" or
+                   identifier == "RunConstructorInCallerCompartment" or
 -                  identifier == "NonOrdinaryGetPrototypeOf"):
 +                  identifier == "NonOrdinaryGetPrototypeOf" or
 +                  identifier == "Abstract"):
                  # Known extended attributes that do not take values
                  if not attr.noArguments():
                      raise WebIDLError("[%s] must take no arguments" % identifier,
--- a/servo/components/script/dom/bindings/codegen/parser/tests/test_cereactions.py
+++ b/servo/components/script/dom/bindings/codegen/parser/tests/test_cereactions.py
@@ -101,31 +101,16 @@ def WebIDLTest(parser, harness):
     harness.ok(threw,
                "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()
-    threw = False
-    try:
-        parser.parse("""
-          interface Foo {
             [CEReactions] legacycaller double compute(double x);
           };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
--- a/servo/components/script/dom/bindings/codegen/parser/tests/test_constructor.py
+++ b/servo/components/script/dom/bindings/codegen/parser/tests/test_constructor.py
@@ -6,30 +6,29 @@ def WebIDLTest(parser, harness):
                    "Should be an IDLArgument")
         harness.check(argument.identifier.QName(), QName, "Argument has the right QName")
         harness.check(argument.identifier.name, name, "Argument has the right name")
         harness.check(str(argument.type), type, "Argument has the right return type")
         harness.check(argument.optional, optional, "Argument has the right optional value")
         harness.check(argument.variadic, variadic, "Argument has the right variadic value")
 
     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,
                     chromeOnly=False, htmlConstructor=False):
         harness.ok(isinstance(method, WebIDL.IDLMethod),
                    "Should be an IDLMethod")
         harness.ok(method.isMethod(), "Method is a method")
         harness.ok(not method.isAttr(), "Method is not an attr")
         harness.ok(not method.isConst(), "Method is not a const")
         harness.check(method.identifier.QName(), QName, "Method has the right QName")
         harness.check(method.identifier.name, name, "Method has the right name")
         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.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.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
         harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
         harness.check(method.getExtendedAttribute("ChromeOnly") is not None, chromeOnly, "Method has the correct value for ChromeOnly")
         harness.check(method.isHTMLConstructor(), htmlConstructor, "Method has the correct htmlConstructor value")
         harness.check(len(method.signatures()), len(signatures), "Method has the correct number of signatures")
 
         sigpairs = zip(method.signatures(), signatures)
--- a/servo/components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py
+++ b/servo/components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py
@@ -25,30 +25,16 @@ def WebIDLTest(parser, harness):
     except:
         threw = True
 
     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
-    try:
-        parser.parse("""
             interface DuplicateQualifiers4 {
               deleter deleter byte foo(unsigned long index);
             };
         """)
 
         results = parser.finish()
     except:
         threw = True
@@ -63,22 +49,8 @@ def WebIDLTest(parser, harness):
             };
         """)
 
         results = parser.finish()
     except:
         threw = True
 
     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.")
--- a/servo/components/script/dom/bindings/codegen/parser/tests/test_global_extended_attr.py
+++ b/servo/components/script/dom/bindings/codegen/parser/tests/test_global_extended_attr.py
@@ -34,34 +34,16 @@ def WebIDLTest(parser, harness):
 
     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()
-    threw = False
-    try:
-        parser.parse("""
-          [Global]
-          interface Foo {
-            getter any(DOMString name);
             deleter void(DOMString name);
           };
         """)
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw,
--- a/servo/components/script/dom/bindings/codegen/parser/tests/test_method.py
+++ b/servo/components/script/dom/bindings/codegen/parser/tests/test_method.py
@@ -36,29 +36,28 @@ def WebIDLTest(parser, harness):
                    "Should be an IDLArgument")
         harness.check(argument.identifier.QName(), QName, "Argument has the right QName")
         harness.check(argument.identifier.name, name, "Argument has the right name")
         harness.check(str(argument.type), type, "Argument has the right return type")
         harness.check(argument.optional, optional, "Argument has the right optional value")
         harness.check(argument.variadic, variadic, "Argument has the right variadic value")
 
     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):
         harness.ok(isinstance(method, WebIDL.IDLMethod),
                    "Should be an IDLMethod")
         harness.ok(method.isMethod(), "Method is a method")
         harness.ok(not method.isAttr(), "Method is not an attr")
         harness.ok(not method.isConst(), "Method is not a const")
         harness.check(method.identifier.QName(), QName, "Method has the right QName")
         harness.check(method.identifier.name, name, "Method has the right name")
         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.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.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
         harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
         harness.check(len(method.signatures()), len(signatures), "Method has the correct number of signatures")
 
         sigpairs = zip(method.signatures(), signatures)
         for (gotSignature, expectedSignature) in sigpairs:
             (gotRetType, gotArgs) = gotSignature
--- a/servo/components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py
+++ b/servo/components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py
@@ -217,78 +217,8 @@ def WebIDLTest(parser, harness):
             };
         """)
 
         results = parser.finish()
     except:
         threw = True
 
     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.")
--- a/servo/components/script/dom/bindings/codegen/parser/tests/test_special_methods.py
+++ b/servo/components/script/dom/bindings/codegen/parser/tests/test_special_methods.py
@@ -1,76 +1,63 @@
 import WebIDL
 
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface SpecialMethods {
           getter long long (unsigned long index);
           setter long long (unsigned long index, long long value);
-          creator long long (unsigned long index, long long value);
           getter boolean (DOMString name);
           setter boolean (DOMString name, boolean value);
-          creator boolean (DOMString name, boolean value);
           deleter boolean (DOMString name);
           readonly attribute unsigned long length;
         };
 
         interface SpecialMethodsCombination {
-          setter creator long long (unsigned long index, long long value);
           getter deleter boolean (DOMString name);
-          setter creator boolean (DOMString name, boolean value);
         };
     """)
 
     results = parser.finish()
 
     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):
         harness.ok(isinstance(method, WebIDL.IDLMethod),
                    "Should be an IDLMethod")
         harness.check(method.identifier.QName(), QName, "Method has the right QName")
         harness.check(method.identifier.name, name, "Method has the right name")
         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.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.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
         harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
 
     harness.check(len(results), 2, "Expect 2 interfaces")
 
     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",
                 getter=True)
     checkMethod(iface.members[1], "::SpecialMethods::__indexedsetter", "__indexedsetter",
                 setter=True)
-    checkMethod(iface.members[2], "::SpecialMethods::__indexedcreator", "__indexedcreator",
-                creator=True)
-    checkMethod(iface.members[3], "::SpecialMethods::__namedgetter", "__namedgetter",
+    checkMethod(iface.members[2], "::SpecialMethods::__namedgetter", "__namedgetter",
                 getter=True)
-    checkMethod(iface.members[4], "::SpecialMethods::__namedsetter", "__namedsetter",
+    checkMethod(iface.members[3], "::SpecialMethods::__namedsetter", "__namedsetter",
                 setter=True)
-    checkMethod(iface.members[5], "::SpecialMethods::__namedcreator", "__namedcreator",
-                creator=True)
-    checkMethod(iface.members[6], "::SpecialMethods::__nameddeleter", "__nameddeleter",
+    checkMethod(iface.members[4], "::SpecialMethods::__nameddeleter", "__nameddeleter",
                 deleter=True)
 
     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",
-                "__indexedsettercreator", setter=True, creator=True)
-    checkMethod(iface.members[1], "::SpecialMethodsCombination::__namedgetterdeleter",
+    checkMethod(iface.members[0], "::SpecialMethodsCombination::__namedgetterdeleter",
                 "__namedgetterdeleter", getter=True, deleter=True)
-    checkMethod(iface.members[2], "::SpecialMethodsCombination::__namedsettercreator",
-                "__namedsettercreator", setter=True, creator=True)
 
     parser = parser.reset();
 
     threw = False
     try:
         parser.parse(
             """
             interface IndexedDeleter {
--- a/servo/components/script/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py
+++ b/servo/components/script/dom/bindings/codegen/parser/tests/test_special_methods_uniqueness.py
@@ -30,33 +30,18 @@ def WebIDLTest(parser, harness):
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodUniqueness1 {
-              setter creator boolean (DOMString name);
-              creator boolean (DOMString name);
+              setter boolean (DOMString name);
+              setter boolean (DOMString name);
             };
         """)
 
         results = parser.finish()
     except:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
-
-    threw = False
-    try:
-        parser.parse("""
-            interface SpecialMethodUniqueness1 {
-              setter boolean (DOMString name);
-              creator setter boolean (DOMString name);
-            };
-        """)
-
-        results = parser.finish()
-    except:
-        threw = True
-
-    harness.ok(threw, "Should have thrown.")
--- a/servo/components/script/dom/webgl2renderingcontext.rs
+++ b/servo/components/script/dom/webgl2renderingcontext.rs
@@ -3,18 +3,20 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /// https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl.idl
 use canvas_traits::webgl::WebGLVersion;
 use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding;
 use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextMethods;
 use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLContextAttributes;
 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::Int32ArrayOrLongSequence;
 use dom::bindings::error::{ErrorResult, Fallible};
 use dom::bindings::reflector::{reflect_dom_object, Reflector};
 use dom::bindings::root::{Dom, DomRoot, LayoutDom};
 use dom::bindings::str::DOMString;
 use dom::htmlcanvaselement::HTMLCanvasElement;
 use dom::htmliframeelement::HTMLIFrameElement;
 use dom::webglactiveinfo::WebGLActiveInfo;
 use dom::webglbuffer::WebGLBuffer;
@@ -27,17 +29,17 @@ use dom::webglshaderprecisionformat::Web
 use dom::webgltexture::WebGLTexture;
 use dom::webgluniformlocation::WebGLUniformLocation;
 use dom::window::Window;
 use dom_struct::dom_struct;
 use euclid::Size2D;
 use js::jsapi::{JSContext, JSObject};
 use js::jsval::JSVal;
 use js::rust::CustomAutoRooterGuard;
-use js::typedarray::{ArrayBufferView, Float32Array, Int32Array};
+use js::typedarray::ArrayBufferView;
 use offscreen_gl_context::GLContextAttributes;
 use script_layout_interface::HTMLCanvasDataSource;
 use std::ptr::NonNull;
 
 #[dom_struct]
 pub struct WebGL2RenderingContext {
     reflector_: Reflector,
     base: Dom<WebGLRenderingContext>,
@@ -234,17 +236,17 @@ impl WebGL2RenderingContextMethods for W
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
     fn BufferData_(&self, target: u32, size: i64, usage: u32) -> Fallible<()> {
         self.base.BufferData_(target, size, usage)
     }
 
     /// 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)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
     fn CompressedTexImage2D(&self, target: u32, level: i32, internal_format: u32,
                             width: i32, height: i32, border: i32,
                             pixels: CustomAutoRooterGuard<ArrayBufferView>) {
         self.base.CompressedTexImage2D(target, level, internal_format, width, height, border, pixels)
@@ -605,268 +607,210 @@ impl WebGL2RenderingContextMethods for W
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform1i(&self,
                   location: Option<&WebGLUniformLocation>,
                   val: i32) {
         self.base.Uniform1i(location, val)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform1iv(&self,
-                  location: Option<&WebGLUniformLocation>,
-                  v: CustomAutoRooterGuard<Int32Array>) {
+    fn Uniform1iv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        v: Int32ArrayOrLongSequence,
+    ) {
         self.base.Uniform1iv(location, v)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform1iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
-        self.base.Uniform1iv_(location, v);
-    }
-
-    /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform1fv(&self,
-                  location: Option<&WebGLUniformLocation>,
-                  v: CustomAutoRooterGuard<Float32Array>) {
+    fn Uniform1fv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
+    ) {
         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
     fn Uniform2f(&self,
                   location: Option<&WebGLUniformLocation>,
                   x: f32, y: f32) {
         self.base.Uniform2f(location, x, y)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform2fv(&self,
-                  location: Option<&WebGLUniformLocation>,
-                  v: CustomAutoRooterGuard<Float32Array>) {
-        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);
+    fn Uniform2fv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
+    ) {
+        self.base.Uniform2fv(location, v);
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform2i(&self,
                   location: Option<&WebGLUniformLocation>,
                   x: i32, y: i32) {
         self.base.Uniform2i(location, x, y)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform2iv(&self,
-                  location: Option<&WebGLUniformLocation>,
-                  v: CustomAutoRooterGuard<Int32Array>) {
+    fn Uniform2iv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        v: Int32ArrayOrLongSequence,
+    ) {
         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
     fn Uniform3f(&self,
                   location: Option<&WebGLUniformLocation>,
                   x: f32, y: f32, z: f32) {
         self.base.Uniform3f(location, x, y, z)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform3fv(&self,
-                  location: Option<&WebGLUniformLocation>,
-                  v: CustomAutoRooterGuard<Float32Array>) {
-        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);
+    fn Uniform3fv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
+    ) {
+        self.base.Uniform3fv(location, v);
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform3i(&self,
                   location: Option<&WebGLUniformLocation>,
                   x: i32, y: i32, z: i32) {
         self.base.Uniform3i(location, x, y, z)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform3iv(&self,
-                  location: Option<&WebGLUniformLocation>,
-                  v: CustomAutoRooterGuard<Int32Array>) {
+    fn Uniform3iv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        v: Int32ArrayOrLongSequence,
+    ) {
         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
     fn Uniform4i(&self,
                   location: Option<&WebGLUniformLocation>,
                   x: i32, y: i32, z: i32, w: i32) {
         self.base.Uniform4i(location, x, y, z, w)
     }
 
-
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform4iv(&self,
-                  location: Option<&WebGLUniformLocation>,
-                  v: CustomAutoRooterGuard<Int32Array>) {
+    fn Uniform4iv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        v: Int32ArrayOrLongSequence,
+    ) {
         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
     fn Uniform4f(&self,
                   location: Option<&WebGLUniformLocation>,
                   x: f32, y: f32, z: f32, w: f32) {
         self.base.Uniform4f(location, x, y, z, w)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform4fv(&self,
-                  location: Option<&WebGLUniformLocation>,
-                  v: CustomAutoRooterGuard<Float32Array>) {
-        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);
+    fn Uniform4fv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
+    ) {
+        self.base.Uniform4fv(location, v);
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn UniformMatrix2fv(&self,
-                        location: Option<&WebGLUniformLocation>,
-                        transpose: bool,
-                        v: CustomAutoRooterGuard<Float32Array>) {
+    fn UniformMatrix2fv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        transpose: bool,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
+    ) {
         self.base.UniformMatrix2fv(location, transpose, v)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn UniformMatrix2fv_(&self, location: Option<&WebGLUniformLocation>, transpose: bool, value: Vec<f32>) {
-        self.base.UniformMatrix2fv_(location, transpose, value);
-    }
-
-    /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn UniformMatrix3fv(&self,
-                        location: Option<&WebGLUniformLocation>,
-                        transpose: bool,
-                        v: CustomAutoRooterGuard<Float32Array>) {
+    fn UniformMatrix3fv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        transpose: bool,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
+    ) {
         self.base.UniformMatrix3fv(location, transpose, v)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn UniformMatrix3fv_(&self, location: Option<&WebGLUniformLocation>, transpose: bool, value: Vec<f32>) {
-        self.base.UniformMatrix3fv_(location, transpose, value);
-    }
-
-    /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn UniformMatrix4fv(&self,
-                        location: Option<&WebGLUniformLocation>,
-                        transpose: bool,
-                        v: CustomAutoRooterGuard<Float32Array>) {
+    fn UniformMatrix4fv(
+        &self,
+        location: Option<&WebGLUniformLocation>,
+        transpose: bool,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
+    ) {
         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
     fn UseProgram(&self, program: Option<&WebGLProgram>) {
         self.base.UseProgram(program)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
     fn ValidateProgram(&self, program: &WebGLProgram) {
         self.base.ValidateProgram(program)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn VertexAttrib1f(&self, indx: u32, x: f32) {
         self.base.VertexAttrib1f(indx, x)
     }
 
     /// 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)
     }
 
     /// 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
     fn VertexAttrib2f(&self, indx: u32, x: f32, y: f32) {
         self.base.VertexAttrib2f(indx, x, y)
     }
 
     /// 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)
     }
 
     /// 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
     fn VertexAttrib3f(&self, indx: u32, x: f32, y: f32, z: f32) {
         self.base.VertexAttrib3f(indx, x, y, z)
     }
 
     /// 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)
     }
 
     /// 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
     fn VertexAttrib4f(&self, indx: u32, x: f32, y: f32, z: f32, w: f32) {
         self.base.VertexAttrib4f(indx, x, y, z, w)
     }
 
     /// 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)
     }
 
     /// 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
     fn VertexAttribPointer(&self, attrib_id: u32, size: i32, data_type: u32,
                            normalized: bool, stride: i32, offset: i64) {
         self.base.VertexAttribPointer(attrib_id, size, data_type, normalized, stride, offset)
     }
 
     /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.4
     fn Viewport(&self, x: i32, y: i32, width: i32, height: i32) {
         self.base.Viewport(x, y, width, height)
--- a/servo/components/script/dom/webglrenderingcontext.rs
+++ b/servo/components/script/dom/webglrenderingcontext.rs
@@ -9,20 +9,22 @@ use canvas_traits::webgl::{WebGLFramebuf
 use canvas_traits::webgl::DOMToTextureCommand;
 use canvas_traits::webgl::WebGLError::*;
 use canvas_traits::webgl::webgl_channel;
 use dom::bindings::cell::DomRefCell;
 use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextConstants as WebGL2Constants;
 use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes};
 use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
 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::Int32ArrayOrLongSequence;
 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::reflector::{DomObject, Reflector, reflect_dom_object};
 use dom::bindings::root::{Dom, DomRoot, LayoutDom, MutNullableDom};
 use dom::bindings::str::DOMString;
 use dom::event::{Event, EventBubbles, EventCancelable};
 use dom::htmlcanvaselement::HTMLCanvasElement;
 use dom::htmlcanvaselement::utils as canvas_utils;
 use dom::htmliframeelement::HTMLIFrameElement;
@@ -45,17 +47,17 @@ use dom::webgluniformlocation::WebGLUnif
 use dom::window::Window;
 use dom_struct::dom_struct;
 use euclid::Size2D;
 use fnv::FnvHashMap;
 use half::f16;
 use js::jsapi::{JSContext, JSObject, Type};
 use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UndefinedValue};
 use js::rust::CustomAutoRooterGuard;
-use js::typedarray::{ArrayBufferView, Float32Array, Int32Array};
+use js::typedarray::ArrayBufferView;
 use net_traits::image::base::PixelFormat;
 use net_traits::image_cache::ImageResponse;
 use offscreen_gl_context::{GLContextAttributes, GLLimits};
 use script_layout_interface::HTMLCanvasDataSource;
 use servo_config::prefs::PREFS;
 use std::cell::{Cell, Ref};
 use std::cmp;
 use std::iter::FromIterator;
@@ -1669,17 +1671,23 @@ impl WebGLRenderingContextMethods for We
         match texture {
             Some(texture) => handle_potential_webgl_error!(self, texture.generate_mipmap()),
             None => self.webgl_error(InvalidOperation)
         }
     }
 
     #[allow(unsafe_code)]
     // 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() {
             return Ok(self.webgl_error(InvalidValue));
         }
 
         typedarray!(in(cx) let array_buffer: ArrayBuffer = data);
         let data_vec = match array_buffer {
             Ok(mut data) => data.to_vec(),
             Err(_) => fallible_array_buffer_view_to_vec(cx, data)?,
@@ -1704,17 +1712,17 @@ impl WebGLRenderingContextMethods for We
         }
 
         handle_potential_webgl_error!(self, bound_buffer.buffer_data(target, &data_vec, usage));
 
         Ok(())
     }
 
     // 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 {
             constants::ARRAY_BUFFER => self.bound_buffer_array.get(),
             constants::ELEMENT_ARRAY_BUFFER => self.bound_buffer_element_array.get(),
             _ => return Ok(self.webgl_error(InvalidEnum)),
         };
 
         let bound_buffer = match bound_buffer {
             Some(bound_buffer) => bound_buffer,
@@ -1736,21 +1744,21 @@ impl WebGLRenderingContextMethods for We
         // not great, but we don't have a fallible allocation to try.
         let data = vec![0u8; size as usize];
         handle_potential_webgl_error!(self, bound_buffer.buffer_data(target, &data, usage));
 
         Ok(())
     }
 
     // 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 {
             // Typed array is rooted, so we can safely temporarily retrieve its slice
-            Some(ArrayBufferOrArrayBufferView::ArrayBuffer(mut inner)) => inner.to_vec(),
-            Some(ArrayBufferOrArrayBufferView::ArrayBufferView(mut inner)) => inner.to_vec(),
+            Some(ArrayBufferViewOrArrayBuffer::ArrayBuffer(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.
             None => return self.webgl_error(InvalidValue),
         };
 
         let bound_buffer = match target {
             constants::ARRAY_BUFFER => self.bound_buffer_array.get(),
             constants::ELEMENT_ARRAY_BUFFER => self.bound_buffer_element_array.get(),
             _ => return self.webgl_error(InvalidEnum),
@@ -2862,39 +2870,37 @@ impl WebGLRenderingContextMethods for We
             self.send_command(WebGLCommand::Uniform1i(location.unwrap().id(), val))
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform1iv(
         &self,
         location: Option<&WebGLUniformLocation>,
-        v: CustomAutoRooterGuard<Int32Array>,
+        v: Int32ArrayOrLongSequence,
     ) {
-        self.Uniform1iv_(location, v.to_vec());
-    }
-
-    // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform1iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
+        let v = match v {
+            Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
+            Int32ArrayOrLongSequence::LongSequence(v) => v,
+        };
         if self.validate_uniform_parameters(location, UniformSetterType::Int, &v) {
             self.send_command(WebGLCommand::Uniform1iv(location.unwrap().id(), v))
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform1fv(
         &self,
         location: Option<&WebGLUniformLocation>,
-        v: CustomAutoRooterGuard<Float32Array>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
     ) {
-        self.Uniform1fv_(location, v.to_vec());
-    }
-
-    // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn Uniform1fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
+        let v = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
         if self.validate_uniform_parameters(location, UniformSetterType::Float, &v) {
             self.send_command(WebGLCommand::Uniform1fv(location.unwrap().id(), v));
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform2f(&self,
                   location: Option<&WebGLUniformLocation>,
@@ -2903,26 +2909,23 @@ impl WebGLRenderingContextMethods for We
             self.send_command(WebGLCommand::Uniform2f(location.unwrap().id(), x, y));
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform2fv(
         &self,
         location: Option<&WebGLUniformLocation>,
-        v: CustomAutoRooterGuard<Float32Array>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
     ) {
-        self.Uniform2fv_(location, v.to_vec());
-    }
-
-    // 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) {
+        let v = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
+        if self.validate_uniform_parameters(location, UniformSetterType::FloatVec2, &v) {
             self.send_command(WebGLCommand::Uniform2fv(location.unwrap().id(), v));
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform2i(
         &self,
         location: Option<&WebGLUniformLocation>,
@@ -2935,26 +2938,23 @@ impl WebGLRenderingContextMethods for We
             self.send_command(WebGLCommand::Uniform2i(location.unwrap().id(), x, y));
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform2iv(
         &self,
         location: Option<&WebGLUniformLocation>,
-        v: CustomAutoRooterGuard<Int32Array>,
+        v: Int32ArrayOrLongSequence,
     ) {
-        self.Uniform2iv_(location, v.to_vec());
-    }
-
-    // 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) {
+        let v = match v {
+            Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
+            Int32ArrayOrLongSequence::LongSequence(v) => v,
+        };
+        if self.validate_uniform_parameters(location, UniformSetterType::IntVec2, &v) {
             self.send_command(WebGLCommand::Uniform2iv(location.unwrap().id(), v));
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform3f(
         &self,
         location: Option<&WebGLUniformLocation>,
@@ -2968,26 +2968,23 @@ impl WebGLRenderingContextMethods for We
             self.send_command(WebGLCommand::Uniform3f(location.unwrap().id(), x, y, z));
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform3fv(
         &self,
         location: Option<&WebGLUniformLocation>,
-        v: CustomAutoRooterGuard<Float32Array>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
     ) {
-        self.Uniform3fv_(location, v.to_vec());
-    }
-
-    // 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) {
+        let v = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
+        if self.validate_uniform_parameters(location, UniformSetterType::FloatVec3, &v) {
             self.send_command(WebGLCommand::Uniform3fv(location.unwrap().id(), v))
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform3i(&self,
                   location: Option<&WebGLUniformLocation>,
                   x: i32, y: i32, z: i32) {
@@ -2997,26 +2994,23 @@ impl WebGLRenderingContextMethods for We
             self.send_command(WebGLCommand::Uniform3i(location.unwrap().id(), x, y, z))
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform3iv(
         &self,
         location: Option<&WebGLUniformLocation>,
-        v: CustomAutoRooterGuard<Int32Array>,
+        v: Int32ArrayOrLongSequence,
     ) {
-        self.Uniform3iv_(location, v.to_vec());
-    }
-
-    // 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) {
+        let v = match v {
+            Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
+            Int32ArrayOrLongSequence::LongSequence(v) => v,
+        };
+        if self.validate_uniform_parameters(location, UniformSetterType::IntVec3, &v) {
             self.send_command(WebGLCommand::Uniform3iv(location.unwrap().id(), v))
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform4i(
         &self,
         location: Option<&WebGLUniformLocation>,
@@ -3032,26 +3026,23 @@ impl WebGLRenderingContextMethods for We
         }
     }
 
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform4iv(
         &self,
         location: Option<&WebGLUniformLocation>,
-        v: CustomAutoRooterGuard<Int32Array>,
+        v: Int32ArrayOrLongSequence,
     ) {
-        self.Uniform4iv_(location, v.to_vec());
-    }
-
-    // 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) {
+        let v = match v {
+            Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
+            Int32ArrayOrLongSequence::LongSequence(v) => v,
+        };
+        if self.validate_uniform_parameters(location, UniformSetterType::IntVec4, &v) {
             self.send_command(WebGLCommand::Uniform4iv(location.unwrap().id(), v))
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform4f(
         &self,
         location: Option<&WebGLUniformLocation>,
@@ -3066,97 +3057,72 @@ impl WebGLRenderingContextMethods for We
             self.send_command(WebGLCommand::Uniform4f(location.unwrap().id(), x, y, z, w))
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn Uniform4fv(
         &self,
         location: Option<&WebGLUniformLocation>,
-        v: CustomAutoRooterGuard<Float32Array>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
     ) {
-        self.Uniform4fv_(location, v.to_vec());
-    }
-
-    // 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) {
+        let v = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
+        if self.validate_uniform_parameters(location, UniformSetterType::FloatVec4, &v) {
             self.send_command(WebGLCommand::Uniform4fv(location.unwrap().id(), v))
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn UniformMatrix2fv(
         &self,
         location: Option<&WebGLUniformLocation>,
         transpose: bool,
-        v: CustomAutoRooterGuard<Float32Array>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
     ) {
-        self.UniformMatrix2fv_(location, transpose, v.to_vec());
-    }
-
-    // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn UniformMatrix2fv_(&self,
-                         location: Option<&WebGLUniformLocation>,
-                         transpose: bool,
-                         value: Vec<f32>) {
-        if self.validate_uniform_parameters(location,
-                                            UniformSetterType::FloatMat2,
-                                            &value) {
-            self.send_command(WebGLCommand::UniformMatrix2fv(location.unwrap().id(), transpose, value));
+        let v = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
+        if self.validate_uniform_parameters(location, UniformSetterType::FloatMat2, &v) {
+            self.send_command(WebGLCommand::UniformMatrix2fv(location.unwrap().id(), transpose, v));
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn UniformMatrix3fv(
         &self,
         location: Option<&WebGLUniformLocation>,
         transpose: bool,
-        v: CustomAutoRooterGuard<Float32Array>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
     ) {
-        self.UniformMatrix3fv_(location, transpose, v.to_vec());
-    }
-
-    // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn UniformMatrix3fv_(
-        &self,
-        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));
+        let v = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
+        if self.validate_uniform_parameters(location, UniformSetterType::FloatMat3, &v) {
+            self.send_command(WebGLCommand::UniformMatrix3fv(location.unwrap().id(), transpose, v));
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn UniformMatrix4fv(
         &self,
         location: Option<&WebGLUniformLocation>,
         transpose: bool,
-        v: CustomAutoRooterGuard<Float32Array>,
+        v: Float32ArrayOrUnrestrictedFloatSequence,
     ) {
-        self.UniformMatrix4fv_(location, transpose, v.to_vec());
-    }
-
-    // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn UniformMatrix4fv_(
-        &self,
-        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));
+        let v = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
+        if self.validate_uniform_parameters(location, UniformSetterType::FloatMat4, &v) {
+            self.send_command(WebGLCommand::UniformMatrix4fv(location.unwrap().id(), transpose, v));
         }
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
     fn UseProgram(&self, program: Option<&WebGLProgram>) {
         if let Some(program) = program {
             match program.use_program() {
                 Ok(()) => self.current_program.set(Some(program)),
@@ -3173,83 +3139,75 @@ impl WebGLRenderingContextMethods for We
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn VertexAttrib1f(&self, indx: u32, x: f32) {
         self.vertex_attrib(indx, x, 0f32, 0f32, 1f32)
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn VertexAttrib1fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
-        self.VertexAttrib1fv_(indx, v.to_vec());
-    }
-
-    // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn VertexAttrib1fv_(&self, indx: u32, values: Vec<f32>) {
+    fn VertexAttrib1fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
+        let values = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
         if values.len() < 1 {
             return self.webgl_error(InvalidOperation);
         }
-
         self.vertex_attrib(indx, values[0], 0f32, 0f32, 1f32);
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn VertexAttrib2f(&self, indx: u32, x: f32, y: f32) {
         self.vertex_attrib(indx, x, y, 0f32, 1f32)
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn VertexAttrib2fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
-        self.VertexAttrib2fv_(indx, v.to_vec());
-    }
-
-    // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn VertexAttrib2fv_(&self, indx: u32, values: Vec<f32>) {
+    fn VertexAttrib2fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
+        let values = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
         if values.len() < 2 {
             return self.webgl_error(InvalidOperation);
         }
-
         self.vertex_attrib(indx, values[0], values[1], 0f32, 1f32);
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn VertexAttrib3f(&self, indx: u32, x: f32, y: f32, z: f32) {
         self.vertex_attrib(indx, x, y, z, 1f32)
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn VertexAttrib3fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
-        self.VertexAttrib3fv_(indx, v.to_vec());
-    }
-
-    // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn VertexAttrib3fv_(&self, indx: u32, values: Vec<f32>) {
+    fn VertexAttrib3fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
+        let values = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
         if values.len() < 3 {
             return self.webgl_error(InvalidOperation);
         }
-
         self.vertex_attrib(indx, values[0], values[1], values[2], 1f32);
     }
 
     // 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) {
         self.vertex_attrib(indx, x, y, z, w)
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn VertexAttrib4fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
-        self.VertexAttrib4fv_(indx, v.to_vec());
-    }
-
-    // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
-    fn VertexAttrib4fv_(&self, indx: u32, values: Vec<f32>) {
+    fn VertexAttrib4fv(&self, indx: u32, v: Float32ArrayOrUnrestrictedFloatSequence) {
+        let values = match v {
+            Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+            Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+        };
         if values.len() < 4 {
             return self.webgl_error(InvalidOperation);
         }
-
         self.vertex_attrib(indx, values[0], values[1], values[2], values[3]);
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
     fn VertexAttribPointer(&self, attrib_id: u32, size: i32, data_type: u32,
                            normalized: bool, stride: i32, offset: i64) {
         if attrib_id >= self.limits.max_vertex_attribs {
             return self.webgl_error(InvalidValue);
@@ -3299,26 +3257,28 @@ impl WebGLRenderingContextMethods for We
         if width < 0 || height < 0 {
             return self.webgl_error(InvalidValue)
         }
 
         self.send_command(WebGLCommand::SetViewport(x, y, width, height))
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
-    fn TexImage2D(&self,
-                  target: u32,
-                  level: i32,
-                  internal_format: u32,
-                  width: i32,
-                  height: i32,
-                  border: i32,
-                  format: u32,
-                  data_type: u32,
-                  mut pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>) -> Fallible<()> {
+    fn TexImage2D(
+        &self,
+        target: u32,
+        level: i32,
+        internal_format: u32,
+        width: i32,
+        height: i32,
+        border: i32,
+        format: u32,
+        data_type: u32,
+        mut pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>,
+    ) -> ErrorResult {
         if !self.extension_manager.is_tex_type_enabled(data_type) {
             return Ok(self.webgl_error(InvalidEnum));
         }
 
         let validator = TexImage2DValidator::new(self, target, level,
                                                  internal_format, width, height,
                                                  border, format, data_type);
 
@@ -3432,17 +3392,17 @@ impl WebGLRenderingContextMethods for We
     fn TexImageDOM(&self,
                    target: u32,
                    level: i32,
                    internal_format: u32,
                    width: i32,
                    height: i32,
                    format: u32,
                    data_type: u32,
-                   source: &HTMLIFrameElement) -> Fallible<()> {
+                   source: &HTMLIFrameElement) -> ErrorResult {
         // Currently DOMToTexture only supports TEXTURE_2D, RGBA, UNSIGNED_BYTE and no levels.
         if target != constants::TEXTURE_2D || level != 0 || internal_format != constants::RGBA ||
             format != constants::RGBA || data_type != constants::UNSIGNED_BYTE {
             return Ok(self.webgl_error(InvalidValue));
         }
 
         // Get bound texture
         let texture = match self.bound_texture(constants::TEXTURE_2D) {
@@ -3463,26 +3423,28 @@ impl WebGLRenderingContextMethods for We
                                                   pipeline_id.to_webrender(),
                                                   Size2D::new(width, height));
         self.webgl_sender.send_dom_to_texture(command).unwrap();
 
         Ok(())
     }
 
     // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
-    fn TexSubImage2D(&self,
-                     target: u32,
-                     level: i32,
-                     xoffset: i32,
-                     yoffset: i32,
-                     width: i32,
-                     height: i32,
-                     format: u32,
-                     data_type: u32,
-                     mut pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>) -> Fallible<()> {
+    fn TexSubImage2D(
+        &self,
+        target: u32,
+        level: i32,
+        xoffset: i32,
+        yoffset: i32,
+        width: i32,
+        height: i32,
+        format: u32,
+        data_type: u32,
+        mut pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>,
+    ) -> ErrorResult {
         let validator = TexImage2DValidator::new(self, target, level,
                                                  format, width, height,
                                                  0, format, data_type);
         let TexImage2DValidatorResult {
             texture,
             target,
             width,
             height,
--- a/servo/components/script/dom/webidls/WebGL2RenderingContext.webidl
+++ b/servo/components/script/dom/webidls/WebGL2RenderingContext.webidl
@@ -568,15 +568,15 @@ interface WebGL2RenderingContextBase
   // void uniformBlockBinding(WebGLProgram program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
 
   /* Vertex Array Objects */
   /*WebGLVertexArrayObject? createVertexArray();
   void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
   [WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
   void bindVertexArray(WebGLVertexArrayObject? array);*/
 };
-WebGL2RenderingContextBase implements WebGLRenderingContextBase;
 
 [Pref="dom.webgl2.enabled"]
 interface WebGL2RenderingContext
 {
 };
+WebGL2RenderingContext implements WebGLRenderingContextBase;
 WebGL2RenderingContext implements WebGL2RenderingContextBase;
--- a/servo/components/script/dom/webidls/WebGLRenderingContext.webidl
+++ b/servo/components/script/dom/webidls/WebGLRenderingContext.webidl
@@ -23,18 +23,19 @@ typedef unsigned short GLushort;
 typedef unsigned long  GLuint;
 typedef unrestricted float GLfloat;
 typedef unrestricted float GLclampf;
 
 typedef (ImageData or
          HTMLImageElement or
          HTMLCanvasElement or
          HTMLVideoElement) TexImageSource;
-typedef (ArrayBuffer or ArrayBufferView) BufferDataSource;
 
+typedef (/*[AllowShared]*/ Float32Array or sequence<GLfloat>) Float32List;
+typedef (/*[AllowShared]*/ Int32Array or sequence<GLint>) Int32List;
 
 dictionary WebGLContextAttributes {
     GLboolean alpha = true;
     GLboolean depth = true;
     GLboolean stencil = false;
     GLboolean antialias = true;
     GLboolean premultipliedAlpha = true;
     GLboolean preserveDrawingBuffer = false;
@@ -465,17 +466,18 @@ interface WebGLRenderingContextBase
     const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
     const GLenum BROWSER_DEFAULT_WEBGL          = 0x9244;
 
     readonly attribute HTMLCanvasElement canvas;
     readonly attribute GLsizei drawingBufferWidth;
     readonly attribute GLsizei drawingBufferHeight;
 
     [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
-    //[WebGLHandlesContextLoss] boolean isContextLost();
+    // FIXME: https://github.com/servo/servo/issues/15266
+    // [WebGLHandlesContextLoss] boolean isContextLost();
 
     sequence<DOMString>? getSupportedExtensions();
     object? getExtension(DOMString name);
 
     void activeTexture(GLenum texture);
     void attachShader(WebGLProgram program, WebGLShader shader);
     void bindAttribLocation(WebGLProgram program, GLuint index, DOMString name);
     void bindBuffer(GLenum target, WebGLBuffer? buffer);
@@ -484,47 +486,42 @@ interface WebGLRenderingContextBase
     void bindTexture(GLenum target, WebGLTexture? texture);
     void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
     void blendEquation(GLenum mode);
     void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
     void blendFunc(GLenum sfactor, GLenum dfactor);
     void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
                            GLenum srcAlpha, GLenum dstAlpha);
 
-    // FIXME(xanewok) from CodegenRust.py:
-    // 'No support for unions as distinguishing arguments yet' for below
-    // original WebIDL function definition
-    // void bufferData(GLenum target, BufferDataSource? data, GLenum usage);
+    // FIXME(xanewok): https://github.com/servo/servo/issues/20513
     [Throws]
     void bufferData(GLenum target, object? data, GLenum usage);
     [Throws]
     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);
     void clear(GLbitfield mask);
     void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
     void clearDepth(GLclampf depth);
     void clearStencil(GLint s);
     void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
     void compileShader(WebGLShader shader);
 
     void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
                               GLsizei width, GLsizei height, GLint border,
-                              ArrayBufferView data);
+                              /*[AllowShared]*/ ArrayBufferView data);
     void compressedTexSubImage2D(GLenum target, GLint level,
                                  GLint xoffset, GLint yoffset,
                                  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,
                         GLint x, GLint y, GLsizei width, GLsizei height,
                         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,
                            GLint x, GLint y, GLsizei width, GLsizei height);
 
     WebGLBuffer? createBuffer();
     WebGLFramebuffer? createFramebuffer();
     WebGLProgram? createProgram();
     WebGLRenderbuffer? createRenderbuffer();
     WebGLShader? createShader(GLenum type);
@@ -571,26 +568,27 @@ interface WebGLRenderingContextBase
     any getParameter(GLenum pname);
 
     [WebGLHandlesContextLoss] GLenum getError();
 
     any getFramebufferAttachmentParameter(GLenum target, GLenum attachment,
                                           GLenum pname);
     any getProgramParameter(WebGLProgram program, GLenum pname);
     DOMString? getProgramInfoLog(WebGLProgram program);
-    //any getRenderbufferParameter(GLenum target, GLenum pname);
+    // FIXME: https://github.com/servo/servo/issues/20514
+    // any getRenderbufferParameter(GLenum target, GLenum pname);
     any getShaderParameter(WebGLShader shader, GLenum pname);
     WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
     DOMString? getShaderInfoLog(WebGLShader shader);
 
     DOMString? getShaderSource(WebGLShader shader);
 
     any getTexParameter(GLenum target, GLenum pname);
 
-    //any getUniform(WebGLProgram program, WebGLUniformLocation location);
+    // any getUniform(WebGLProgram program, WebGLUniformLocation location);
 
     WebGLUniformLocation? getUniformLocation(WebGLProgram program, DOMString name);
 
     any getVertexAttrib(GLuint index, GLenum pname);
 
     [WebGLHandlesContextLoss] GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname);
 
     void hint(GLenum target, GLenum mode);
@@ -602,119 +600,93 @@ interface WebGLRenderingContextBase
     [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader);
     [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture);
     void lineWidth(GLfloat width);
     void linkProgram(WebGLProgram? program);
     void pixelStorei(GLenum pname, GLint param);
     void polygonOffset(GLfloat factor, GLfloat units);
 
     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,
                              GLsizei width, GLsizei height);
     void sampleCoverage(GLclampf value, GLboolean invert);
     void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
 
     void shaderSource(WebGLShader shader, DOMString source);
 
     void stencilFunc(GLenum func, GLint ref, GLuint mask);
     void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
     void stencilMask(GLuint mask);
     void stencilMaskSeparate(GLenum face, GLuint mask);
     void stencilOp(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]
     void texImage2D(GLenum target, GLint level, GLenum internalformat,
                     GLsizei width, GLsizei height, GLint border, GLenum format,
-                    GLenum type, ArrayBufferView? pixels);
+                    GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
     [Throws]
     void texImage2D(GLenum target, GLint level, GLenum internalformat,
                     GLenum format, GLenum type, TexImageSource source); // May throw DOMException
     [Throws, Pref="dom.webgl.dom_to_texture.enabled"]
     void texImageDOM(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height,
                      GLenum format, GLenum type, HTMLIFrameElement source); // May throw DOMException
 
     void texParameterf(GLenum target, GLenum pname, GLfloat 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]
     void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
                       GLsizei width, GLsizei height,
-                      GLenum format, GLenum type, ArrayBufferView? pixels);
+                      GLenum format, GLenum type, /*[AllowShared]*/ ArrayBufferView? pixels);
     [Throws]
     void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
                        GLenum format, GLenum type, TexImageSource source); // May throw DOMException
 
     void uniform1f(WebGLUniformLocation? location, GLfloat x);
-    void uniform1fv(WebGLUniformLocation? location, Float32Array v);
-    void uniform1fv(WebGLUniformLocation? location, sequence<GLfloat> v);
+    void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
+    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 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 uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
+    void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
 
-    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 uniform3iv(WebGLUniformLocation? location, Int32Array v);
-    void uniform3iv(WebGLUniformLocation? location, sequence<long> v);
+    void uniform1fv(WebGLUniformLocation? location, Float32List v);
+    void uniform2fv(WebGLUniformLocation? location, Float32List v);
+    void uniform3fv(WebGLUniformLocation? location, Float32List v);
+    void uniform4fv(WebGLUniformLocation? location, Float32List 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 uniform4iv(WebGLUniformLocation? location, Int32Array v);
-    void uniform4iv(WebGLUniformLocation? location, sequence<long> v);
+    void uniform1iv(WebGLUniformLocation? location, Int32List v);
+    void uniform2iv(WebGLUniformLocation? location, Int32List v);
+    void uniform3iv(WebGLUniformLocation? location, Int32List v);
+    void uniform4iv(WebGLUniformLocation? location, Int32List v);
 
-    void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose,
-                          Float32Array value);
-    void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose,
-                          sequence<GLfloat> value);
-    void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose,
-                          Float32Array value);
-    void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose,
-                          sequence<GLfloat> value);
-    void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose,
-                          Float32Array value);
-    void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose,
-                          sequence<GLfloat> value);
+    void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
+    void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
+    void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
 
     void useProgram(WebGLProgram? program);
     void validateProgram(WebGLProgram program);
 
     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 vertexAttrib2fv(GLuint indx, Float32Array values);
-    void vertexAttrib2fv(GLuint indx, sequence<GLfloat> values);
+    void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+    void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
 
-    void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
-    void vertexAttrib3fv(GLuint indx, Float32Array values);
-    void vertexAttrib3fv(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 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 vertexAttribPointer(GLuint indx, GLint size, GLenum type,
                              GLboolean normalized, GLsizei stride, GLintptr offset);
 
     void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
 };
 
 [Exposed=Window]
 interface WebGLRenderingContext