Closed Bug 1167295 Opened 9 years ago Closed 9 years ago

manage PDocAccessible with PBrowser instead of PContent

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: tbsaunde, Assigned: tbsaunde)

Details

Attachments

(1 file)

      No description provided.
Comment on attachment 8608895 [details] [diff] [review]
manage PDocAccessible with PBrowser instead of PContent

>     if (IPCAccessibilityActive()) {
>       DocAccessibleChild* ipcDoc = new DocAccessibleChild(docAcc);
>       docAcc->SetIPCDoc(ipcDoc);
>-    auto contentChild = dom::ContentChild::GetSingleton();
>-    contentChild->SendPDocAccessibleConstructor(ipcDoc, nullptr, 0);
>+      nsCOMPtr<nsITabChild> tabChild =
>+        do_GetInterface(aDocument->GetDocShell());
I would add a null check here, just in case document is about to die, it might not have docshell, or docshell
might not have owner anymore or something

>       ipcDoc = new DocAccessibleChild(childDoc);
>       childDoc->SetIPCDoc(ipcDoc);
>-      auto contentChild = dom::ContentChild::GetSingleton();
>-      contentChild->SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id);
>+      nsCOMPtr<nsITabChild> tabChild =
>+        do_GetInterface(mDocument->DocumentNode()->GetDocShell());
ditto
Attachment #8608895 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] from comment #2)
> Comment on attachment 8608895 [details] [diff] [review]
> manage PDocAccessible with PBrowser instead of PContent
> 
> >     if (IPCAccessibilityActive()) {
> >       DocAccessibleChild* ipcDoc = new DocAccessibleChild(docAcc);
> >       docAcc->SetIPCDoc(ipcDoc);
> >-    auto contentChild = dom::ContentChild::GetSingleton();
> >-    contentChild->SendPDocAccessibleConstructor(ipcDoc, nullptr, 0);
> >+      nsCOMPtr<nsITabChild> tabChild =
> >+        do_GetInterface(aDocument->GetDocShell());
> I would add a null check here, just in case document is about to die, it
> might not have docshell, or docshell
> might not have owner anymore or something

So, my first reaction to that happening is that its a bug and it should never happen, but I'm willing to consider test cases of course.  I suspect if it is actually possible we shouldn't fix it here, if the document is about to die we shouldn't create a DocAccessible so we shouldn't even get to creating an ipc actor for it.  I'm not really sure there is any reasonable way to handle failure when you get to this point.

> >       ipcDoc = new DocAccessibleChild(childDoc);
> >       childDoc->SetIPCDoc(ipcDoc);
> >-      auto contentChild = dom::ContentChild::GetSingleton();
> >-      contentChild->SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id);
> >+      nsCOMPtr<nsITabChild> tabChild =
> >+        do_GetInterface(mDocument->DocumentNode()->GetDocShell());
> ditto

more or less the same case.
https://hg.mozilla.org/mozilla-central/rev/76fdd1a7e61d
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: