Bug 1797221 Comment 0 Edit History

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

Consider the following code, which you can paste into some file in accessible/tests/browser/e10s/, like `browser_treeupdate_imagemap.js`:

```js
// Verify that the alt text changes correctly.
const IMG_ID = "img-id";
const ALT_TEXT = "some-alt-text";
addAccessibleTask(
  `<img id="${IMG_ID}" src="${MOCHITESTS_DIR}/moz.png" alt="${ALT_TEXT}"/>`,
  async function (browser, accDoc) {
    // Test initial state; the img has alt text.
    const acc = findAccessibleChildByID(accDoc, IMG_ID);
    let tree = {
      role: ROLE_GRAPHIC, name: ALT_TEXT, children: [],
    };
    testAccessibleTree(acc, tree);

    // Set the alt text to the empty string.
    // WARNING: This will fail with the cache enabled!
    await invokeSetAttribute(browser, IMG_ID, "alt", "");
    tree = {
      role: ROLE_GRAPHIC, name: "", children: [],
    };
    testAccessibleTree(acc, tree);
  },
  { iframe: true, remoteIframe: true }
);
```

When running the test with the cache enabled (pref flipped on), we get the following failures (trimmed for clarity):
```
accessible/tests/browser/e10s/browser_treeupdate_imagemap.js
  FAIL Wrong value of property 'name' for [DOM node id: img-id, role: graphic, name: 'some-alt-text', address: [xpconnect wrapped nsIAccessible]]. - Got "some-alt-text", expected ""
  FAIL Wrong value of property 'name' for [DOM node id: img-id, role: graphic, address: [xpconnect wrapped nsIAccessible]]. - Got null, expected ""
  FAIL Wrong value of property 'name' for [DOM node id: img-id, role: graphic, name: 'some-alt-text', address: [xpconnect wrapped nsIAccessible]]. - Got "some-alt-text", expected ""
```

Note that not all of the scenarios are the same failure. Without the cache enabled, these tests pass. Seems like something weird is happening with cache pushes here, but I haven't yet dug further.
Consider the following code, which you can paste into some file in accessible/tests/browser/e10s/, like `browser_treeupdate_imagemap.js`:

```js
// Verify that the alt text changes correctly.
const IMG_ID = "img-id";
const ALT_TEXT = "some-alt-text";
addAccessibleTask(
  `<img id="${IMG_ID}" src="${MOCHITESTS_DIR}/moz.png" alt="${ALT_TEXT}"/>`,
  async function (browser, accDoc) {
    // Test initial state; the img has alt text.
    const acc = findAccessibleChildByID(accDoc, IMG_ID);
    let tree = {
      role: ROLE_GRAPHIC, name: ALT_TEXT, children: [],
    };
    testAccessibleTree(acc, tree);

    // Set the alt text to the empty string.
    // WARNING: This will fail with the cache enabled!
    await invokeSetAttribute(browser, IMG_ID, "alt", "");
    tree = {
      role: ROLE_GRAPHIC, name: "", children: [],
    };
    testAccessibleTree(acc, tree);
  },
  { iframe: true, remoteIframe: true }
);
```

When running the test with the cache enabled (pref flipped on), we get the following failures (trimmed for clarity):
```
accessible/tests/browser/e10s/browser_treeupdate_imagemap.js
  FAIL Wrong value of property 'name' for [DOM node id: img-id, role: graphic, name: 'some-alt-text', address: [xpconnect wrapped nsIAccessible]]. - Got "some-alt-text", expected ""
  FAIL Wrong value of property 'name' for [DOM node id: img-id, role: graphic, address: [xpconnect wrapped nsIAccessible]]. - Got null, expected ""
  FAIL Wrong value of property 'name' for [DOM node id: img-id, role: graphic, name: 'some-alt-text', address: [xpconnect wrapped nsIAccessible]]. - Got "some-alt-text", expected ""
```

I would expect that setting the `alt` attribute to the empty string would set the name to the empty string, but it doesn't.

Note that not all of the scenarios are the same failure. Without the cache enabled, these tests pass. Seems like something weird is happening with cache pushes here, but I haven't yet dug further.

Back to Bug 1797221 Comment 0