gecko-dev/accessible
L. David Baron 7e9c9d9319 Bug 1474771 - Adjust accessibility test_list.html to deal with frames having NS_FRAME_IS_DIRTY more often. r=Jamie
`NS_FRAME_IS_DIRTY` being set on a frame has always meant that that
frame and all of its descendants need to be reflowed.  What the main
patch on this bug is changing is when it gets propagated to descendants;
prior to that patch it gets propagated during reflow, whereas after the
patch it gets propagated when the bit is set.  This means that
`NS_FRAME_IS_DIRTY` is now (after the patch) a somewhat more reliable
indicator of whether a frame requires reflow than it was before.

However, this has a strange interaction with the particular sequence of
operations that test_list.html performs.  In particular, test_list.html:
 (1) makes a style change that requires reflow,
 (2) flushes style (but not layout), and
 (3) gets the name of an accessible whose layout was dirtied by the style change.

Getting this name ends up here:
```
nsTextFrame::GetRenderedText at layout/generic/nsTextFrame.cpp:9600
nsTextEquivUtils::AppendTextEquivFromTextContent at accessible/base/nsTextEquivUtils.cpp:127
nsTextEquivUtils::AppendFromAccessible at accessible/base/nsTextEquivUtils.cpp:174
nsTextEquivUtils::AppendFromAccessibleChildren at accessible/base/nsTextEquivUtils.cpp:162
nsTextEquivUtils::GetNameFromSubtree at accessible/base/nsTextEquivUtils.cpp:39
mozilla::a11y::Accessible::NativeName at accessible/generic/Accessible.cpp:1991
mozilla::a11y::HyperTextAccessible::NativeName at accessible/generic/HyperTextAccessible.cpp:1760
mozilla::a11y::Accessible::Name at accessible/generic/Accessible.cpp:149
mozilla::a11y::xpcAccessible::GetName at accessible/xpcom/xpcAccessible.cpp:245
NS_InvokeByIndex at xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S:106
```

What the main patch in the bug has changed is whether this `nsTextFrame`
has the `NS_FRAME_IS_DIRTY` bit set at this point.  This means that
`GetRenderedText` will bail out without reporting the text, because the
frame is marked dirty.

On the assumption that this action -- getting accessible names while
frames are dirty -- is an artificial situation set up in the test and
not a real-world situation that we need to care about, I'm proposing
that we make the straightforward adjustment to the test:  flush layout
in addition to flushing style at step (2) above, so that the test works
again.  As long as that assumption is correct, I think this should be
fine.  (I'd note that this is the *only* test that breaks as a result of
the patch.)

If, on the other hand, we actually do care about what accessible names
return while layout state is dirty and reflow is needed, we should
probably improve `nsTextFrame::GetRenderedText` so that it can somehow
report useful state even when `NS_FRAME_IS_DIRTY` is set, or something
else more complicated.

Differential Revision: https://phabricator.services.mozilla.com/D36423

--HG--
extra : moz-landing-system : lando
2019-07-03 05:30:30 +00:00
..
android Bug 1557793 part 2. Stop using [array] in nsIStringBundle. r=Pike 2019-06-11 15:51:51 +00:00
aom Bug 1523969 part 1 - Move method definition inline comments to new line in accessible/. r=jamie 2019-02-25 16:02:26 -06:00
atk Bug 1446699 - Fix ATK mapping for EVENT_TEXT_SELECTION_CHANGED r=Jamie 2019-06-12 04:01:51 +00:00
base Bug 1562876: rename `Selection::AddRange` to `Selection::AddRangeAndSelectFramesAndNotifyListeners`. r=smaug 2019-07-03 13:26:13 +02:00
generic Bug 1562876: rename `Selection::RemoveRange` to `Selection::RemoveRangeAndUnselectFramesAndNotifyListeners`. r=smaug 2019-07-03 13:26:14 +02:00
html Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan 2019-05-25 17:46:15 +00:00
interfaces Bug 1552795 - Remove all trailing whitespaces in idl files r=Ehsan 2019-05-22 22:37:14 +00:00
ipc Bug 1533888 - Check DocAccessibleParents are alive in RecvBatch. r=yzen 2019-06-29 04:06:26 +00:00
jsat Bug 1557793 part 2. Stop using [array] in nsIStringBundle. r=Pike 2019-06-11 15:51:51 +00:00
mac Bug 1543013 - part 2: Make accessible use mozilla::PresShell directly rather than via nsIPresShell r=Jamie 2019-04-13 12:13:15 +00:00
other Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
tests Bug 1474771 - Adjust accessibility test_list.html to deal with frames having NS_FRAME_IS_DIRTY more often. r=Jamie 2019-07-03 05:30:30 +00:00
windows Bug 1553706: Fix IAccessible::accChild in the parent process for out-of-process iframes. r=eeejay 2019-06-03 06:03:10 +00:00
xpcom Bug 1559975 - Make directories python3 compatible r=catlee 2019-07-02 15:47:34 +00:00
xul Bug 1555060 Convert <tabs> to a custom element 2019-06-20 14:09:37 -07:00
moz.build Bug 1479033 - Introduce Android accessibility directory. r=Jamie 2018-09-18 10:43:18 -07:00