Bug 457688: click redispatching doesn't take into account sidebar offsets, r=mfinkle

This commit is contained in:
Gavin Sharp 2008-09-29 11:01:18 -04:00
Родитель 5026f83f51
Коммит 1e26364bd1
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -755,11 +755,12 @@
<parameter name="aClientX"/>
<parameter name="aClientY"/>
<body><![CDATA[
// Need to adjust for the toolbar height, etc.
var browserTop = this.browser.getBoundingClientRect().top;
// Need to adjust for the deckbrowser not being at 0,0
// (e.g. due to other browser UI)
var browserRect = this.getBoundingClientRect();
var clickOffsetX = this._screenToPage(aClientX) + this.dragData.pageX;
var clickOffsetY = this._screenToPage(aClientY - browserTop) + this.dragData.pageY;
var clickOffsetX = this._screenToPage(aClientX - browserRect.left) + this.dragData.pageX;
var clickOffsetY = this._screenToPage(aClientY - browserRect.top) + this.dragData.pageY;
// Scroll the browser so that the event is targeted properly
var cwin = this.browser.contentWindow;