Closed Bug 1368103 Opened 7 years ago Closed 7 years ago

Accessibles in background tabs don't have offscreen state in e10s

Categories

(Core :: Disability Access APIs, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: eeejay, Assigned: eeejay)

References

Details

(Whiteboard: [aes?])

Attachments

(1 file, 1 obsolete file)

Before e10s, every accessible in a non-visible tab would have an offscreen state.
Assignee: nobody → eitan
Attachment #8871963 - Flags: review?(surkov.alexander)
Blocks: 1368182
Comment on attachment 8871963 [details] [diff] [review]
Use DOM doc visibilityState to determine if a tab is hidden. r?surkov

Review of attachment 8871963 [details] [diff] [review]:
-----------------------------------------------------------------

I trust you that IsHidden is an equivalent in this case but where it is defined?

::: accessible/generic/Accessible.cpp
@@ +345,5 @@
>        return 0;
>  
> +    // Offscreen state if the document's visibility state is not visible.
> +    if (!Document() || Document()->IsHidden())
> +      return states::OFFSCREEN;

no Document() check is required I believe, since no one should get here for shutdown accessible

::: accessible/generic/DocAccessible.h
@@ +138,5 @@
>    }
>  
> +  bool IsHidden() const
> +  {
> +    return !mDocumentNode || mDocumentNode->Hidden();

same here, you can safely skip !mDocumentNode check I think
Attachment #8871963 - Flags: review?(surkov.alexander) → review+
I am nervously removing those null-checks!
I needed to re-add the xul:tabpanel checks for cases where the tabs are not documents.
Otherwise test_visibility.xul fails. Having both checks will accomodate both cases.
Attachment #8873885 - Flags: review?(surkov.alexander)
Attachment #8871963 - Attachment is obsolete: true
(In reply to Eitan Isaacson [:eeejay] from comment #3)
> I am nervously removing those null-checks!

you never should get here, if they fail, then something very bad happened

(In reply to Eitan Isaacson [:eeejay] from comment #4)
> Created attachment 8873885 [details] [diff] [review]
> Use DOM doc visibilityState to determine if a tab is hidden. r?surkov
> 
> I needed to re-add the xul:tabpanel checks for cases where the tabs are not
> documents.
> Otherwise test_visibility.xul fails. Having both checks will accomodate both
> cases.

thanks we have a test, otherwise Marco would be surprised by not working prefs and other UI stuff I guess :)
Comment on attachment 8873885 [details] [diff] [review]
Use DOM doc visibilityState to determine if a tab is hidden. r?surkov

Review of attachment 8873885 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/generic/Accessible.cpp
@@ +345,5 @@
>        return 0;
>  
> +    // Offscreen state if the document's visibility state is not visible.
> +    if (Document()->IsHidden())
> +      return states::OFFSCREEN;

shouldn't we move this out the cycle? when Document::IsHidden() returns true? Is it always about background tab documents?
Attachment #8873885 - Flags: review?(surkov.alexander) → review+
(In reply to alexander :surkov from comment #6)
> Comment on attachment 8873885 [details] [diff] [review]
> Use DOM doc visibilityState to determine if a tab is hidden. r?surkov
> 
> Review of attachment 8873885 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: accessible/generic/Accessible.cpp
> @@ +345,5 @@
> >        return 0;
> >  
> > +    // Offscreen state if the document's visibility state is not visible.
> > +    if (Document()->IsHidden())
> > +      return states::OFFSCREEN;
> 
> shouldn't we move this out the cycle? when Document::IsHidden() returns
> true?

Good point!

> Is it always about background tab documents?

When the document is not visible (like if the window is minimized too). You can test it with document.visibilityState
Pushed by eisaacson@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6f99018495e7
Use DOM doc visibilityState to determine if a tab is hidden. r=surkov
https://hg.mozilla.org/mozilla-central/rev/6f99018495e7
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: