Commit 7b66e0f7 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Add FormDataEvent interface.

It is behind the flag "FormDataEvent". The flag is off by default, and
tests will be added later.

Bug: 825684
Change-Id: If152940a52e684a1c64f75ee2f60fbd18b91954d
Reviewed-on: https://chromium-review.googlesource.com/995114Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548244}
parent 5fb329ce
...@@ -383,6 +383,7 @@ generate_event_interfaces("core_event_interfaces") { ...@@ -383,6 +383,7 @@ generate_event_interfaces("core_event_interfaces") {
"events/TransitionEvent.idl", "events/TransitionEvent.idl",
"events/UIEvent.idl", "events/UIEvent.idl",
"events/WheelEvent.idl", "events/WheelEvent.idl",
"html/forms/FormDataEvent.idl",
"html/track/TrackEvent.idl", "html/track/TrackEvent.idl",
"mojo/test/MojoInterfaceRequestEvent.idl", "mojo/test/MojoInterfaceRequestEvent.idl",
] ]
......
...@@ -257,6 +257,7 @@ core_idl_files = ...@@ -257,6 +257,7 @@ core_idl_files =
"html/canvas/TextMetrics.idl", "html/canvas/TextMetrics.idl",
"html/custom/CustomElementRegistry.idl", "html/custom/CustomElementRegistry.idl",
"html/forms/FormData.idl", "html/forms/FormData.idl",
"html/forms/FormDataEvent.idl",
"html/forms/HTMLButtonElement.idl", "html/forms/HTMLButtonElement.idl",
"html/forms/HTMLDataListElement.idl", "html/forms/HTMLDataListElement.idl",
"html/forms/HTMLFieldSetElement.idl", "html/forms/HTMLFieldSetElement.idl",
......
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
"focusin", "focusin",
"focusout", "focusout",
"foreignfetch", "foreignfetch",
"formdata",
"freeze", "freeze",
"fullscreenchange", "fullscreenchange",
"fullscreenerror", "fullscreenerror",
......
...@@ -351,6 +351,8 @@ blink_core_sources("html") { ...@@ -351,6 +351,8 @@ blink_core_sources("html") {
"forms/FormController.h", "forms/FormController.h",
"forms/FormData.cpp", "forms/FormData.cpp",
"forms/FormData.h", "forms/FormData.h",
"forms/FormDataEvent.cpp",
"forms/FormDataEvent.h",
"forms/HTMLButtonElement.cpp", "forms/HTMLButtonElement.cpp",
"forms/HTMLButtonElement.h", "forms/HTMLButtonElement.h",
"forms/HTMLDataListElement.cpp", "forms/HTMLDataListElement.cpp",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "core/html/forms/FormDataEvent.h"
#include "core/html/forms/FormData.h"
namespace blink {
FormDataEvent::FormDataEvent(FormData& form_data)
: Event(EventTypeNames::formdata, Bubbles::kYes, Cancelable::kNo),
form_data_(form_data) {}
FormDataEvent* FormDataEvent::Create(FormData& form_data) {
return new FormDataEvent(form_data);
}
void FormDataEvent::Trace(Visitor* visitor) {
visitor->Trace(form_data_);
Event::Trace(visitor);
}
const AtomicString& FormDataEvent::InterfaceName() const {
return EventNames::FormDataEvent;
}
} // namespace blink
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FormDataEvent_h
#define FormDataEvent_h
#include "core/dom/events/Event.h"
namespace blink {
class FormData;
class FormDataEvent : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
static FormDataEvent* Create(FormData& form_data);
void Trace(Visitor* visitor) override;
FormData* formData() const { return form_data_; };
const AtomicString& InterfaceName() const override;
private:
FormDataEvent(FormData& form_data);
Member<FormData> form_data_;
};
} // namespace blink
#endif // FormDataEvent_h
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://docs.google.com/document/d/1JO8puctCSpW-ZYGU8lF-h4FWRIDQNDVexzHoOQ2iQmY/edit?pli=1#heading=h.je8c7y5qpgki
[
Exposed=Window,
RuntimeEnabled=FormDataEvent
]
interface FormDataEvent : Event {
readonly attribute FormData formData;
};
...@@ -491,6 +491,9 @@ ...@@ -491,6 +491,9 @@
{ {
name: "ForceTallerSelectPopup", name: "ForceTallerSelectPopup",
}, },
{
name: "FormDataEvent",
},
{ {
name: "FractionalMouseEvent", name: "FractionalMouseEvent",
}, },
......
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