aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/parser/bytestring.patch
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-08-26 00:54:37 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2016-08-26 00:55:29 +0200
commita4f96761b2c1de3a3c902995c5cd3a3c0212592c (patch)
treef5e617f1d33a6785d679f31d531df99cf9a74fd1 /components/script/dom/bindings/codegen/parser/bytestring.patch
parent9b4713f5366aa43ac0db6a8f1d96f33b2f527978 (diff)
downloadservo-a4f96761b2c1de3a3c902995c5cd3a3c0212592c.tar.gz
servo-a4f96761b2c1de3a3c902995c5cd3a3c0212592c.zip
Hoist 7fd65affabd9ab49b254fefce968a9eafabf1fbf as its own patch
Diffstat (limited to 'components/script/dom/bindings/codegen/parser/bytestring.patch')
-rw-r--r--components/script/dom/bindings/codegen/parser/bytestring.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/components/script/dom/bindings/codegen/parser/bytestring.patch b/components/script/dom/bindings/codegen/parser/bytestring.patch
new file mode 100644
index 00000000000..823f14cf996
--- /dev/null
+++ b/components/script/dom/bindings/codegen/parser/bytestring.patch
@@ -0,0 +1,29 @@
+--- WebIDL.py
++++ WebIDL.py
+@@ -3391,6 +3391,11 @@ class IDLValue(IDLObject):
+ # extra normalization step.
+ assert self.type.isDOMString()
+ return self
++ elif self.type.isString() and type.isByteString():
++ # Allow ByteStrings to use default value just like
++ # DOMString. No coercion is required here.
++ assert self.type.isDOMString()
++ return self
+ raise WebIDLError("Cannot coerce type %s to type %s." %
+ (self.type, type), [location])
+
+@@ -5759,6 +5764,14 @@ class Parser(Tokenizer):
+ booleanType = BuiltinTypes[IDLBuiltinType.Types.boolean]
+ p[0] = IDLValue(location, booleanType, p[1])
+
++ def p_ConstValueByteString(self, p):
++ """
++ ConstValue : BYTESTRING
++ """
++ location = self.getLocation(p, 1)
++ bytestringType = BuiltinTypes[IDLBuiltinType.Types.bytestring]
++ p[0] = IDLValue(location, bytestringType, p[1])
++
+ def p_ConstValueInteger(self, p):
+ """
+ ConstValue : INTEGER