Commit 5a61c773 authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

idl: Fix [EnforceRange] annotations

This CL fixes usages of [EnforceRange] annotations in IDL files.
No changes on behaviors.

CSSUnitValue:
 [EnforceRange] can't annotate non-integer numbers, and the spec
 doesn't have the annotation.

OffscreenCanvas:
 The spec doesn't have [EnforceRange], but it seems the spec is wrong.
 (requesting to update the spec; https://github.com/whatwg/html/issues/3540)

IDBFactory and IDBIndex:
 Follows spec.

Test IDLs:
 This CL works for tests in Chromium repository, and following tests
 need to be upstream for WPT.
 - wpt/interfaces/IndexedDB.idl
 - wpt/interfaces/WebCryptoAPI.idl


Bug: 819112
Change-Id: If7082cba0251a83e269fea428340b3b61d4c17cf
Reviewed-on: https://chromium-review.googlesource.com/952589Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542375}
parent 28c8cccd
...@@ -42,7 +42,7 @@ partial interface WindowOrWorkerGlobalScope { ...@@ -42,7 +42,7 @@ partial interface WindowOrWorkerGlobalScope {
[Exposed=(Window,Worker)] [Exposed=(Window,Worker)]
interface IDBFactory { interface IDBFactory {
IDBOpenDBRequest open(DOMString name, IDBOpenDBRequest open(DOMString name,
[EnforceRange] optional unsigned long long version); optional [EnforceRange] unsigned long long version);
IDBOpenDBRequest deleteDatabase(DOMString name); IDBOpenDBRequest deleteDatabase(DOMString name);
short cmp(any first, any second); short cmp(any first, any second);
......
...@@ -131,7 +131,7 @@ dictionary CryptoKeyPair { ...@@ -131,7 +131,7 @@ dictionary CryptoKeyPair {
dictionary RsaKeyGenParams : Algorithm { dictionary RsaKeyGenParams : Algorithm {
// The length, in bits, of the RSA modulus // The length, in bits, of the RSA modulus
[EnforceRange] required unsigned long modulusLength; required [EnforceRange] unsigned long modulusLength;
// The RSA public exponent // The RSA public exponent
required BigInteger publicExponent; required BigInteger publicExponent;
}; };
......
...@@ -149,7 +149,7 @@ interface TestObject { ...@@ -149,7 +149,7 @@ interface TestObject {
[Custom=Getter] readonly attribute object customGetterReadonlyObjectAttribute; [Custom=Getter] readonly attribute object customGetterReadonlyObjectAttribute;
[Custom=Setter] attribute long customSetterLongAttribute; [Custom=Setter] attribute long customSetterLongAttribute;
[DeprecateAs=LongAttribute] attribute long deprecatedLongAttribute; [DeprecateAs=LongAttribute] attribute long deprecatedLongAttribute;
[EnforceRange] attribute long enforceRangeLongAttribute; attribute [EnforceRange] long enforceRangeLongAttribute;
[ImplementedAs=implementedAsName] attribute long implementedAsLongAttribute; [ImplementedAs=implementedAsName] attribute long implementedAsLongAttribute;
[Custom, ImplementedAs=implementedAsNameWithCustom] attribute long customImplementedAsLongAttribute; [Custom, ImplementedAs=implementedAsNameWithCustom] attribute long customImplementedAsLongAttribute;
[Custom=Getter, ImplementedAs=implementedAsNameWithCustomGetter] attribute long customGetterImplementedAsLongAttribute; [Custom=Getter, ImplementedAs=implementedAsNameWithCustomGetter] attribute long customGetterImplementedAsLongAttribute;
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
RuntimeEnabled=CSSTypedOM, RuntimeEnabled=CSSTypedOM,
Exposed=(Window,LayoutWorklet,PaintWorklet) Exposed=(Window,LayoutWorklet,PaintWorklet)
] interface CSSUnitValue : CSSNumericValue { ] interface CSSUnitValue : CSSNumericValue {
[EnforceRange] attribute double value; attribute double value;
readonly attribute DOMString unit; readonly attribute DOMString unit;
}; };
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
RuntimeEnabled=OffscreenCanvas, RuntimeEnabled=OffscreenCanvas,
MeasureAs=OffscreenCanvas MeasureAs=OffscreenCanvas
] interface OffscreenCanvas : EventTarget { ] interface OffscreenCanvas : EventTarget {
[EnforceRange] attribute unsigned long width; attribute [EnforceRange] unsigned long width;
[EnforceRange] attribute unsigned long height; attribute [EnforceRange] unsigned long height;
[CallWith=ScriptState, RaisesException] ImageBitmap transferToImageBitmap(); [CallWith=ScriptState, RaisesException] ImageBitmap transferToImageBitmap();
[MeasureAs=OffscreenCanvasConvertToBlob, RaisesException, CallWith=ScriptState] Promise<Blob> convertToBlob(optional ImageEncodeOptions options); [MeasureAs=OffscreenCanvasConvertToBlob, RaisesException, CallWith=ScriptState] Promise<Blob> convertToBlob(optional ImageEncodeOptions options);
......
...@@ -25,24 +25,24 @@ ...@@ -25,24 +25,24 @@
interface TypeConversions { interface TypeConversions {
attribute long testLong; attribute long testLong;
[EnforceRange, ImplementedAs=testLong] attribute long testEnforceRangeLong; [ImplementedAs=testLong] attribute [EnforceRange] long testEnforceRangeLong;
attribute unsigned long testUnsignedLong; attribute unsigned long testUnsignedLong;
[EnforceRange, ImplementedAs=testUnsignedLong] attribute unsigned long testEnforceRangeUnsignedLong; [ImplementedAs=testUnsignedLong] attribute [EnforceRange] unsigned long testEnforceRangeUnsignedLong;
attribute long long testLongLong; attribute long long testLongLong;
[EnforceRange, ImplementedAs=testLongLong] attribute long long testEnforceRangeLongLong; [ImplementedAs=testLongLong] attribute [EnforceRange] long long testEnforceRangeLongLong;
attribute unsigned long long testUnsignedLongLong; attribute unsigned long long testUnsignedLongLong;
[EnforceRange, ImplementedAs=testUnsignedLongLong] attribute unsigned long long testEnforceRangeUnsignedLongLong; [ImplementedAs=testUnsignedLongLong] attribute [EnforceRange] unsigned long long testEnforceRangeUnsignedLongLong;
attribute byte testByte; attribute byte testByte;
[EnforceRange, ImplementedAs=testByte] attribute byte testEnforceRangeByte; [ImplementedAs=testByte] attribute [EnforceRange] byte testEnforceRangeByte;
attribute octet testOctet; attribute octet testOctet;
[EnforceRange, ImplementedAs=testOctet] attribute octet testEnforceRangeOctet; [ImplementedAs=testOctet] attribute [EnforceRange] octet testEnforceRangeOctet;
attribute short testShort; attribute short testShort;
[EnforceRange, ImplementedAs=testShort] attribute short testEnforceRangeShort; [ImplementedAs=testShort] attribute [EnforceRange] short testEnforceRangeShort;
attribute unsigned short testUnsignedShort; attribute unsigned short testUnsignedShort;
[EnforceRange, ImplementedAs=testUnsignedShort] attribute unsigned short testEnforceRangeUnsignedShort; [ImplementedAs=testUnsignedShort] attribute [EnforceRange] unsigned short testEnforceRangeUnsignedShort;
attribute ByteString testByteString; attribute ByteString testByteString;
void setTestByteString(ByteString byteString); void setTestByteString(ByteString byteString);
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
Exposed=(Window,Worker) Exposed=(Window,Worker)
] interface IDBFactory { ] interface IDBFactory {
[NewObject, CallWith=ScriptState, RaisesException] IDBOpenDBRequest open(DOMString name, [NewObject, CallWith=ScriptState, RaisesException] IDBOpenDBRequest open(DOMString name,
[EnforceRange] optional unsigned long long version); optional [EnforceRange] unsigned long long version);
[NewObject, CallWith=ScriptState, RaisesException] IDBOpenDBRequest deleteDatabase(DOMString name); [NewObject, CallWith=ScriptState, RaisesException] IDBOpenDBRequest deleteDatabase(DOMString name);
[CallWith=ScriptState, RaisesException] short cmp(any first, any second); [CallWith=ScriptState, RaisesException] short cmp(any first, any second);
......
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest get(any key); [NewObject, CallWith=ScriptState, RaisesException] IDBRequest get(any key);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest getKey(any key); [NewObject, CallWith=ScriptState, RaisesException] IDBRequest getKey(any key);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAll([Default=Undefined] optional any query, [NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAll([Default=Undefined] optional any query,
[EnforceRange] optional unsigned long count); optional [EnforceRange] unsigned long count);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAllKeys([Default=Undefined] optional any query, [NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAllKeys([Default=Undefined] optional any query,
[EnforceRange] optional unsigned long count); optional [EnforceRange] unsigned long count);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key); [NewObject, CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, [NewObject, CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment