Closed Bug 1809761 Opened 2 years ago Closed 2 years ago

[CTW] Incorrect text bounds when interleaving block- and inline-frame accessibles

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: morgan, Assigned: morgan)

References

Details

Attachments

(1 file)

Summary of potentially-relevant matrix discussion:

  • The frame tree for the example below has a one block frame root with a unique inline frame parent for each text leaf (the code element becomes several frames)
  • The accessible we generate for the code element has only one frame (the primary frame, whatever that is)
  • We use TransformRect to compute the offset between subtree-spanning continuations -- transforming the continuation to the hypertext's frame. The hypertext's frame (in this instance) is not necessarily an ancestor of the continuation's frame, since the primary frame for the code element is only the parent to one (the first?) text leaf.

Here's a test case:


/**
 * Test character bounds in an intervening inline element with non-br line breaks
 */
addAccessibleTask(
  `
  <style>
    @font-face {
      font-family: Ahem;
      src: url(${CURRENT_CONTENT_DIR}e10s/fonts/Ahem.sjs);
    }
    pre {
      font: 20px/20px Ahem;
    }
  </style>
  <pre><code id="t" role="group">XX
XXX
XX
X</pre>`,
  async function(browser, docAcc) {
    await testChar(docAcc, browser, "t", 0);
    await testChar(docAcc, browser, "t", 3);
    await testChar(docAcc, browser, "t", 7);
    await testChar(docAcc, browser, "t", 10);
  },
  {
    chrome: true,
    topLevel: !isWinNoCache,
    iframe: !isWinNoCache,
  }
);
Severity: -- → S3

I'm wondering whether we can fix this by calling TransformRect with the continuation frame and the primary text frame rather than the ancestor frame. That is:

// ... No need for nearestAccAncestorFrame
if (prevTextFrame->GetParent() != currTextFrame->GetParent()) {
  contRect = frameRect;
  nsLayoutUtils::TransformRect(currTextFrame, frame, contRect);
}

As with bug 1809695, this is broken in the parent process (LocalAccessible) as well. I think we may have a JS test harness bug here rather than a C++ bounds bug.

Depends on: 1809695
Assignee: nobody → mreschenberg
Status: NEW → ASSIGNED

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:morgan, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(mreschenberg)
Flags: needinfo?(jteh)
Flags: needinfo?(jteh)
Flags: needinfo?(mreschenberg)
Pushed by mreschenberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8ab29a76ed86
Introduce text bounds test for interleaving block- and inline-frame accessibles r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: