Open Bug 1103899 Opened 10 years ago Updated 2 years ago

Don't create Accessibles for documents with inactive docShells (background tabs)

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

People

(Reporter: ttaubert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

CreateDocOrRootAccessible() determines whether a document is active by calling nsIDocument::IsActive() which will return true even for documents sitting in the bfcache. That doesn't seem to be what we want?

Shouldn't we get the document's docShell and ask that whether it is active? That would also exclude accessibles from being created for background tabs, including the preloaded tab. It doesn't seem useful to have those background documents show up in screen readers?

Marco says in bug 1077652 that lazily-restored tabs do not seem to cause problems and they are about:blank documents until we switch to those.
This prevents creating Accessibles for documents with inactive docShells. It breaks a few tests though because they wait for a11y events from background tabs.

https://tbpl.mozilla.org/?tree=Try&rev=dab87e6f3ec9
No longer blocks: 1077652
Depends on: 1077652
Also cc'ing Davidb and Surkov.
We should also think about switching to document->IsCurrentActiveDocument():

http://mxr.mozilla.org/mozilla-central/source/dom/base/nsIDocument.h#1781
(In reply to Tim Taubert [:ttaubert] from comment #0)

> Shouldn't we get the document's docShell and ask that whether it is active?
> That would also exclude accessibles from being created for background tabs,
> including the preloaded tab. It doesn't seem useful to have those background
> documents show up in screen readers?

iirc that's the whole point to keep background tab documents accessible. Say, for example, you have a chat open in background tab and somebody pings you, AT wants to know about the change.
(In reply to alexander :surkov from comment #4)
> > That would also exclude accessibles from being created for background tabs,
> > including the preloaded tab. It doesn't seem useful to have those background
> > documents show up in screen readers?
> Say, for example, you have a chat open in background tab and somebody pings
> you, AT wants to know about the change.
At least for now, it's not that we want to report activity in background tabs. It's more that we need to keep our own representation of the page up to date. Also, we need the document accessible to be the same when we return so we know it's the same document in order to maintain the user's reading position, etc.

It's worth noting that we don't need accessibles for background tab documents if they have never been focused yet; i.e. preloaded but not yet brought into the foreground. I'm not sure if Firefox currently creates accessibles in this case or not.
(In reply to James Teh [:Jamie] from comment #5)
> (In reply to alexander :surkov from comment #4)
> > > That would also exclude accessibles from being created for background tabs,
> > > including the preloaded tab. It doesn't seem useful to have those background
> > > documents show up in screen readers?
> > Say, for example, you have a chat open in background tab and somebody pings
> > you, AT wants to know about the change.
> At least for now, it's not that we want to report activity in background
> tabs. It's more that we need to keep our own representation of the page up
> to date. Also, we need the document accessible to be the same when we return
> so we know it's the same document in order to maintain the user's reading
> position, etc.
> 
> It's worth noting that we don't need accessibles for background tab
> documents if they have never been focused yet; i.e. preloaded but not yet
> brought into the foreground. I'm not sure if Firefox currently creates
> accessibles in this case or not.

I think Tim's suggestion works the way you need, and that be good for memory. I'm just not clear whether you don't want not-ever-focused background docs accessible at all or is that something you don't currently support. Say, if you have irc chat web app in the pinned tab, you never switched to it but if somebody pinged you then AT tells you that (listening to live region update for example). Is the point that you don't want to have more data than sighted users do?
(In reply to alexander :surkov from comment #6)
> I think Tim's suggestion works the way you need, and that be good for
> memory.
I don't follow. I thought this suggestion would mean we no longer get accessibles for background tabs at all.

> I'm just not clear whether you don't want not-ever-focused
> background docs accessible at all or is that something you don't currently
> support.
I'm saying we don't need it right now. I also can't see a good use case for it. If a sighted user doesn't see such updates, nor should a screen reader user.
(In reply to James Teh [:Jamie] from comment #7)
> (In reply to alexander :surkov from comment #6)
> > I think Tim's suggestion works the way you need, and that be good for
> > memory.
> I don't follow. I thought this suggestion would mean we no longer get
> accessibles for background tabs at all.

perhaps it sounded this way but Tim suggested to not created accessible for background document but he didn't suggested to destroy accessible documents when they come into background if I read him right.

> > I'm just not clear whether you don't want not-ever-focused
> > background docs accessible at all or is that something you don't currently
> > support.
> I'm saying we don't need it right now. I also can't see a good use case for
> it. If a sighted user doesn't see such updates, nor should a screen reader
> user.

I see, do you know what other browsers do?
(In reply to alexander :surkov from comment #8)
> (In reply to James Teh [:Jamie] from comment #7)
> > (In reply to alexander :surkov from comment #6)
> > > I think Tim's suggestion works the way you need, and that be good for
> > > memory.
> > I don't follow. I thought this suggestion would mean we no longer get
> > accessibles for background tabs at all.
> 
> perhaps it sounded this way but Tim suggested to not created accessible for
> background document but he didn't suggested to destroy accessible documents
> when they come into background if I read him right.

that wasn't how I read it, but I didn't think it was very clear either.

> > I'm just not clear whether you don't want not-ever-focused
> > background docs accessible at all or is that something you don't currently
> > support.
> I'm saying we don't need it right now. I also can't see a good use case for
> it. If a sighted user doesn't see such updates, nor should a screen reader
> user.

I think it depends what sort of UI you want.  If you want something that is strictly a screen reader I agree there isn't much use.  However I don't see any reason to make it impossible for someone to makes a screen reader like thing that reads back ground tab updates for say the message client example.  Of course there are also totally different clients than screen readers that want to do who knows what.
so is it rather wontfix?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: