diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index 30b234f621ff..944faed6ffa0 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -2652,9 +2652,9 @@ class IDLAttribute(IDLInterfaceMember): if self.type.isDictionary(): raise WebIDLError("An attribute cannot be of a dictionary type", [self.location]) - if self.type.isSequence(): - raise WebIDLError("An attribute cannot be of a sequence type", - [self.location]) + if self.type.isSequence() and not self.getExtendedAttribute("Cached"): + raise WebIDLError("A non-cached attribute cannot be of a sequence " + "type", [self.location]) if self.type.isUnion(): for f in self.type.unroll().flatMemberTypes: if f.isDictionary(): diff --git a/dom/bindings/test/TestBindingHeader.h b/dom/bindings/test/TestBindingHeader.h index e303bb3b4e38..034dc30b497b 100644 --- a/dom/bindings/test/TestBindingHeader.h +++ b/dom/bindings/test/TestBindingHeader.h @@ -340,6 +340,7 @@ public: void PassConsequentialInterface(IndirectlyImplementedInterface&); // Sequence types + void GetReadonlySequence(nsTArray&); void ReceiveSequence(nsTArray&); void ReceiveNullableSequence(Nullable< nsTArray >&); void ReceiveSequenceOfNullableInts(nsTArray< Nullable >&); diff --git a/dom/bindings/test/TestCodeGen.webidl b/dom/bindings/test/TestCodeGen.webidl index e06c14fab276..09dc2565fdc0 100644 --- a/dom/bindings/test/TestCodeGen.webidl +++ b/dom/bindings/test/TestCodeGen.webidl @@ -295,6 +295,8 @@ interface TestInterface { void passConsequentialInterface(IndirectlyImplementedInterface arg); // Sequence types + [Cached, Pure] + readonly attribute sequence readonlySequence; sequence receiveSequence(); sequence? receiveNullableSequence(); sequence receiveSequenceOfNullableInts(); diff --git a/dom/bindings/test/TestExampleGen.webidl b/dom/bindings/test/TestExampleGen.webidl index edfdaf8fc52a..6910b7124d72 100644 --- a/dom/bindings/test/TestExampleGen.webidl +++ b/dom/bindings/test/TestExampleGen.webidl @@ -191,6 +191,8 @@ interface TestExampleInterface { void passConsequentialInterface(IndirectlyImplementedInterface arg); // Sequence types + [Cached, Pure] + readonly attribute sequence readonlySequence; sequence receiveSequence(); sequence? receiveNullableSequence(); sequence receiveSequenceOfNullableInts(); diff --git a/dom/bindings/test/TestJSImplGen.webidl b/dom/bindings/test/TestJSImplGen.webidl index 4b7d18ef59de..208cf1ac41df 100644 --- a/dom/bindings/test/TestJSImplGen.webidl +++ b/dom/bindings/test/TestJSImplGen.webidl @@ -212,6 +212,8 @@ interface TestJSImplInterface { void passConsequentialInterface(IndirectlyImplementedInterface arg); // Sequence types + [Cached, Pure] + readonly attribute sequence readonlySequence; sequence receiveSequence(); sequence? receiveNullableSequence(); sequence receiveSequenceOfNullableInts();