Closed Bug 594413 Opened 14 years ago Closed 14 years ago

Provide QueryService for main document accessible

Categories

(Core :: Disability Access APIs, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- beta7+

People

(Reporter: davidb, Assigned: davidb)

References

Details

Attachments

(1 file, 4 obsolete files)

Requested by a major vendor.
Attached patch WIP (obsolete) — Splinter Review
Alexander, your early feedback appreciated.
Attachment #473083 - Flags: feedback?(surkov.alexander)
1) they aren't interested to get root document accessible for accessible in tab content 2) you should distinguish where's the accessible that QueryService() is called on so that you should return document accessible associated with tab if you're inside a tab content, and you should return root accessible if you're outside of tab content I think
OK if I change the call to GetSameTypeRootTreeItem I understand that will work for non-chrome documents. I'm uncertain how best to handle chrome docs.
Neil Deakin tells me that for all chrome documents that load in a tab, GetSameTypeRootTreeItem should do what we need.
Attachment #473083 - Flags: feedback?(surkov.alexander)
(In reply to comment #4) > Neil Deakin tells me that for all chrome documents that load in a tab, > GetSameTypeRootTreeItem should do what we need. Ok, great. Btw, we need a mochitest for this.
Btw, if we're going to fix accChild then we need to introduce document accessible tree, you could rely on it instead of docshell treeitems.
blocking2.0: --- → ?
Attached patch WIP 2 (obsolete) — Splinter Review
Alexander, feel free to rework this patch if you like.
Attachment #473083 - Attachment is obsolete: true
Attachment #473576 - Flags: feedback?(surkov.alexander)
Especially if you want to base it off your recent landing.
It sounds it might return root document for accessible inside of root document, I'm not sure it's expected. We need to check this.
I don't think *ppv = static_cast<IAccessible*>(docAcc); may return null
(In reply to comment #9) > It sounds it might return root document for accessible inside of root document, yes, it is, http://mxr.mozilla.org/mozilla-central/source/docshell/base/nsDocShell.cpp#2601
Oh right, it looks like it stops at the first root, so could be an iframe. Drat!
Ignore my last comment it should work in that respect. I'm asking for details from the vendor.
(In reply to comment #10) > I don't think *ppv = static_cast<IAccessible*>(docAcc); may return null Hi Alexander, I'm not sure what you mean here? (re: comment 9) I can bail for non content type.
(In reply to comment #14) > (In reply to comment #10) > > I don't think *ppv = static_cast<IAccessible*>(docAcc); may return null > > Hi Alexander, I'm not sure what you mean here? that only means that static_cast<> doens't return null until it's operand is not null. > > (re: comment 9) > I can bail for non content type. I think it's right but check with AT
blocking2.0: ? → final+
Note to drivers: I marked this blocking because it will mitigate some painful fall out from bug 130078.
I'm set up with a test app to debug this now. It looks pretty good! Still need to iron things out with the vendor who requested this. So far I've confirmed that the document returned is indeed what we want. Tested various pages including about:addons.
Attachment #473576 - Flags: feedback?(surkov.alexander)
Status: currently one vendor is happy with this but still testing. Note: I think we should probably rename the SID to: SID_IAccessibleRootDocument if the current implementation sticks.
Blocks: 130078
(Or even SID_IAccessibleSameTypeRoot)
Attached patch patch (obsolete) — Splinter Review
OK this is the vendor approved content document only version. Chrome root not wanted for the purposes of virtual buffer.
Attachment #473576 - Attachment is obsolete: true
Attachment #476843 - Flags: review?(surkov.alexander)
Comment on attachment 476843 [details] [diff] [review] patch >+ // We want the root for content only >+ PRInt32 itemType; >+ root->GetItemType(&itemType); >+ if (itemType != nsIDocShellTreeItem::typeContent) Hmm I guess I could do: if (!root->IsContent())
I mean if (!IsContent()), but I like what is in the patch actually.
Attachment #476843 - Flags: review?(marco.zehe)
Comment on attachment 476843 [details] [diff] [review] patch Does GetItemType also return the content doc of the to most doc if dcalled from within an iframe? Just wanting to make sure we cover all cases.
(In reply to comment #23) > Comment on attachment 476843 [details] [diff] [review] > patch > > Does GetItemType also return the content doc of the to most doc if dcalled from > within an iframe? Yes.
Marco actually I assumed you were asking about GetSameTypeRootTreeItem. GetSameTypeRootTreeItem returns the top most 'browser tab' document even if called from within an iframe. GetItemType returns type content for all my tests, including xul documents loaded in tabs.
(In reply to comment #25) > Marco actually I assumed you were asking about GetSameTypeRootTreeItem. > GetSameTypeRootTreeItem returns the top most 'browser tab' document even if > called from within an iframe. GetItemType returns type content for all my > tests, including xul documents loaded in tabs. OK, so I need to make sure something like Add-Ons Manager does actually not get rendered as a virtual document in JAWS or WE. It does not in NVDA, so we're OK there, at least with a regular nightly.
Comment on attachment 476843 [details] [diff] [review] patch r=me, this looks correct. Note that I cannot actually test until I have builds of either JAWS or wE that utilize this mechanism.
Attachment #476843 - Flags: review?(marco.zehe) → review+
Comment on attachment 476843 [details] [diff] [review] patch > static const GUID IID_SimpleDOMDeprecated = {0x0c539790,0x12e4,0x11cf,0xb6,0x61,0x00,0xaa,0x00,0x4c,0xd6,0xd8}; >+ >+ // Provide a special service ID for getting the content document accessible. >+ static const GUID SID_IAccessibleContentDocument = {0xa5d8e1f3,0x3571,0x4d8f,0x95,0x21,0x07,0xed,0x28,0xfb,0x07,0x2e}; is that the name that you and AT are fine? Iirc we don't have a "content document accessible" term so it's not way to use to describe this uuid. >+ >+ nsCOMPtr<nsIDocShellTreeItem> root; >+ docShellTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(root)); >+ if (!root) >+ return E_UNEXPECTED; >+ >+ // We want the root for content only >+ PRInt32 itemType; >+ root->GetItemType(&itemType); >+ if (itemType != nsIDocShellTreeItem::typeContent) >+ return E_NOINTERFACE; I bet we must to have good commenting on this, especially if addons manager is treated differently by some reason. I would like to have good description of IAccessibleContentDocument and nice description of this code magic with some clarification why it returns the things that we expect. >+ nsDocAccessible *docAcc = nsAccUtils::GetDocAccessibleFor(root); nit: fix styling >+ if (!docAcc) >+ return E_UNEXPECTED; >+ >+ *ppv = static_cast<IAccessible*>(docAcc); >+ if (*ppv == nsnull) >+ return E_UNEXPECTED; iirc, I said this early, static_cast<> can't return null pointer if docAcc is not null. I'd like to look at new patch.
Attachment #476843 - Flags: review?(surkov.alexander)
> >+ static const GUID SID_IAccessibleContentDocument = {0xa5d8e1f3,0x3571,0x4d8f,0x95,0x21,0x07,0xed,0x28,0xfb,0x07,0x2e}; > > is that the name that you and AT are fine? Yes. > Iirc we don't have a "content > document accessible" term so it's not way to use to describe this uuid. We don't have a special name for what we return at all. I'm welcome to ideas here. How about "the accessible for the main document inside the browser tab"? > I bet we must to have good commenting on this, especially if addons manager is > treated differently by some reason. It works for about:addons - is that what you mean? But I agree more commenting wouldn't hurt. > I would like to have good description of IAccessibleContentDocument and nice > description of this code magic with some clarification why it returns the > things that we expect. Sure. > > > >+ nsDocAccessible *docAcc = nsAccUtils::GetDocAccessibleFor(root); > > nit: fix styling Will do. > > >+ if (!docAcc) > >+ return E_UNEXPECTED; > >+ > >+ *ppv = static_cast<IAccessible*>(docAcc); > >+ if (*ppv == nsnull) > >+ return E_UNEXPECTED; > > iirc, I said this early, static_cast<> can't return null pointer if docAcc is > not null. > Ah I understand your point now. I will remove the redundant check.
(In reply to comment #29) > > >+ static const GUID SID_IAccessibleContentDocument = {0xa5d8e1f3,0x3571,0x4d8f,0x95,0x21,0x07,0xed,0x28,0xfb,0x07,0x2e}; > > > > is that the name that you and AT are fine? > > Yes. > > > Iirc we don't have a "content > > document accessible" term so it's not way to use to describe this uuid. > > We don't have a special name for what we return at all. I'm welcome to ideas > here. How about "the accessible for the main document inside the browser tab"? yes, but not exactly. If addons manager is handled especially then this description doesn't work or should be clarified. > > I bet we must to have good commenting on this, especially if addons manager is > > treated differently by some reason. > > It works for about:addons - is that what you mean? But I agree more commenting > wouldn't hurt. right, chrome documents, we don't need virtual buffer for about:addons but we need it for error pages for example if I get right.
Attached patch patch 1.1 (obsolete) — Splinter Review
The vendor prefers consistency here (and I agree with this). So with this patch we continue to always return the accessible that corresponds the root accessible for the browser tab document regardless of what content it has. The name of the SID is approved. I've added comments to describe what we are doing. I've removed the redundant null check. Alexander, if you can r+ we should land this for beta7 if still possible.
Attachment #476843 - Attachment is obsolete: true
Attachment #477946 - Flags: review?(surkov.alexander)
Comment on attachment 477946 [details] [diff] [review] patch 1.1 >diff --git a/accessible/src/msaa/nsAccessNodeWrap.cpp b/accessible/src/msaa/nsAccessNodeWrap.cpp >--- a/accessible/src/msaa/nsAccessNodeWrap.cpp >+++ b/accessible/src/msaa/nsAccessNodeWrap.cpp >@@ -129,23 +129,69 @@ STDMETHODIMP nsAccessNodeWrap::QueryInte > > (reinterpret_cast<IUnknown*>(*ppv))->AddRef(); > return S_OK; > } > > STDMETHODIMP > nsAccessNodeWrap::QueryService(REFGUID guidService, REFIID iid, void** ppv) > { >+ *ppv = nsnull; >+ > static const GUID IID_SimpleDOMDeprecated = {0x0c539790,0x12e4,0x11cf,0xb6,0x61,0x00,0xaa,0x00,0x4c,0xd6,0xd8}; >+ >+ // Provide a special service ID for getting the root accessible for the >+ // browser tab that contains this accessible object. If this accessible object >+ // is not inside a browser tab then the service fails with E_NOINTERFACE. >+ // A use case for this is for screen readers that need to switch context or >+ // 'virtual buffer' when focus moves from one browser tab area to another. "root accessible" is reserved term, "root accessible for the browser tab" means document accessible for Firefox UI window that contains this browser tab. Just remove "root" word. >+ >+ // Make sure this is a document. >+ nsDocAccessible *docAcc = nsAccUtils::GetDocAccessibleFor(root); again, please change styling, should be nsDocAccessible* docAcc = otherwise is good, r=me, please make sure to add tests in separate patch or bug.
Attachment #477946 - Flags: review?(surkov.alexander) → review+
Flags: in-testsuite?
Attached patch patch to landSplinter Review
Thanks Alexander. Hanging the final patch here for when the tree opens up a bit more.
Attachment #477946 - Attachment is obsolete: true
the patch should have beta7 blocking status
blocking2.0: final+ → beta7+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: