Please see Bug 345759 comment #16 for details In nsHypertextAccessilbe, we need GetEditor to check EDITABLE_STATE or get spellcheck selections.
I plan to implement a GetEditorInChain() method in nsHyperTextAccessible. It will get nsDocAccessibleWrap from parent chain, and get editor from nsDocAccessibleWrap. But how can we separate form control and descendant hypertext accessible? We have nsXULTextFieldAccessible, nsHTMLTextFieldAccessible, nsXFormsEditableAccessible, implement GetEditor(), we don't want get editor from ancestor doc accessible for them.
Er, I think we can just use the virtual function, use polymorphism.
Created attachment 270157 [details] [diff] [review] patch I got a lot of problems to solve if I overwrite GetEditor to get a editor from ancestor. So I add GetEditorInChain() rather than overwrite it. Some GetState() need to be revised, e.g. nsHTMLLIAccessible::GetState I'm NOT going to cover them in this bug.
(In reply to comment #3) > Created an attachment (id=270157) [details] > patch > > I got a lot of problems to solve if I overwrite GetEditor to get a editor from > ancestor. What kind of problem? Also why do you traverse to document, why you can't to get document and check if it's editable?
If I overwrite GetEditor, in some cases, GetParent returns weird result, parent obj is same to child obj. I think GetDocument tends to get the top document, but I want to get the nearest document. e.g. MIDAS demo page, the whole document is not editable, but the rich edit area is editable, and I need that editor to do some work.
Actually I think after bug 237964, an editor can be associated with any parent node.
By the way, GetDocument gets the nearest document, but because of bug 237964 you probably want to go up the parent chain looking for the document. Take a look at their API.
What's the different between get nearest document and looking for the document in parent chain?
There is no difference, but that's not what I'm suggesting. I'm saying that after bug 237964 it might not be a document that has an editor. Any node can. So you have to go up parent chain and check every node for document.
Comment on attachment 270157 [details] [diff] [review] patch cancelling request until point about bug 237964 is clear.
I *think* the solution in bug 390767 does what we need, ad is simpler. This bug should become resolved through that. Perhaps it's a duplicate.
Depends on: 390767
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 390767
You need to log in before you can comment on or make changes to this bug.