Commit 61244dcd authored by vivek.vg@samsung.com's avatar vivek.vg@samsung.com

[bindings] Make all CustomEvent.initCustomEvent arguments non-optional and remove custom binding.

BUG=345519

R=haraken@chromium.org, tkent@chromium.org

Review URL: https://codereview.chromium.org/1300093003

git-svn-id: svn://svn.chromium.org/blink/trunk@200831 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0b64161a
......@@ -44,13 +44,13 @@ Tests that custom events with prefixed animations names are correctly dispatched
</body>
<script>
var custom = document.createEvent('CustomEvent');
custom.initCustomEvent('webkitAnimationStart', true, true);
custom.initCustomEvent('webkitAnimationStart', true, true, null);
document.dispatchEvent(custom);
custom = document.createEvent('CustomEvent');
custom.initCustomEvent('webkitAnimationIteration', true, true);
custom.initCustomEvent('webkitAnimationIteration', true, true, null);
document.dispatchEvent(custom);
custom = document.createEvent('CustomEvent');
custom.initCustomEvent('webkitAnimationEnd', true, true);
custom.initCustomEvent('webkitAnimationEnd', true, true, null);
document.dispatchEvent(custom);
</script>
</html>
......@@ -44,13 +44,13 @@ Tests that custom events with unprefixed animations names are correctly dispatch
</body>
<script>
var custom = document.createEvent('CustomEvent');
custom.initCustomEvent('animationstart', true, true);
custom.initCustomEvent('animationstart', true, true, null);
document.dispatchEvent(custom);
custom = document.createEvent('CustomEvent');
custom.initCustomEvent('animationiteration', true, true);
custom.initCustomEvent('animationiteration', true, true, null);
document.dispatchEvent(custom);
custom = document.createEvent('CustomEvent');
custom.initCustomEvent('animationend', true, true);
custom.initCustomEvent('animationend', true, true, null);
document.dispatchEvent(custom);
</script>
</html>
......@@ -44,13 +44,13 @@ Tests that custom events with prefixed animations names are correctly dispatched
</body>
<script>
var custom = document.createEvent('CustomEvent');
custom.initCustomEvent('webkitAnimationStart', true, true);
custom.initCustomEvent('webkitAnimationStart', true, true, null);
document.dispatchEvent(custom);
custom = document.createEvent('CustomEvent');
custom.initCustomEvent('webkitAnimationIteration', true, true);
custom.initCustomEvent('webkitAnimationIteration', true, true, null);
document.dispatchEvent(custom);
custom = document.createEvent('CustomEvent');
custom.initCustomEvent('webkitAnimationEnd', true, true);
custom.initCustomEvent('webkitAnimationEnd', true, true, null);
document.dispatchEvent(custom);
</script>
</html>
......@@ -44,13 +44,13 @@ Tests that custom events with unprefixed animations names are correctly dispatch
</body>
<script>
var custom = document.createEvent('CustomEvent');
custom.initCustomEvent('animationstart', true, true);
custom.initCustomEvent('animationstart', true, true, null);
document.dispatchEvent(custom);
custom = document.createEvent('CustomEvent');
custom.initCustomEvent('animationiteration', true, true);
custom.initCustomEvent('animationiteration', true, true, null);
document.dispatchEvent(custom);
custom = document.createEvent('CustomEvent');
custom.initCustomEvent('animationend', true, true);
custom.initCustomEvent('animationend', true, true, null);
document.dispatchEvent(custom);
</script>
</html>
......@@ -73,20 +73,4 @@ void V8CustomEvent::detailAttributeGetterCustom(const v8::FunctionCallbackInfo<v
v8SetReturnValue(info, cacheState(info.GetIsolate(), info.Holder(), detail));
}
void V8CustomEvent::initCustomEventMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
CustomEvent* event = V8CustomEvent::toImpl(info.Holder());
TOSTRING_VOID(V8StringResource<>, typeArg, info[0]);
bool canBubbleArg;
bool cancelableArg;
if (!v8Call(info[1]->BooleanValue(info.GetIsolate()->GetCurrentContext()), canBubbleArg)
|| !v8Call(info[2]->BooleanValue(info.GetIsolate()->GetCurrentContext()), cancelableArg))
return;
v8::Local<v8::Value> detailsArg = info[3];
event->initEvent(typeArg, canBubbleArg, cancelableArg);
event->setDetail(ScriptValue(ScriptState::current(info.GetIsolate()), detailsArg));
}
} // namespace blink
......@@ -45,6 +45,12 @@ CustomEvent::~CustomEvent()
{
}
void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue& detail)
{
initEvent(type, canBubble, cancelable);
m_detail = detail;
}
void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> serializedDetail)
{
if (dispatched())
......
......@@ -49,6 +49,7 @@ public:
return adoptRefWillBeNoop(new CustomEvent(type, initializer));
}
void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue& detail);
void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue>);
const AtomicString& interfaceName() const override;
......@@ -56,7 +57,6 @@ public:
SerializedScriptValue* serializedDetail() { return m_serializedDetail.get(); }
ScriptValue detail() const { return m_detail; }
void setDetail(ScriptValue detail) { m_detail = detail; }
DECLARE_VIRTUAL_TRACE();
......
......@@ -31,9 +31,5 @@
] interface CustomEvent : Event {
[Custom=Getter] readonly attribute any detail;
// FIXME: initCustomEvent()'s arguments should not be optional.
[Custom, Measure] void initCustomEvent([Default=Undefined] optional DOMString type,
[Default=Undefined] optional boolean bubbles,
[Default=Undefined] optional boolean cancelable,
[Default=Undefined] optional any detail);
[Measure] void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail);
};
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