зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1535988, backout because bug 1537555, r=backout
This commit is contained in:
Родитель
fe2449bf59
Коммит
59b1b91619
|
@ -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>
|
||||
|
|
Загрузка…
Ссылка в новой задаче