Size the autocomplete popup relative to the page's full zoom b=407912 r=ajschult

This commit is contained in:
neil@parkwaycc.co.uk 2008-05-25 14:21:59 -07:00
Родитель 25476e7c51
Коммит 8d3401fe9b
1 изменённых файлов: 13 добавлений и 3 удалений

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

@ -1579,12 +1579,22 @@
this.input = aInput;
this.invalidate();
var viewer = aElement
.ownerDocument
.defaultView
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShell)
.contentViewer
.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
var rect = aElement.getBoundingClientRect();
var width = rect.right - rect.left;
var width = Math.round((rect.right - rect.left) * viewer.fullZoom);
this.setAttribute("width", width > 100 ? width : 100);
const nsIPopupBoxObject = Components.interfaces.nsIPopupBoxObject;
this.popupBoxObject.setConsumeRollupEvent(aInput.consumeRollupEvent
? nsIPopupBoxObject.ROLLUP_CONSUME
: nsIPopupBoxObject.ROLLUP_NO_CONSUME);
this.openPopup(aElement, "after_start", 0, 0, false, false);
this.popupBoxObject.setConsumeRollupEvent(aInput.consumeRollupEvent);
}
]]></body>
</method>