From 52624b56b229e6f87b210453332f045f7d7cc4a7 Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Tue, 6 Sep 2016 11:27:24 -0600 Subject: [PATCH] Bug 1297549: Part 3 - Modify Windows AccessibleWrap to get hwnd from TabChild under e10s; r=tbsaunde MozReview-Commit-ID: Jn2f9EAtT8O --HG-- extra : rebase_source : 6ee62ec6b18d22f76ce6f2b60de9b0f408a5ec92 --- accessible/windows/msaa/AccessibleWrap.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/accessible/windows/msaa/AccessibleWrap.cpp b/accessible/windows/msaa/AccessibleWrap.cpp index 00c1d0b82875..48fc57d5ebf0 100644 --- a/accessible/windows/msaa/AccessibleWrap.cpp +++ b/accessible/windows/msaa/AccessibleWrap.cpp @@ -9,6 +9,7 @@ #include "Compatibility.h" #include "DocAccessible-inl.h" +#include "mozilla/dom/TabChild.h" #include "mozilla/a11y/DocAccessibleChild.h" #include "mozilla/a11y/DocAccessibleParent.h" #include "EnumVariant.h" @@ -1295,6 +1296,22 @@ AccessibleWrap::GetHWNDFor(Accessible* aAccessible) return nullptr; } + if (XRE_IsContentProcess()) { + DocAccessible* doc = aAccessible->Document(); + if (!doc) { + return nullptr; + } + + DocAccessibleChild* ipcDoc = doc->IPCDoc(); + if (!ipcDoc) { + return nullptr; + } + + auto tab = static_cast(ipcDoc->Manager()); + MOZ_ASSERT(tab); + return reinterpret_cast(tab->GetNativeWindowHandle()); + } + // Accessibles in child processes are said to have the HWND of the window // their tab is within. Popups are always in the parent process, and so // never proxied, which means this is basically correct.