Bug 1535988, backout because bug 1537555, r=backout

This commit is contained in:
Olli Pettay 2019-03-22 17:20:27 +02:00
Родитель fe2449bf59
Коммит 59b1b91619
2 изменённых файлов: 2 добавлений и 20 удалений

Просмотреть файл

@ -406,8 +406,7 @@ void HTMLFormElement::UnbindFromTree(bool aDeep, bool aNullParent) {
void HTMLFormElement::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
aVisitor.mWantsWillHandleEvent = true;
if (aVisitor.mEvent->IsTrusted() &&
aVisitor.mEvent->mOriginalTarget == static_cast<nsIContent*>(this)) {
if (aVisitor.mEvent->mOriginalTarget == static_cast<nsIContent*>(this)) {
uint32_t msg = aVisitor.mEvent->mMessage;
if (msg == eFormSubmit) {
if (mGeneratingSubmit) {
@ -444,8 +443,7 @@ void HTMLFormElement::WillHandleEvent(EventChainPostVisitor& aVisitor) {
}
nsresult HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
if (aVisitor.mEvent->IsTrusted() &&
aVisitor.mEvent->mOriginalTarget == static_cast<nsIContent*>(this)) {
if (aVisitor.mEvent->mOriginalTarget == static_cast<nsIContent*>(this)) {
EventMessage msg = aVisitor.mEvent->mMessage;
if (msg == eFormSubmit) {
// let the form know not to defer subsequent submissions

Просмотреть файл

@ -207,20 +207,4 @@ async_test(t => {
}, "clicking the child of a button by dispatching a non-bubbling event should not trigger submit");
async_test(t => {
const form = document.createElement("form");
const button = document.createElement("button");
button.type = "button";
button.onclick =
function(e) {
form.dispatchEvent(new Event("submit"), { bubbles: true});
};
form.appendChild(button);
document.body.appendChild(form);
button.click();
t.step_timeout(() => t.done(), 500);
}, "dispatching submit event should not trigger a submit");
</script>