Closed Bug 844023 Opened 7 years ago Closed 6 years ago

group info might not be properly updated when flat trees mutate

Categories

(Core :: Disability Access APIs, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: surkov, Assigned: jwei)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

spun off bug 527461 comment #28.

<div role="tree">
  <div role="treeitem"></div>
  <div role="group">
    <div role="treeitem"></div>
  </div>
</div>

1) receive group position for second item
2) remove first item

a) level of second item is not updated (still 2)
b) if you get node_child_of on second item then we crash
Jonathan, this one may be quite interesting. Probably you will have some ideas.
When an Accessible is added to or removed from the accessible tree, we invalidate the GroupInfo of all its parent's children recursively.  If the GroupInfo of an Accessible we want to access is invalidated, we recalculate the set size and its position in set upon access.
Assignee: nobody → jwei
Attachment #8368347 - Flags: review?(trev.saunders)
Summary: group info might be not properly updated when when flat trees mutates → group info might not be properly updated when flat trees mutate
Cleaned up a bit of code.  Also re-excluded a state flag in this patch that was causing a hang in some AccessFu test suites added recently.
Attachment #8368347 - Attachment is obsolete: true
Attachment #8368347 - Flags: review?(trev.saunders)
Attachment #8387783 - Flags: review?(trev.saunders)
Trev, ping
Comment on attachment 8387783 [details] [diff] [review]
Invalidate group info and refresh when necessary v2

> AccGroupInfo::AccGroupInfo(Accessible* aItem, role aRole) :
>-  mPosInSet(0), mSetSize(0), mParent(nullptr)
>+  mPosInSet(0), mSetSize(0), mParent(nullptr), mSelf(aItem), mRole(aRole)

mItem might be clearer than mSelf

>+Accessible::SetDirtyGroupInfo(bool aIsDirty)

might as well inline it

btw I'm not sure this is better than nulling out mGroupInfo but whatever we have the bits and maybe its a win.

>+Accessible::InvalidateChildrenGroupInfo()
>+{
>+  uint32_t length = mChildren.Length();
>+  for (uint32_t i = 0; i < length; i++) {
>+    Accessible* child = mChildren[i];
>+    child->SetDirtyGroupInfo(true);
>+    child->InvalidateChildrenGroupInfo();

I'm not sure this realy needs to be recursive

>+   */
>+  bool HasDirtyGroupInfo() const { return mStateFlags & eGroupInfoDirty; }

might as well inline it too
Attachment #8387783 - Flags: review?(trev.saunders) → review+
https://hg.mozilla.org/mozilla-central/rev/23b83cff50a4
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.