Bug 1822340 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Morgan, I'm trying to write a text bounds test for this. However, even when I test this in the parent process (where we know this works), the y coordinate is wrong even for offset 0 which doesn't wrap. Here's the test (added to the bottom of browser_caching_text_bounds.js):

```
/**
 * Test wrapping text.
 */
addAccessibleTask(
  `
<p id="wrappingText" style="width: 3ch; font-family: monospace;">
  <a href="https://example.com/">a</a>b cd
</p>
  `,
  async function(browser, docAcc) {
    await testChar(docAcc, browser, "wrappingText", 0);
    await testChar(docAcc, browser, "wrappingText", 1);
    await testChar(docAcc, browser, "wrappingText", 2);
    await testChar(docAcc, browser, "wrappingText", 3);
  },
  { chrome: true }
);
```

Any idea what's going on here? I think this might be a bug in testTextRange, but I can't figure out what's wrong at present.

I did notice [this](https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/accessible/tests/browser/e10s/browser_caching_text_bounds.js#102):

> We use getBoundsInCSSPixels to avoid factoring in the DPR ourselves.

I'm confused by this. I think testTextPos and testTextBounds use CharBounds()/TextBounds(), which I don't think use CSS pixels? That said, I guess this probably doesn't make a difference except with DPI scaling, and it also doesn't explain why all the other tests work just fine.
Morgan, I'm trying to write a text bounds test for this. However, even when I test this in the parent process (where we know this works), the y coordinate is wrong even for offset 0 which doesn't wrap. Here's the test (added to the bottom of browser_caching_text_bounds.js):

```
/**
 * Test wrapping text.
 */
addAccessibleTask(
  `
<p id="wrappingText" style="width: 3ch; font-family: monospace;">
  <a href="https://example.com/">a</a>b cd
</p>
  `,
  async function(browser, docAcc) {
    await testChar(docAcc, browser, "wrappingText", 0);
    await testChar(docAcc, browser, "wrappingText", 1);
    await testChar(docAcc, browser, "wrappingText", 2);
    await testChar(docAcc, browser, "wrappingText", 3);
  },
  { chrome: true, topLevel: false }
);
```

Any idea what's going on here? I think this might be a bug in testTextRange, but I can't figure out what's wrong at present.

I did notice [this](https://searchfox.org/mozilla-central/rev/3c3ad00ab7f587e2c75e8cebb89badc4e946b10e/accessible/tests/browser/e10s/browser_caching_text_bounds.js#102):

> We use getBoundsInCSSPixels to avoid factoring in the DPR ourselves.

I'm confused by this. I think testTextPos and testTextBounds use CharBounds()/TextBounds(), which I don't think use CSS pixels? That said, I guess this probably doesn't make a difference except with DPI scaling, and it also doesn't explain why all the other tests work just fine.

Back to Bug 1822340 Comment 5