Index: LayoutTests/fast/events/shadow-boundary-crossing-2.html |
=================================================================== |
--- LayoutTests/fast/events/shadow-boundary-crossing-2.html (revision 73270) |
+++ LayoutTests/fast/events/shadow-boundary-crossing-2.html (working copy) |
@@ -21,7 +21,18 @@ |
eventSender.mouseUp(); |
} |
+function clickOnLeftQuarterOf(element) |
+{ |
+ if (!window.eventSender) |
+ return; |
+ var x = element.offsetLeft + element.offsetWidth / 4; |
+ var y = element.offsetTop + element.offsetHeight / 2; |
+ eventSender.mouseMoveTo(x, y); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+} |
+ |
function leapForward() |
{ |
if (!window.eventSender) |
@@ -45,7 +56,7 @@ |
log('Mutation events should not propagate out of the shadow DOM', !mutationEventFired); |
textarea.parentNode.removeChild(textarea); |
}, |
- defaultEventRetargeting: function() |
+ labelSyntheticClick: function() |
{ |
var count = 0; |
var label = document.body.appendChild(document.createElement('label')); |
@@ -58,9 +69,24 @@ |
count++; |
}, false); |
clickOn(searchInput); |
- log("Events for default event handler should also be retargeted", count == 1); |
+ log("Label should look beyond shadow boundary to detect if it encloses its associated element", count == 1); |
label.parentNode.removeChild(label); |
}, |
+ defaultEventRetargeting: function() |
+ { |
+ var count = 0; |
+ var fileInput = document.body.appendChild(document.createElement('input')); |
+ fileInput.setAttribute('type', 'file'); |
+ var counter = function() |
+ { |
+ count++; |
+ } |
+ document.body.addEventListener('DOMActivate', counter, false); |
+ clickOnLeftQuarterOf(fileInput); |
+ log("Events for default event handler should not be retargeted", count == 1); |
+ document.body.removeEventListener('DOMActivate', counter, false); |
+ fileInput.parentNode.removeChild(fileInput); |
+ }, |
eventInProgress: function() |
{ |
var textInput = document.body.appendChild(document.createElement('input')); |