Bug 1520372 - Add an ownerElement property to nsITabParent, r=qdot

Differential Revision: https://phabricator.services.mozilla.com/D16713

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nika Layzell 2019-01-16 20:00:17 +00:00
Родитель 8e2cad84f0
Коммит 083cc0a7c3
2 изменённых файлов: 11 добавлений и 0 удалений

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

@ -6,6 +6,7 @@
#include "domstubs.idl"
interface nsIPrincipal;
webidl Element;
[builtinclass, scriptable, uuid(8e49f7b0-1f98-4939-bf91-e9c39cd56434)]
interface nsITabParent : nsISupports
@ -81,6 +82,11 @@ interface nsITabParent : nsISupports
*/
readonly attribute boolean hasBeforeUnload;
/**
* The frame element which currently embeds this nsITabParent object.
*/
readonly attribute Element ownerElement;
/**
* Notify APZ to start autoscrolling.
* (aAnchorX, aAnchorY) are the coordinates of the autoscroll anchor,

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

@ -305,6 +305,11 @@ void TabParent::SetOwnerElement(Element* aElement) {
}
}
NS_IMETHODIMP TabParent::GetOwnerElement(Element** aElement) {
*aElement = do_AddRef(GetOwnerElement()).take();
return NS_OK;
}
void TabParent::AddWindowListeners() {
if (mFrameElement) {
if (nsCOMPtr<nsPIDOMWindowOuter> window =