Commit 552a6812 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

bindings: Remove all use cases (in prod) of obsolete [DefaultValue]

Bug: 924839, 839389
Change-Id: I1c8c6dcd0d3e83f06816852e55351bc925974ddb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037293
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738146}
parent a03c449e
......@@ -34,6 +34,6 @@
// Non-standard APIs
[MeasureAs=CSSStyleSheetRules, RaisesException] readonly attribute CSSRuleList rules;
[MeasureAs=CSSStyleSheetAddRule, RaisesException] long addRule([DefaultValue=Undefined] optional DOMString selector, [DefaultValue=Undefined] optional DOMString style, optional unsigned long index);
[MeasureAs=CSSStyleSheetRemoveRule, RaisesException] void removeRule([DefaultValue=Undefined] optional unsigned long index);
[MeasureAs=CSSStyleSheetAddRule, RaisesException] long addRule(optional DOMString selector = "undefined", optional DOMString style = "undefined", optional unsigned long index);
[MeasureAs=CSSStyleSheetRemoveRule, RaisesException] void removeRule(optional unsigned long index = 0);
};
......@@ -35,5 +35,5 @@
NoInterfaceObject
] interface StyleMedia {
[MeasureAs=StyleMediaType] readonly attribute DOMString type;
[MeasureAs=StyleMediaMatchMedium] boolean matchMedium([DefaultValue=Undefined] optional DOMString mediaquery);
[MeasureAs=StyleMediaMatchMedium] boolean matchMedium(optional DOMString mediaquery = "undefined");
};
......@@ -185,7 +185,7 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
[RuntimeEnabled=AddressSpace, ImplementedAs=addressSpaceForBindings] readonly attribute AddressSpace addressSpace;
// Non-standard APIs
[MeasureAs=DocumentCaretRangeFromPoint] Range caretRangeFromPoint([DefaultValue=Undefined] optional long x, [DefaultValue=Undefined] optional long y);
[MeasureAs=DocumentCaretRangeFromPoint] Range caretRangeFromPoint(optional long x = 0, optional long y = 0);
// Storage Access API
[CallWith=ScriptState, NewObject, RuntimeEnabled=StorageAccessAPI] Promise<boolean> hasStorageAccess();
......
......@@ -72,5 +72,5 @@
[NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFragment createContextualFragment(HTMLString fragment);
// Non-standard API
[RaisesException, DeprecateAs=RangeExpand] void expand([DefaultValue=Undefined] optional DOMString unit);
[RaisesException, DeprecateAs=RangeExpand] void expand(optional DOMString unit = "");
};
......@@ -67,7 +67,7 @@
[MeasureAs=SelectionExtentOffset] readonly attribute unsigned long extentOffset;
// https://github.com/w3c/selection-api/issues/37
[MeasureAs=SelectionModify] void modify([DefaultValue=Undefined] optional DOMString alter,
[DefaultValue=Undefined] optional DOMString direction,
[DefaultValue=Undefined] optional DOMString granularity);
[MeasureAs=SelectionModify] void modify(optional DOMString alter = "",
optional DOMString direction = "",
optional DOMString granularity = "");
};
......@@ -34,9 +34,9 @@
// https://w3c.github.io/uievents/#idl-interface-CompositionEvent-initializers
// TODO(foolip): None of the initCompositionEvent() arguments should be
// optional, and the spec has a locale argument after data.
[Measure] void initCompositionEvent([DefaultValue=Undefined] optional DOMString type,
[DefaultValue=Undefined] optional boolean bubbles,
[DefaultValue=Undefined] optional boolean cancelable,
[DefaultValue=Undefined] optional Window? view,
[DefaultValue=Undefined] optional DOMString data);
[Measure] void initCompositionEvent(optional DOMString type = "undefined",
optional boolean bubbles = false,
optional boolean cancelable = false,
optional Window? view = null,
optional DOMString data = "undefined");
};
......@@ -38,21 +38,21 @@
// https://w3c.github.io/uievents/#idl-interface-MouseEvent-initializers
// TODO(foolip): None of the initMouseEvent() arguments should be optional.
[CallWith=ScriptState, Measure] void initMouseEvent([DefaultValue=Undefined] optional DOMString type,
[DefaultValue=Undefined] optional boolean bubbles,
[DefaultValue=Undefined] optional boolean cancelable,
[DefaultValue=Undefined] optional Window? view,
[DefaultValue=Undefined] optional long detail,
[DefaultValue=Undefined] optional long screenX,
[DefaultValue=Undefined] optional long screenY,
[DefaultValue=Undefined] optional long clientX,
[DefaultValue=Undefined] optional long clientY,
[DefaultValue=Undefined] optional boolean ctrlKey,
[DefaultValue=Undefined] optional boolean altKey,
[DefaultValue=Undefined] optional boolean shiftKey,
[DefaultValue=Undefined] optional boolean metaKey,
[DefaultValue=Undefined] optional unsigned short button,
[DefaultValue=Undefined] optional EventTarget? relatedTarget);
[CallWith=ScriptState, Measure] void initMouseEvent(optional DOMString type = "undefined",
optional boolean bubbles = false,
optional boolean cancelable = false,
optional Window? view = null,
optional long detail = 0,
optional long screenX = 0,
optional long screenY = 0,
optional long clientX = 0,
optional long clientY = 0,
optional boolean ctrlKey = false,
optional boolean altKey = false,
optional boolean shiftKey = false,
optional boolean metaKey = false,
optional unsigned short button = 0,
optional EventTarget? relatedTarget = null);
readonly attribute double pageX;
readonly attribute double pageY;
......
......@@ -31,12 +31,12 @@ interface MutationEvent : Event {
readonly attribute DOMString attrName;
readonly attribute unsigned short attrChange;
// TODO(foolip): None of the initMutationEvent() arguments should be optional.
[Measure] void initMutationEvent([DefaultValue=Undefined] optional DOMString type,
[DefaultValue=Undefined] optional boolean bubbles,
[DefaultValue=Undefined] optional boolean cancelable,
[DefaultValue=Undefined] optional Node? relatedNode,
[DefaultValue=Undefined] optional DOMString prevValue,
[DefaultValue=Undefined] optional DOMString newValue,
[DefaultValue=Undefined] optional DOMString attrName,
[DefaultValue=Undefined] optional unsigned short attrChange);
[Measure] void initMutationEvent(optional DOMString type = "undefined",
optional boolean bubbles = false,
optional boolean cancelable = false,
optional Node? relatedNode = null,
optional DOMString prevValue = "undefined",
optional DOMString newValue = "undefined",
optional DOMString attrName = "undefined",
optional unsigned short attrChange = 0);
};
......@@ -35,10 +35,10 @@ interface TextEvent : UIEvent {
[Measure] readonly attribute DOMString data;
[Measure] void initTextEvent([DefaultValue=Undefined] optional DOMString type,
[DefaultValue=Undefined] optional boolean bubbles,
[DefaultValue=Undefined] optional boolean cancelable,
[DefaultValue=Undefined] optional Window? view,
[DefaultValue=Undefined] optional DOMString data);
[Measure] void initTextEvent(optional DOMString type = "undefined",
optional boolean bubbles = false,
optional boolean cancelable = false,
optional Window? view = null,
optional DOMString data = "undefined");
};
......@@ -29,11 +29,11 @@
// https://w3c.github.io/uievents/#idl-interface-UIEvent-initializers
// TODO(foolip): None of the initUIEvent() arguments should be optional.
[Measure] void initUIEvent([DefaultValue=Undefined] optional DOMString type,
[DefaultValue=Undefined] optional boolean bubbles,
[DefaultValue=Undefined] optional boolean cancelable,
[DefaultValue=Undefined] optional Window? view,
[DefaultValue=Undefined] optional long detail);
[Measure] void initUIEvent(optional DOMString type = "undefined",
optional boolean bubbles = false,
optional boolean cancelable = false,
optional Window? view = null,
optional long detail = 0);
readonly attribute unsigned long which;
};
......@@ -181,13 +181,13 @@
// Non-standard APIs
[MeasureAs=WindowClientInformation, Replaceable] readonly attribute Navigator clientInformation;
[Replaceable, MeasureAs=WindowEvent, Custom=Getter, NotEnumerable] readonly attribute Event event;
[MeasureAs=WindowFind] boolean find([DefaultValue=Undefined] optional DOMString string,
[DefaultValue=Undefined] optional boolean caseSensitive,
[DefaultValue=Undefined] optional boolean backwards,
[DefaultValue=Undefined] optional boolean wrap,
[DefaultValue=Undefined] optional boolean wholeWord,
[DefaultValue=Undefined] optional boolean searchInFrames,
[DefaultValue=Undefined] optional boolean showDialog);
[MeasureAs=WindowFind] boolean find(optional DOMString string = "",
optional boolean caseSensitive = false,
optional boolean backwards = false,
optional boolean wrap = false,
optional boolean wholeWord = false,
optional boolean searchInFrames = false,
optional boolean showDialog = false);
[MeasureAs=WindowOffscreenBuffering, Replaceable, NotEnumerable] readonly attribute boolean offscreenBuffering;
[HighEntropy, MeasureAs=WindowScreenLeft, Replaceable] readonly attribute long screenLeft;
[HighEntropy, MeasureAs=WindowScreenTop, Replaceable] readonly attribute long screenTop;
......
......@@ -33,6 +33,12 @@ ScriptPromise UnderlyingSourceBase::pull(ScriptState* script_state) {
return ScriptPromise::CastUndefined(script_state);
}
ScriptPromise UnderlyingSourceBase::cancelWrapper(ScriptState* script_state) {
v8::Isolate* isolate = script_state->GetIsolate();
return cancelWrapper(script_state,
ScriptValue(isolate, v8::Undefined(isolate)));
}
ScriptPromise UnderlyingSourceBase::cancelWrapper(ScriptState* script_state,
ScriptValue reason) {
if (controller_)
......
......@@ -35,6 +35,7 @@ class CORE_EXPORT UnderlyingSourceBase
virtual ScriptPromise pull(ScriptState*);
ScriptPromise cancelWrapper(ScriptState*);
ScriptPromise cancelWrapper(ScriptState*, ScriptValue reason);
virtual ScriptPromise Cancel(ScriptState*, ScriptValue reason);
......
......@@ -13,7 +13,7 @@
interface UnderlyingSourceBase {
[CallWith=ScriptState, ImplementedAs=startWrapper] Promise<void> start(any stream);
[CallWith=ScriptState] Promise<void> pull();
[CallWith=ScriptState, ImplementedAs=cancelWrapper] Promise<void> cancel([DefaultValue=Undefined] optional any reason);
[CallWith=ScriptState, ImplementedAs=cancelWrapper] Promise<void> cancel(optional any reason);
// This only exists to prevent Object.prototype.type being accessed.
[CallWith=ScriptState] readonly attribute any type;
......
......@@ -28,5 +28,5 @@
[
NoInterfaceObject
] interface XPathNSResolver {
DOMString? lookupNamespaceURI([DefaultValue=Undefined] optional DOMString prefix);
DOMString? lookupNamespaceURI(optional DOMString prefix = "undefined");
};
......@@ -27,6 +27,6 @@
NoInterfaceObject
] interface GamepadList {
readonly attribute unsigned long length;
Gamepad item([DefaultValue=Undefined] optional unsigned long index);
Gamepad item(optional unsigned long index = 0);
[NotEnumerable, ImplementedAs=item] getter Gamepad (unsigned long index);
};
......@@ -47,7 +47,7 @@ enum IDBCursorDirection {
[RaisesException] void advance([EnforceRange] unsigned long count);
[CallWith=ScriptState, ImplementedAs=Continue, RaisesException]
void continue([DefaultValue=Undefined] optional any key);
void continue(optional any key = null);
[CallWith=ScriptState, RaisesException]
void continuePrimaryKey(any key, any primaryKey);
......
......@@ -36,14 +36,14 @@
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest get(any key);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest getKey(any key);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAll([DefaultValue=Undefined] optional any query,
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAll(optional any query = null,
optional [EnforceRange] unsigned long count);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAllKeys([DefaultValue=Undefined] optional any query,
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest getAllKeys(optional any query = null,
optional [EnforceRange] unsigned long count);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest count([DefaultValue=Undefined] optional any key);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest count(optional any key = null);
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest openCursor([DefaultValue=Undefined] optional any range,
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest openCursor(optional any range = null,
optional IDBCursorDirection direction = "next");
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest openKeyCursor([DefaultValue=Undefined] optional any range,
[NewObject, CallWith=ScriptState, RaisesException] IDBRequest openKeyCursor(optional any range = null,
optional IDBCursorDirection direction = "next");
};
......@@ -337,6 +337,14 @@ static Vector<std::unique_ptr<IDBKey>> GenerateIndexKeysForValue(
return index_keys;
}
IDBRequest* IDBObjectStore::add(ScriptState* script_state,
const ScriptValue& value,
ExceptionState& exception_state) {
v8::Isolate* isolate = script_state->GetIsolate();
return add(script_state, value, ScriptValue(isolate, v8::Undefined(isolate)),
exception_state);
}
IDBRequest* IDBObjectStore::add(ScriptState* script_state,
const ScriptValue& value,
const ScriptValue& key,
......@@ -347,6 +355,14 @@ IDBRequest* IDBObjectStore::add(ScriptState* script_state,
exception_state);
}
IDBRequest* IDBObjectStore::put(ScriptState* script_state,
const ScriptValue& value,
ExceptionState& exception_state) {
v8::Isolate* isolate = script_state->GetIsolate();
return put(script_state, value, ScriptValue(isolate, v8::Undefined(isolate)),
exception_state);
}
IDBRequest* IDBObjectStore::put(ScriptState* script_state,
const ScriptValue& value,
const ScriptValue& key,
......
......@@ -96,12 +96,14 @@ class MODULES_EXPORT IDBObjectStore final : public ScriptWrappable {
IDBRequest* getAllKeys(ScriptState*,
const ScriptValue& range,
ExceptionState&);
IDBRequest* add(ScriptState*, const ScriptValue& value, ExceptionState&);
IDBRequest* add(ScriptState*,
const ScriptValue&,
const ScriptValue& value,
const ScriptValue& key,
ExceptionState&);
IDBRequest* put(ScriptState*, const ScriptValue& value, ExceptionState&);
IDBRequest* put(ScriptState*,
const ScriptValue&,
const ScriptValue& value,
const ScriptValue& key,
ExceptionState&);
IDBRequest* Delete(ScriptState*, const ScriptValue& key, ExceptionState&);
......
......@@ -35,10 +35,10 @@
readonly attribute boolean autoIncrement;
[CallWith=ScriptState, MeasureAs=IndexedDBWrite, NewObject, RaisesException]
IDBRequest put(any value, [DefaultValue=Undefined] optional any key);
IDBRequest put(any value, optional any key);
[CallWith=ScriptState, MeasureAs=IndexedDBWrite, NewObject, RaisesException]
IDBRequest add(any value, [DefaultValue=Undefined] optional any key);
IDBRequest add(any value, optional any key);
[
CallWith=ScriptState,
......@@ -58,22 +58,22 @@
IDBRequest getKey(any key);
[CallWith=ScriptState, MeasureAs=IndexedDBRead, NewObject, RaisesException]
IDBRequest getAll([DefaultValue=Undefined] optional any query,
IDBRequest getAll(optional any query = null,
optional [EnforceRange] unsigned long count);
[CallWith=ScriptState, MeasureAs=IndexedDBRead, NewObject, RaisesException]
IDBRequest getAllKeys([DefaultValue=Undefined] optional any query,
IDBRequest getAllKeys(optional any query = null,
optional [EnforceRange] unsigned long count);
[CallWith=ScriptState, MeasureAs=IndexedDBRead, NewObject, RaisesException]
IDBRequest count([DefaultValue=Undefined] optional any key);
IDBRequest count(optional any key = null);
[CallWith=ScriptState, MeasureAs=IndexedDBRead, NewObject, RaisesException]
IDBRequest openCursor([DefaultValue=Undefined] optional any range,
IDBRequest openCursor(optional any range = null,
optional IDBCursorDirection direction = "next");
[CallWith=ScriptState, MeasureAs=IndexedDBRead, NewObject, RaisesException]
IDBRequest openKeyCursor([DefaultValue=Undefined] optional any range,
IDBRequest openKeyCursor(optional any range = null,
optional IDBCursorDirection direction = "next");
[MeasureAs=IndexedDBRead, RaisesException] IDBIndex index(DOMString name);
......
......@@ -27,6 +27,6 @@
NoInterfaceObject
] interface RTCStatsResponse {
sequence<RTCLegacyStatsReport> result();
RTCLegacyStatsReport namedItem([DefaultValue=Undefined] optional DOMString name);
RTCLegacyStatsReport namedItem(optional DOMString name = "undefined");
[NotEnumerable, ImplementedAs=namedItem] getter RTCLegacyStatsReport (DOMString name);
};
......@@ -32,7 +32,7 @@
const unsigned long VERTEX_ARRAY_BINDING_OES = 0x85B5;
WebGLVertexArrayObjectOES createVertexArrayOES();
void deleteVertexArrayOES([DefaultValue=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
boolean isVertexArrayOES([DefaultValue=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
void bindVertexArrayOES([DefaultValue=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
void deleteVertexArrayOES(optional WebGLVertexArrayObjectOES? arrayObject = null);
boolean isVertexArrayOES(optional WebGLVertexArrayObjectOES? arrayObject = null);
void bindVertexArrayOES(optional WebGLVertexArrayObjectOES? arrayObject = null);
};
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