Fallback to another method to find tabs by coordinates correctly

This commit is contained in:
YUKI Hiroshi 2012-12-04 12:32:40 +09:00
parent fdff43f59c
commit f97f25c9e6

View File

@ -379,8 +379,8 @@ TreeStyleTabBrowser.prototype = {
getTabFromCoordinates : function TSTBrowser_getTabFromCoordinates(aCoordinates, aTabs) getTabFromCoordinates : function TSTBrowser_getTabFromCoordinates(aCoordinates, aTabs)
{ {
var tab = this.document.elementFromPoint(aCoordinates.clientX, aCoordinates.clientY); var tab = this.document.elementFromPoint(aCoordinates.clientX, aCoordinates.clientY);
if (tab && tab.localName == 'tab') if (tab && tab.localName == 'tab' && (!aTabs || aTabs.indexOf(tab) > -1))
return (!aTabs || aTabs.indexOf(tab) > -1) ? tab : null ; return tab;
var positionCoordinate = aCoordinates[this.screenPositionProp]; var positionCoordinate = aCoordinates[this.screenPositionProp];