[Webkit-unassigned] [Bug 68142] AccessibilityRenderObject::previousSibling is not consistent with nextSibling

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 22 08:48:13 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=68142





--- Comment #2 from Dominic Mazzoni <dmazzoni at google.com>  2011-09-22 08:48:13 PST ---
(In reply to comment #1)
> do you think these errors where here before your changes and you just exposed them?
> 
> agreed severity is low, but it's odd they don't match up

Yes, I confirmed that this assertion would have failed before any of my recent patches. It's possible that these patches made things worse - i.e. it's possible that my patch to previousSibling wasn't correct - but it wasn't 100% correct before.

It actually makes me wonder whether it's worth having a previousSibling method at all. What if instead of having public nextSibling and previousSibling methods, we just compute and store the children of each AccessibilityRenderObject in addChildren?

Searching through the codebase, it looks like the almost all of the times nextSibling is called, it's actually just used to iterate over the children of a parent node - so we could replace that with a loop called on the parent node rather than a loop from the first child over its siblings.

The exception seems to be in GTK, where we need to expose a previousSibling method - but maybe it'd be okay to just replace that one with a slightly more cumbersome implementation (jump to parent, iterate over children to find the one prior to this node).

What do you think?

On the other hand, we can just fix previousSibling and this assertion will make sure it won't break again. :)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list