Closed Bug 1814800 Opened 2 years ago Closed 2 years ago

[CTW] Bounds incorrect for scrolled position: fixed/sticky elements which don't get an Accessible; e.g. display: flex

Categories

(Core :: Disability Access APIs, defect)

Firefox 111
defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: nlapre, Assigned: Jamie)

References

Details

(Whiteboard: [ctw-m5])

Attachments

(1 file)

STR:

  1. Load the following page:
data:text/html,<div style="display:flex; bottom:0px; right:0px; position:fixed;"><button>testing</button></div><script> for (let i = 0; i < 1000; ++i) { const div = document.createElement("div"); div.innerHTML = `<button>${i}</button>`; document.body.append(div); } </script>
  1. Examine the bounds of the "testing" button's accessible.
  2. Scroll down the page to the bottom.
  3. Re-examine the bounds of the same button, as in step 2.

Expected results: The bounds in step 4 are the same as in step 2.
Actual results: The y-coordinate of the bounds in step 4 is very negative.

This is the simplified version of the twitter "Don’t miss what’s happening" bottom bar that appears when you're not signed in. I suspect it also explains what is going on in Bug 1814299, but need to confirm.

Note that I tested this on a version of Nightly (and a developer build, to be sure) that included the fix from Bug 1809836. It seems like display: flex adds another layer of complication here.

ARRRRRGGGGHHH!

This occurs because the div with display: flex doesn't get an Accessible. If you give it an id or a role, it gets an Accessible and the problem magically goes away.

We're going to need something similar to bug 1806356 (transforms) but for position: fixed.

Severity: -- → S3

We'll need to get bug 1806356 finished before we try to properly patch this. Otherwise, we will almost certainly end up with annoying merge conflicts.

Depends on: 1806356

I've written a browser test for this, so I'll finish the patch once I'm unblocked.

Assignee: nobody → jteh

We need to know about position: fixed in the parent process a11y cache, so we always need an Accessible for such elements.
Previously, we calculated bounds incorrectly if a position: fixed element wasn't included in the a11y tree.

We'll likely also need to deal with this for position: sticky.

See Also: → 1815153
Summary: [CTW] Bounds incorrect for scrolled position: fixed elements with display: flex → [CTW] Bounds incorrect for scrolled position: fixed/sticky elements which don't get an Accessible; e.g. display: flex
Attachment #9316046 - Attachment description: Bug 1814800 WIP: Force Accessible creation if an element has position: fixed. → Bug 1814800 WIP: Force Accessible creation if an element has position: fixed/sticky.
Blocks: 1814299
See Also: 1814299
Attachment #9316046 - Attachment description: Bug 1814800 WIP: Force Accessible creation if an element has position: fixed/sticky. → Bug 1814800: Force Accessible creation if an element has position: fixed/sticky.
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/24887c751247
Force Accessible creation if an element has position: fixed/sticky. r=nlapre
Blocks: 1815822
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Blocks: 1816346
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: