|
Lines 21-26
function clickOn(element)
a/LayoutTests/fast/events/shadow-boundary-crossing-2.html_sec1
|
| 21 |
eventSender.mouseUp(); |
21 |
eventSender.mouseUp(); |
| 22 |
} |
22 |
} |
| 23 |
|
23 |
|
|
|
24 |
function clickOnLeftQuarterOf(element) |
| 25 |
{ |
| 26 |
if (!window.eventSender) |
| 27 |
return; |
| 28 |
|
| 29 |
var x = element.offsetLeft + element.offsetWidth / 4; |
| 30 |
var y = element.offsetTop + element.offsetHeight / 2; |
| 31 |
eventSender.mouseMoveTo(x, y); |
| 32 |
eventSender.mouseDown(); |
| 33 |
eventSender.mouseUp(); |
| 34 |
} |
| 24 |
|
35 |
|
| 25 |
function leapForward() |
36 |
function leapForward() |
| 26 |
{ |
37 |
{ |
|
Lines 45-51
var tests = {
a/LayoutTests/fast/events/shadow-boundary-crossing-2.html_sec2
|
| 45 |
log('Mutation events should not propagate out of the shadow DOM', !mutationEventFired); |
56 |
log('Mutation events should not propagate out of the shadow DOM', !mutationEventFired); |
| 46 |
textarea.parentNode.removeChild(textarea); |
57 |
textarea.parentNode.removeChild(textarea); |
| 47 |
}, |
58 |
}, |
| 48 |
defaultEventRetargeting: function() |
59 |
labelSyntheticClick: function() |
| 49 |
{ |
60 |
{ |
| 50 |
var count = 0; |
61 |
var count = 0; |
| 51 |
var label = document.body.appendChild(document.createElement('label')); |
62 |
var label = document.body.appendChild(document.createElement('label')); |
|
Lines 58-66
var tests = {
a/LayoutTests/fast/events/shadow-boundary-crossing-2.html_sec3
|
| 58 |
count++; |
69 |
count++; |
| 59 |
}, false); |
70 |
}, false); |
| 60 |
clickOn(searchInput); |
71 |
clickOn(searchInput); |
| 61 |
log("Events for default event handler should also be retargeted", count == 1); |
72 |
log("Label should look beyond shadow boundary to detect if it encloses its associated element", count == 1); |
| 62 |
label.parentNode.removeChild(label); |
73 |
label.parentNode.removeChild(label); |
| 63 |
}, |
74 |
}, |
|
|
75 |
defaultEventRetargeting: function() |
| 76 |
{ |
| 77 |
var count = 0; |
| 78 |
var fileInput = document.body.appendChild(document.createElement('input')); |
| 79 |
fileInput.setAttribute('type', 'file'); |
| 80 |
var counter = function() |
| 81 |
{ |
| 82 |
count++; |
| 83 |
} |
| 84 |
document.body.addEventListener('DOMActivate', counter, false); |
| 85 |
clickOnLeftQuarterOf(fileInput); |
| 86 |
log("Events for default event handler should not be retargeted", count == 1); |
| 87 |
document.body.removeEventListener('DOMActivate', counter, false); |
| 88 |
fileInput.parentNode.removeChild(fileInput); |
| 89 |
}, |
| 64 |
eventInProgress: function() |
90 |
eventInProgress: function() |
| 65 |
{ |
91 |
{ |
| 66 |
var textInput = document.body.appendChild(document.createElement('input')); |
92 |
var textInput = document.body.appendChild(document.createElement('input')); |