Bug 1292293 - Part 1: Update the WebIDL Parser to allow default values for ByteString, r=bz
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -4230,27 +4230,29 @@ def getHandleDefault(defaultValue):
# Some numeric literals require a suffix to compile without warnings
return numericValue(tag, defaultValue.value)
assert tag == IDLType.Tags.bool
return toStringBool(defaultValue.value)
def handleDefaultStringValue(defaultValue, method):
"""
- Returns a string which ends up calling 'method' with a (char16_t*, length)
+ Returns a string which ends up calling 'method' with a (char_t*, length)
pair that sets this string default value. This string is suitable for
passing as the second argument of handleDefault; in particular it does not
end with a ';'
"""
- assert defaultValue.type.isDOMString()
- return ("static const char16_t data[] = { %s };\n"
- "%s(data, ArrayLength(data) - 1)" %
- (", ".join(["'" + char + "'" for char in
- defaultValue.value] + ["0"]),
- method))
+ assert defaultValue.type.isDOMString() or defaultValue.type.isByteString()
+ return ("static const %(char_t)s data[] = { %(data)s };\n"
+ "%(method)s(data, ArrayLength(data) - 1)") % {
+ 'char_t': "char" if defaultValue.type.isByteString() else "char16_t",
+ 'method': method,
+ 'data': ", ".join(["'" + char + "'" for char in
+ defaultValue.value] + ["0"])
+ }
# If this function is modified, modify CGNativeMember.getArg and
# CGNativeMember.getRetvalInfo accordingly. The latter cares about the decltype
# and holdertype we end up using, because it needs to be able to return the code
# that will convert those to the actual return value of the callback function.
def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
isDefinitelyObject=False,
@@ -5457,18 +5459,24 @@ def getJSToNativeConversionInfo(type, de
conversionCode = fill("""
if (!ConvertJSValueToByteString(cx, $${val}, ${nullable}, $${declName})) {
$*{exceptionCode}
}
""",
nullable=nullable,
exceptionCode=exceptionCode)
- # ByteString arguments cannot have a default value.
- assert defaultValue is None
+ if defaultValue is not None:
+ if isinstance(defaultValue, IDLNullValue):
+ assert(type.nullable())
+ defaultCode = "${declName}.SetIsVoid(true)"
+ else:
+ defaultCode = handleDefaultStringValue(defaultValue,
+ "${declName}.Rebind")
+ conversionCode = handleDefault(conversionCode, defaultCode + ";\n")
return JSToNativeConversionInfo(
conversionCode,
declType=CGGeneric("nsCString"),
dealWithOptional=isOptional)
if type.isEnum():
assert not isEnforceRange and not isClamp
@@ -9599,19 +9607,24 @@ class CGUnionStruct(CGThing):
"SetAs" + vars["name"],
vars["structType"] + "&",
vars["ctorArgList"],
bodyInHeader=not self.ownsMembers,
body=body % uninit))
if self.ownsMembers:
methods.append(vars["setter"])
# Provide a SetStringData() method to support string defaults.
- # Exclude ByteString here because it does not support defaults
- # and only supports narrow nsCString.
- if t.isString() and not t.isByteString():
+ if t.isByteString():
+ methods.append(
+ ClassMethod("SetStringData", "void",
+ [Argument("const nsCString::char_type*", "aData"),
+ Argument("nsCString::size_type", "aLength")],
+ inline=True, bodyInHeader=True,
+ body="RawSetAs%s().Assign(aData, aLength);\n" % t.name))
+ elif t.isString():
methods.append(
ClassMethod("SetStringData", "void",
[Argument("const nsString::char_type*", "aData"),
Argument("nsString::size_type", "aLength")],
inline=True, bodyInHeader=True,
body="RawSetAs%s().Assign(aData, aLength);\n" % t.name))
body = fill(
@@ -9862,19 +9875,24 @@ class CGUnionConversionStruct(CGThing):
**vars)
methods.append(ClassMethod("RawSetAs" + vars["name"],
vars["structType"] + "&",
vars["ctorArgList"],
bodyInHeader=True,
body=body,
visibility="private"))
# Provide a SetStringData() method to support string defaults.
- # Exclude ByteString here because it does not support defaults
- # and only supports narrow nsCString.
- if t.isString() and not t.isByteString():
+ if t.isByteString():
+ methods.append(
+ ClassMethod("SetStringData", "void",
+ [Argument("const nsDependentCString::char_type*", "aData"),
+ Argument("nsDependentCString::size_type", "aLength")],
+ inline=True, bodyInHeader=True,
+ body="RawSetAs%s().Rebind(aData, aLength);\n" % t.name))
+ elif t.isString():
methods.append(
ClassMethod("SetStringData", "void",
[Argument("const nsDependentString::char_type*", "aData"),
Argument("nsDependentString::size_type", "aLength")],
inline=True, bodyInHeader=True,
body="RawSetAs%s().Rebind(aData, aLength);\n" % t.name))
if vars["holderType"] is not None:
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -4,16 +4,17 @@
""" A WebIDL parser. """
from ply import lex, yacc
import re
import os
import traceback
import math
+import string
from collections import defaultdict
# Machinery
def parseInt(literal):
string = literal
sign = 0
@@ -3379,16 +3380,30 @@ class IDLValue(IDLObject):
return IDLValue(self.location, type, self.value)
elif self.type.isString() and type.isUSVString():
# Allow USVStrings to use default value just like
# DOMString. No coercion is required in this case as Codegen.py
# treats USVString just like DOMString, but with an
# extra normalization step.
assert self.type.isDOMString()
return self
+ elif self.type.isString() and type.isByteString():
+ # Allow ByteStrings to use a default value like DOMString.
+ # No coercion is required as Codegen.py will handle the
+ # extra steps. We want to make sure that our string contains
+ # only valid characters, so we check that here.
+ valid_ascii_lit = " " + string.ascii_letters + string.digits + string.punctuation
+ for idx, c in enumerate(self.value):
+ if c not in valid_ascii_lit:
+ raise WebIDLError("Coercing this string literal %s to a ByteString is not supported yet. "
+ "Coercion failed due to an unsupported byte %d at index %d."
+ % (self.value.__repr__(), ord(c), idx), [location])
+
+ return IDLValue(self.location, type, self.value)
+
raise WebIDLError("Cannot coerce type %s to type %s." %
(self.type, type), [location])
def _getDependentObjects(self):
return set()
class IDLNullValue(IDLObject):
--- a/dom/bindings/parser/tests/test_bytestring.py
+++ b/dom/bindings/parser/tests/test_bytestring.py
@@ -8,17 +8,17 @@ def WebIDLTest(parser, harness):
attribute ByteString bs;
attribute DOMString ds;
};
""")
results = parser.finish();
harness.ok(True, "TestByteString interface parsed without error.")
-
+
harness.check(len(results), 1, "Should be one production")
harness.ok(isinstance(results[0], WebIDL.IDLInterface),
"Should be an IDLInterface")
iface = results[0]
harness.check(iface.identifier.QName(), "::TestByteString", "Interface has the right QName")
harness.check(iface.identifier.name, "TestByteString", "Interface has the right name")
harness.check(iface.parent, None, "Interface has no parent")
@@ -49,24 +49,51 @@ def WebIDLTest(parser, harness):
try:
parser.parse("""
interface ConstByteString {
const ByteString foo = "hello"
};
""")
except WebIDL.WebIDLError:
threw = True
- harness.ok(threw, "Should have thrown a WebIDL error")
+ harness.ok(threw, "Should have thrown a WebIDL error for ByteString default in interface")
- # Cannot have optional ByteStrings with default values
- threw = False
+ # Can have optional ByteStrings with default values
try:
parser.parse("""
interface OptionalByteString {
void passByteString(optional ByteString arg = "hello");
};
""")
results2 = parser.finish();
- except WebIDL.WebIDLError:
+ except WebIDL.WebIDLError as e:
+ harness.ok(False,
+ "Should not have thrown a WebIDL error for ByteString "
+ "default in dictionary. " + str(e))
+
+ # Can have a default ByteString value in a dictionary
+ try:
+ parser.parse("""
+ dictionary OptionalByteStringDict {
+ ByteString item = "some string";
+ };
+ """)
+ results3 = parser.finish();
+ except WebIDL.WebIDLError as e:
+ harness.ok(False,
+ "Should not have thrown a WebIDL error for ByteString "
+ "default in dictionary. " + str(e))
+
+ # Don't allow control characters in ByteString literals
+ threw = False
+ try:
+ parser.parse("""
+ dictionary OptionalByteStringDict2 {
+ ByteString item = "\x03";
+ };
+ """)
+ results4 = parser.finish()
+ except WebIDL.WebIDLError as e:
threw = True
- harness.ok(threw, "Should have thrown a WebIDL error")
-
+ harness.ok(threw,
+ "Should have thrown a WebIDL error for invalid ByteString "
+ "default in dictionary")
--- a/dom/bindings/test/TestBindingHeader.h
+++ b/dom/bindings/test/TestBindingHeader.h
@@ -492,18 +492,22 @@ public:
void PassOptionalNullableStringWithDefaultValue(const nsAString&);
void PassVariadicString(const Sequence<nsString>&);
void ReceiveString(DOMString&);
// ByteString types
void PassByteString(const nsCString&);
void PassNullableByteString(const nsCString&);
void PassOptionalByteString(const Optional<nsCString>&);
+ void PassOptionalByteStringWithDefaultValue(const nsCString&);
void PassOptionalNullableByteString(const Optional<nsCString>&);
+ void PassOptionalNullableByteStringWithDefaultValue(const nsCString&);
void PassVariadicByteString(const Sequence<nsCString>&);
+ void PassOptionalUnionByteString(const Optional<ByteStringOrLong>&);
+ void PassOptionalUnionByteStringWithDefaultValue(const ByteStringOrLong&);
// USVString types
void PassUSVS(const nsAString&);
void PassNullableUSVS(const nsAString&);
void PassOptionalUSVS(const Optional<nsAString>&);
void PassOptionalUSVSWithDefaultValue(const nsAString&);
void PassOptionalNullableUSVS(const Optional<nsAString>&);
void PassOptionalNullableUSVSWithDefaultValue(const nsAString&);
@@ -681,30 +685,36 @@ public:
void PassUnionWithDefaultValue6(const FloatOrString& arg);
void PassUnionWithDefaultValue7(const UnrestrictedDoubleOrString& arg);
void PassUnionWithDefaultValue8(const UnrestrictedDoubleOrString& arg);
void PassUnionWithDefaultValue9(const UnrestrictedDoubleOrString& arg);
void PassUnionWithDefaultValue10(const UnrestrictedDoubleOrString& arg);
void PassUnionWithDefaultValue11(const UnrestrictedFloatOrString& arg);
void PassUnionWithDefaultValue12(const UnrestrictedFloatOrString& arg);
void PassUnionWithDefaultValue13(const UnrestrictedFloatOrString& arg);
- void PassUnionWithDefaultValue14(const UnrestrictedFloatOrString& arg);
+ void PassUnionWithDefaultValue14(const DoubleOrByteString& arg);
+ void PassUnionWithDefaultValue15(const DoubleOrByteString& arg);
+ void PassUnionWithDefaultValue16(const DoubleOrByteString& arg);
void PassNullableUnionWithDefaultValue1(const Nullable<DoubleOrString>& arg);
void PassNullableUnionWithDefaultValue2(const Nullable<DoubleOrString>& arg);
void PassNullableUnionWithDefaultValue3(const Nullable<DoubleOrString>& arg);
void PassNullableUnionWithDefaultValue4(const Nullable<FloatOrString>& arg);
void PassNullableUnionWithDefaultValue5(const Nullable<FloatOrString>& arg);
void PassNullableUnionWithDefaultValue6(const Nullable<FloatOrString>& arg);
void PassNullableUnionWithDefaultValue7(const Nullable<UnrestrictedDoubleOrString>& arg);
void PassNullableUnionWithDefaultValue8(const Nullable<UnrestrictedDoubleOrString>& arg);
void PassNullableUnionWithDefaultValue9(const Nullable<UnrestrictedDoubleOrString>& arg);
void PassNullableUnionWithDefaultValue10(const Nullable<UnrestrictedFloatOrString>& arg);
void PassNullableUnionWithDefaultValue11(const Nullable<UnrestrictedFloatOrString>& arg);
void PassNullableUnionWithDefaultValue12(const Nullable<UnrestrictedFloatOrString>& arg);
+ void PassNullableUnionWithDefaultValue13(const Nullable<DoubleOrByteString>& arg);
+ void PassNullableUnionWithDefaultValue14(const Nullable<DoubleOrByteString>& arg);
+ void PassNullableUnionWithDefaultValue15(const Nullable<DoubleOrByteString>& arg);
+ void PassNullableUnionWithDefaultValue16(const Nullable<DoubleOrByteString>& arg);
void PassSequenceOfUnions(const Sequence<OwningCanvasPatternOrCanvasGradient>&);
void PassSequenceOfUnions2(JSContext*, const Sequence<OwningObjectOrLong>&);
void PassVariadicUnion(const Sequence<OwningCanvasPatternOrCanvasGradient>&);
void PassSequenceOfNullableUnions(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>&);
void PassVariadicNullableUnion(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>&);
void PassMozMapOfUnions(const MozMap<OwningCanvasPatternOrCanvasGradient>&);
@@ -1084,17 +1094,19 @@ private:
void PassOptionalNullableString(Optional<nsAString>&) = delete;
void PassOptionalNullableStringWithDefaultValue(nsAString&) = delete;
void PassVariadicString(Sequence<nsString>&) = delete;
// cstrings should be const as well
void PassByteString(nsCString&) = delete;
void PassNullableByteString(nsCString&) = delete;
void PassOptionalByteString(Optional<nsCString>&) = delete;
+ void PassOptionalByteStringWithDefaultValue(nsCString&) = delete;
void PassOptionalNullableByteString(Optional<nsCString>&) = delete;
+ void PassOptionalNullableByteStringWithDefaultValue(nsCString&) = delete;
void PassVariadicByteString(Sequence<nsCString>&) = delete;
// Make sure dictionary arguments are always const
void PassDictionary(JSContext*, Dict&) = delete;
void PassOtherDictionary(GrandparentDict&) = delete;
void PassSequenceOfDictionaries(JSContext*, Sequence<Dict>&) = delete;
void PassDictionaryOrLong(JSContext*, Dict&) = delete;
void PassDictContainingDict(JSContext*, DictContainingDict&) = delete;
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -475,18 +475,22 @@ interface TestInterface {
void passOptionalNullableStringWithDefaultValue(optional DOMString? arg = null);
void passVariadicString(DOMString... arg);
DOMString receiveString();
// ByteString types
void passByteString(ByteString arg);
void passNullableByteString(ByteString? arg);
void passOptionalByteString(optional ByteString arg);
+ void passOptionalByteStringWithDefaultValue(optional ByteString arg = "abc");
void passOptionalNullableByteString(optional ByteString? arg);
+ void passOptionalNullableByteStringWithDefaultValue(optional ByteString? arg = null);
void passVariadicByteString(ByteString... arg);
+ void passOptionalUnionByteString(optional (ByteString or long) arg);
+ void passOptionalUnionByteStringWithDefaultValue(optional (ByteString or long) arg = "abc");
// USVString types
void passUSVS(USVString arg);
void passNullableUSVS(USVString? arg);
void passOptionalUSVS(optional USVString arg);
void passOptionalUSVSWithDefaultValue(optional USVString arg = "abc");
void passOptionalNullableUSVS(optional USVString? arg);
void passOptionalNullableUSVSWithDefaultValue(optional USVString? arg = null);
@@ -655,29 +659,36 @@ interface TestInterface {
void passUnionWithDefaultValue6(optional (float or DOMString) arg = 1.5);
void passUnionWithDefaultValue7(optional (unrestricted double or DOMString) arg = "");
void passUnionWithDefaultValue8(optional (unrestricted double or DOMString) arg = 1);
void passUnionWithDefaultValue9(optional (unrestricted double or DOMString) arg = 1.5);
void passUnionWithDefaultValue10(optional (unrestricted double or DOMString) arg = Infinity);
void passUnionWithDefaultValue11(optional (unrestricted float or DOMString) arg = "");
void passUnionWithDefaultValue12(optional (unrestricted float or DOMString) arg = 1);
void passUnionWithDefaultValue13(optional (unrestricted float or DOMString) arg = Infinity);
+ void passUnionWithDefaultValue14(optional (double or ByteString) arg = "");
+ void passUnionWithDefaultValue15(optional (double or ByteString) arg = 1);
+ void passUnionWithDefaultValue16(optional (double or ByteString) arg = 1.5);
void passNullableUnionWithDefaultValue1(optional (double or DOMString)? arg = "");
void passNullableUnionWithDefaultValue2(optional (double or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue3(optional (double or DOMString)? arg = null);
void passNullableUnionWithDefaultValue4(optional (float or DOMString)? arg = "");
void passNullableUnionWithDefaultValue5(optional (float or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue6(optional (float or DOMString)? arg = null);
void passNullableUnionWithDefaultValue7(optional (unrestricted double or DOMString)? arg = "");
void passNullableUnionWithDefaultValue8(optional (unrestricted double or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue9(optional (unrestricted double or DOMString)? arg = null);
void passNullableUnionWithDefaultValue10(optional (unrestricted float or DOMString)? arg = "");
void passNullableUnionWithDefaultValue11(optional (unrestricted float or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue12(optional (unrestricted float or DOMString)? arg = null);
+ void passNullableUnionWithDefaultValue13(optional (double or ByteString)? arg = "");
+ void passNullableUnionWithDefaultValue14(optional (double or ByteString)? arg = 1);
+ void passNullableUnionWithDefaultValue15(optional (double or ByteString)? arg = 1.5);
+ void passNullableUnionWithDefaultValue16(optional (double or ByteString)? arg = null);
void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg);
void passSequenceOfUnions2(sequence<(object or long)> arg);
void passVariadicUnion((CanvasPattern or CanvasGradient)... arg);
void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg);
@@ -1004,16 +1015,19 @@ dictionary Dict : ParentDict {
[EnforceRange] unsigned long enforcedUnsignedLong;
[Clamp] unsigned long clampedUnsignedLong;
DOMString str;
DOMString empty = "";
TestEnum otherEnum = "b";
DOMString otherStr = "def";
DOMString? yetAnotherStr = null;
DOMString template;
+ ByteString byteStr;
+ ByteString emptyByteStr = "";
+ ByteString otherByteStr = "def";
object someObj;
boolean prototype;
object? anotherObj = null;
TestCallback? someCallback = null;
any someAny;
any anotherAny = null;
unrestricted float urFloat = 0;
--- a/dom/bindings/test/TestExampleGen.webidl
+++ b/dom/bindings/test/TestExampleGen.webidl
@@ -338,19 +338,23 @@ interface TestExampleInterface {
void passOptionalNullableString(optional DOMString? arg);
void passOptionalNullableStringWithDefaultValue(optional DOMString? arg = null);
void passVariadicString(DOMString... arg);
// ByteString types
void passByteString(ByteString arg);
void passNullableByteString(ByteString? arg);
void passOptionalByteString(optional ByteString arg);
+ void passOptionalByteStringWithDefaultValue(optional ByteString arg = "abc");
void passOptionalNullableByteString(optional ByteString? arg);
+ void passOptionalNullableByteStringWithDefaultValue(optional ByteString? arg = null);
void passVariadicByteString(ByteString... arg);
void passUnionByteString((ByteString or long) arg);
+ void passOptionalUnionByteString(optional (ByteString or long) arg);
+ void passOptionalUnionByteStringWithDefaultValue(optional (ByteString or long) arg = "abc");
// USVString types
void passSVS(USVString arg);
void passNullableSVS(USVString? arg);
void passOptionalSVS(optional USVString arg);
void passOptionalSVSWithDefaultValue(optional USVString arg = "abc");
void passOptionalNullableSVS(optional USVString? arg);
void passOptionalNullableSVSWithDefaultValue(optional USVString? arg = null);
@@ -490,29 +494,36 @@ interface TestExampleInterface {
void passUnionWithDefaultValue6(optional (float or DOMString) arg = 1.5);
void passUnionWithDefaultValue7(optional (unrestricted double or DOMString) arg = "");
void passUnionWithDefaultValue8(optional (unrestricted double or DOMString) arg = 1);
void passUnionWithDefaultValue9(optional (unrestricted double or DOMString) arg = 1.5);
void passUnionWithDefaultValue10(optional (unrestricted double or DOMString) arg = Infinity);
void passUnionWithDefaultValue11(optional (unrestricted float or DOMString) arg = "");
void passUnionWithDefaultValue12(optional (unrestricted float or DOMString) arg = 1);
void passUnionWithDefaultValue13(optional (unrestricted float or DOMString) arg = Infinity);
+ void passUnionWithDefaultValue14(optional (double or ByteString) arg = "");
+ void passUnionWithDefaultValue15(optional (double or ByteString) arg = 1);
+ void passUnionWithDefaultValue16(optional (double or ByteString) arg = 1.5);
void passNullableUnionWithDefaultValue1(optional (double or DOMString)? arg = "");
void passNullableUnionWithDefaultValue2(optional (double or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue3(optional (double or DOMString)? arg = null);
void passNullableUnionWithDefaultValue4(optional (float or DOMString)? arg = "");
void passNullableUnionWithDefaultValue5(optional (float or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue6(optional (float or DOMString)? arg = null);
void passNullableUnionWithDefaultValue7(optional (unrestricted double or DOMString)? arg = "");
void passNullableUnionWithDefaultValue8(optional (unrestricted double or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue9(optional (unrestricted double or DOMString)? arg = null);
void passNullableUnionWithDefaultValue10(optional (unrestricted float or DOMString)? arg = "");
void passNullableUnionWithDefaultValue11(optional (unrestricted float or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue12(optional (unrestricted float or DOMString)? arg = null);
+ void passNullableUnionWithDefaultValue13(optional (double or ByteString)? arg = "");
+ void passNullableUnionWithDefaultValue14(optional (double or ByteString)? arg = 1);
+ void passNullableUnionWithDefaultValue15(optional (double or ByteString)? arg = 1.5);
+ void passNullableUnionWithDefaultValue16(optional (double or ByteString)? arg = null);
void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg);
void passSequenceOfUnions2(sequence<(object or long)> arg);
void passVariadicUnion((CanvasPattern or CanvasGradient)... arg);
void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg);
--- a/dom/bindings/test/TestJSImplGen.webidl
+++ b/dom/bindings/test/TestJSImplGen.webidl
@@ -349,19 +349,23 @@ interface TestJSImplInterface {
void passOptionalNullableString(optional DOMString? arg);
void passOptionalNullableStringWithDefaultValue(optional DOMString? arg = null);
void passVariadicString(DOMString... arg);
// ByteString types
void passByteString(ByteString arg);
void passNullableByteString(ByteString? arg);
void passOptionalByteString(optional ByteString arg);
+ void passOptionalByteStringWithDefaultValue(optional ByteString arg = "abc");
void passOptionalNullableByteString(optional ByteString? arg);
+ void passOptionalNullableByteStringWithDefaultValue(optional ByteString? arg = null);
void passVariadicByteString(ByteString... arg);
- void PassUnionByteString((ByteString or long) arg);
+ void passUnionByteString((ByteString or long) arg);
+ void passOptionalUnionByteString(optional (ByteString or long) arg);
+ void passOptionalUnionByteStringWithDefaultValue(optional (ByteString or long) arg = "abc");
// USVString types
void passSVS(USVString arg);
void passNullableSVS(USVString? arg);
void passOptionalSVS(optional USVString arg);
void passOptionalSVSWithDefaultValue(optional USVString arg = "abc");
void passOptionalNullableSVS(optional USVString? arg);
void passOptionalNullableSVSWithDefaultValue(optional USVString? arg = null);
@@ -502,29 +506,36 @@ interface TestJSImplInterface {
void passUnionWithDefaultValue6(optional (float or DOMString) arg = 1.5);
void passUnionWithDefaultValue7(optional (unrestricted double or DOMString) arg = "");
void passUnionWithDefaultValue8(optional (unrestricted double or DOMString) arg = 1);
void passUnionWithDefaultValue9(optional (unrestricted double or DOMString) arg = 1.5);
void passUnionWithDefaultValue10(optional (unrestricted double or DOMString) arg = Infinity);
void passUnionWithDefaultValue11(optional (unrestricted float or DOMString) arg = "");
void passUnionWithDefaultValue12(optional (unrestricted float or DOMString) arg = 1);
void passUnionWithDefaultValue13(optional (unrestricted float or DOMString) arg = Infinity);
+ void passUnionWithDefaultValue14(optional (double or ByteString) arg = "");
+ void passUnionWithDefaultValue15(optional (double or ByteString) arg = 1);
+ void passUnionWithDefaultValue16(optional (double or ByteString) arg = 1.5);
void passNullableUnionWithDefaultValue1(optional (double or DOMString)? arg = "");
void passNullableUnionWithDefaultValue2(optional (double or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue3(optional (double or DOMString)? arg = null);
void passNullableUnionWithDefaultValue4(optional (float or DOMString)? arg = "");
void passNullableUnionWithDefaultValue5(optional (float or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue6(optional (float or DOMString)? arg = null);
void passNullableUnionWithDefaultValue7(optional (unrestricted double or DOMString)? arg = "");
void passNullableUnionWithDefaultValue8(optional (unrestricted double or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue9(optional (unrestricted double or DOMString)? arg = null);
void passNullableUnionWithDefaultValue10(optional (unrestricted float or DOMString)? arg = "");
void passNullableUnionWithDefaultValue11(optional (unrestricted float or DOMString)? arg = 1);
void passNullableUnionWithDefaultValue12(optional (unrestricted float or DOMString)? arg = null);
+ void passNullableUnionWithDefaultValue13(optional (double or ByteString)? arg = "");
+ void passNullableUnionWithDefaultValue14(optional (double or ByteString)? arg = 1);
+ void passNullableUnionWithDefaultValue15(optional (double or ByteString)? arg = 1.5);
+ void passNullableUnionWithDefaultValue16(optional (double or ByteString)? arg = null);
void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg);
void passSequenceOfUnions2(sequence<(object or long)> arg);
void passVariadicUnion((CanvasPattern or CanvasGradient)... arg);
void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg);