| Index: third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-click.html
|
| diff --git a/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-click.html b/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-click.html
|
| index a16e1a276bd939477302a84a0cc3af96b624f013..760116beae90ec54d1a730b0db3653bbd828c399 100644
|
| --- a/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-click.html
|
| +++ b/third_party/WebKit/LayoutTests/imported/wpt/dom/events/Event-dispatch-click.html
|
| @@ -78,10 +78,10 @@ var globalCounter = 0 // sorry
|
| async_test(function(t) { // as above with <a>
|
| var i = 0
|
| var link = document.createElement("a")
|
| - link.href = "javascript:globalCounter--" // must not be triggered
|
| + link.href = "javascript:(function(){globalCounter--})()" // must not be triggered
|
| dump.appendChild(link)
|
| var child = link.appendChild(document.createElement("a"))
|
| - child.href = "javascript:globalCounter++"
|
| + child.href = "javascript:(function(){globalCounter++})()"
|
| child.dispatchEvent(new MouseEvent("click", {bubbles:true}))
|
| assert_equals(globalCounter, 1)
|
| t.done()
|
| @@ -116,4 +116,89 @@ async_test(function(t) {
|
| })
|
| input.dispatchEvent(clickEvent)
|
| }, "redispatch during post-click handling")
|
| +
|
| +async_test(function(t) {
|
| + var input = document.createElement("input")
|
| + input.type = "checkbox"
|
| + dump.appendChild(input)
|
| + var child = input.appendChild(document.createElement("input"))
|
| + child.type = "checkbox"
|
| + child.disabled = true
|
| + child.click()
|
| + assert_false(input.checked)
|
| + assert_false(child.checked)
|
| + t.done()
|
| +}, "disabled checkbox still has activation behavior")
|
| +
|
| +async_test(function(t) {
|
| + var state = "start"
|
| +
|
| + var form = document.createElement("form")
|
| + form.onsubmit = t.step_func(() => {
|
| + if(state == "start" || state == "checkbox") {
|
| + state = "failure"
|
| + } else if(state == "form") {
|
| + state = "done"
|
| + }
|
| + return false
|
| + })
|
| + dump.appendChild(form)
|
| + var button = form.appendChild(document.createElement("button"))
|
| + button.type = "submit"
|
| + var checkbox = button.appendChild(document.createElement("input"))
|
| + checkbox.type = "checkbox"
|
| + checkbox.onclick = t.step_func(() => {
|
| + if(state == "start") {
|
| + assert_unreached()
|
| + } else if(state == "checkbox") {
|
| + assert_true(checkbox.checked)
|
| + }
|
| + })
|
| + checkbox.disabled = true
|
| + checkbox.click()
|
| + assert_equals(state, "start")
|
| +
|
| + state = "checkbox"
|
| + checkbox.disabled = false
|
| + checkbox.click()
|
| + assert_equals(state, "checkbox")
|
| +
|
| + state = "form"
|
| + button.click()
|
| + assert_equals(state, "done")
|
| +
|
| + t.done()
|
| +}, "disabled checkbox still has activation behavior, part 2")
|
| +
|
| +async_test(function(t) {
|
| + var input = document.createElement("input")
|
| + input.type = "checkbox"
|
| + input.onclick = t.step_func_done(function() {
|
| + assert_true(input.checked)
|
| + })
|
| + input.click()
|
| +}, "disconnected checkbox should be checked")
|
| +
|
| +async_test(function(t) {
|
| + var input = document.createElement("input")
|
| + input.type = "radio"
|
| + input.onclick = t.step_func_done(function() {
|
| + assert_true(input.checked)
|
| + })
|
| + input.click()
|
| +}, "disconnected radio should be checked")
|
| +
|
| +async_test(function(t) {
|
| + var form = document.createElement("form")
|
| + var didSubmit = false
|
| + form.onsubmit = t.step_func(() => {
|
| + didSubmit = true
|
| + return false
|
| + })
|
| + var input = form.appendChild(document.createElement("input"))
|
| + input.type = "submit"
|
| + input.click()
|
| + assert_false(didSubmit)
|
| + t.done()
|
| +}, "disconnected form should not submit")
|
| </script>
|
|
|