Open
Bug 285167
Opened 20 years ago
Updated 2 years ago
Mozilla doesn't support Scrollbar accessible
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
REOPENED
People
(Reporter: Louie.Zhao, Unassigned)
References
Details
Attachments
(1 file, 2 obsolete files)
|
39.01 KB,
patch
|
MarcoZ
:
review+
davidb
:
review+
enndeakin
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
AT-Tools, e.g. GOK, need scrollbar accessible to scroll the webpage in case that the page is too long. Mozilla needs to export accessible for scrollbar elements.
*** Bug 285168 has been marked as a duplicate of this bug. ***
| Reporter | ||
Updated•20 years ago
|
| Reporter | ||
Comment 2•20 years ago
|
||
Comment on attachment 176723 [details] [diff] [review] patch v1 >Index: public/nsIAccessibilityService.idl >+ nsIAccessible createXULScrollbarAccessible(in nsIDOMNode aNode, in boolean aVertical); >Index: src/atk/nsXULFormControlAccessibleWrap.cpp this is not the traditional style for initializers in mozilla code, it also almost certainly doesn't fit in 80 cols: >+nsXULScrollbarAccessibleWrap::nsXULScrollbarAccessibleWrap(nsIDOMNode* aNode, nsIWeakReference* aShell, PRBool aVertical): >+nsXULScrollbarAccessible(aNode, aShell, aVertical) >+{ >+} >Index: src/base/nsAccessibilityService.cpp >+NS_IMETHODIMP nsAccessibilityService::CreateXULScrollbarAccessible(nsIDOMNode *aNode, PRBool aVertical, nsIAccessible **_retval) >+{ >+#ifdef MOZ_XUL >+ nsCOMPtr<nsIDocument> document(do_QueryInterface(aNode)); >+ if (!document) >+ return NS_ERROR_FAILURE; >+ >+ nsIPresShell *presShell = document->GetShellAt(0); >+ nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(presShell)); >+ >+ *_retval = new nsXULScrollbarAccessibleWrap(aNode, weakShell, aVertical); >+ if (! *_retval) >+ return NS_ERROR_OUT_OF_MEMORY; >+ >+ NS_ADDREF(*_retval); >+#else >+ *_retval = nsnull; why don't you return NS_ERROR_NOT_AVAILABLE or NS_ERROR_NOT_IMPLEMENTED? >+#endif // MOZ_XUL >+ return NS_OK; >+} >Index: src/base/nsDocAccessible.cpp >+/** >+ * Our next sibling is an vertical nsScrollbarAccessible object >+ */ is _a vertical_ (because 'ver' is not a vowel sound) normal mozilla style for /* is: /** * ... */ (although it seems accessible doesn't follow that style, =() >+NS_IMETHODIMP nsDocAccessible::GetNextSibling(nsIAccessible **aNextSibling) >+{ >+ *aNextSibling = nsnull; >+ >+ if (mNextSibling) { >+ if (mNextSibling != DEAD_END_ACCESSIBLE) >+ *aNextSibling = mNextSibling; i'd suggest an early return here - the assignment line would be NS_ADDREF(*aNextSibling = mNextSibling); >+ } so that you don't have to indent this code block: >+ else { >+ nsCOMPtr<nsIAccessibilityService> accService = do_GetService("@mozilla.org/accessibilityService;1"); >+ if (!accService) >+ return NS_ERROR_FAILURE; >+ >+ nsresult rv = accService->CreateXULScrollbarAccessible(mDOMNode, PR_TRUE, aNextSibling); why bother checking NS_FAILED(rv) ? >+ if (NS_FAILED(rv) || !*aNextSibling) isn't it sufficient to null check *aNextSibling? >+ return rv; ... >+ } >+ which would mean this code section could use NS_ADDREF: >+ NS_IF_ADDREF(*aNextSibling); >+ return NS_OK; >+} >Index: src/xul/nsXULFormControlAccessible.cpp >@@ -661,6 +665,202 @@ NS_IMETHODIMP nsXULTextFieldAccessible:: > *aState |= STATE_FOCUSED; > } > return rv; > } > >+/** >+ * XUL Scrollbar >+ * nsXULScrollbarAccessible has no its own corresponding DOM node. ... does not have its own ... this isn't accurate anyway, and you should have a bug reference >+ * Creating nsXULScrollbarAccessible with the document and use >+ * |this| pointer as the unique Id are unique id's 64bits large? >+ */ >+nsXULScrollbarAccessible::nsXULScrollbarAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell, PRBool aVertical): >+nsLeafAccessible(aNode, aShell) >+{ >+ // Indicate the orientation >+ mVertical = aVertical; >+} >+ >+NS_IMETHODIMP nsXULScrollbarAccessible::GetName(nsAString& aName) >+{ >+ // Don't need name for nsXULScrollbarAccessible don't need? it would be 'a name', but i don't like the comment. >+ aName.Truncate(); >+ return NS_OK; >+} >+NS_IMETHODIMP nsXULScrollbarAccessible::GetState(PRUint32 *_retval) >+{ >+ return nsAccessible::GetState(_retval); >+} >+ >+ why the extra line ^ ? >+NS_IMETHODIMP nsXULScrollbarAccessible::GetExtState(PRUint32 *_retval) >+NS_IMETHODIMP nsXULScrollbarAccessible::GetValue(nsAString& _retval) >+{ >+ // TODO: no bug number for followup work? >+ return NS_ERROR_NOT_IMPLEMENTED; >+} >+NS_IMETHODIMP nsXULScrollbarAccessible::GetNextSibling(nsIAccessible **aNextSibling) see previous comments >+void nsXULScrollbarAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aBoundingFrame) >+{ >+ // TODO bug#? note that the syntax for this todo doesn't match the previous one. >+ return; >+// Get the value from nsRect directly instead of converting to pixel pixel_s_ ? but... converting *what*? >+ return (*aMaximum < *aCurValue) ? NS_ERROR_FAILURE:NS_OK; spaces around : ? >+ // XXX: better way to get scrollable frame ? is there a ... >+ frame = frame->GetFirstChild(nsnull); >+ scrollFrame = do_QueryInterface(frame); >+ } >+ return scrollFrame; >+} >+ ^ please don't add trailing whitespace >+PRBool nsXULScrollbarAccessible::IsVisible() ... >+ if (mVertical) >+ return isVerticalVisible; drop this else after return: >+ else >+ return isHorizontalVisible; >+} >Index: src/xul/nsXULFormControlAccessible.h
Blocks: fox2access
Comment 4•19 years ago
|
||
I wonder if we shouldn't just be creating an accessible for /toolkit/content/widgets/nativescrollbar.xml /toolkit/content/widgets/scrollbar.xml via nsIAccessibleProvider.
Comment 5•19 years ago
|
||
Also, Ginn -- do you think we should hold up the new-atk work for this bug? I'm not sure if we must really have it for Firefox 2. What's your thought?
Scrollbar code changed a lot. I'm porting the old patch to trunk. Work in progress. I think it doesn't have conflicts with new-atk. Also I don't want this patch wait for another year. We may need to port it again.
To do: 1) With this patch, it always creates scrollbars no matter they're visible or not. We'd better create them dynamicly. 2) Do we need GetBoundsRect? I've no idea how to get ScrollableFrame.
Attachment #176723 -
Attachment is obsolete: true
Comment 8•19 years ago
|
||
(In reply to comment #7) > 2) Do we need GetBoundsRect? Can't we inherit that from nsAccessible? > I've no idea how to get ScrollableFrame. You should be able to get it from the doc accessible's frame: 201 nsIScrollableFrame *scrollFrame = nsnull; 202 CallQueryInterface(frame, &scrollFrame);
*** Bug 340482 has been marked as a duplicate of this bug. ***
Updated•18 years ago
|
Updated•18 years ago
|
Comment 10•17 years ago
|
||
See also bug 109215 about making slider accessible (scrollbars have sliders underneath).
Comment 11•17 years ago
|
||
mac scrollbar http://developer.apple.com/documentation/Accessibility/Conceptual/AccessibilityMacOSX/OSXAXRoleReference/chapter_7_section_30.html#//apple_ref/doc/uid/TP40001078-CH211-DontLinkElementID_34 msaa scollbar http://msdn2.microsoft.com/en-us/library/ms697649.aspx
Comment 12•17 years ago
|
||
Bug 109215 for sliders has been fixed. Does that make this any easier?
Comment 13•17 years ago
|
||
(In reply to comment #12) > Bug 109215 for sliders has been fixed. Does that make this any easier? > It wasn't fixed actually because I roll backed patch due to tree has been closed. Yes it makes easier. All we need is to fix scrollbar.xml to implement nsIAccessibleProvider and to make accessible an anonymous content for scrollbars.
Comment 14•16 years ago
|
||
Assignee: ginn.chen → surkov.alexander
Attachment #222020 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #374255 -
Flags: review?(marco.zehe)
Updated•16 years ago
|
Attachment #374255 -
Flags: superreview?(neil)
Attachment #374255 -
Flags: review?(david.bolter)
Updated•16 years ago
|
Attachment #374255 -
Flags: review?(enndeakin)
Comment 15•16 years ago
|
||
Comment on attachment 374255 [details] [diff] [review] patch3 >+ if (prop == "role") { > is(roleToString(acc[prop]), roleToString(aAccTree[prop]), msg); >- else if (prop != "children") >+ >+ } else if (prop == "states") { What does that empty line and the braces around that single-line block mean? Did you intend to add something else, or is this an unfinished edit? >+ * Return stucture describing subtree of scrollbar Nit: "structure", a missing r.
Attachment #374255 -
Flags: review?(marco.zehe) → review+
Comment 16•16 years ago
|
||
(In reply to comment #15) > What does that empty line and the braces around that single-line block mean? > Did you intend to add something else, or is this an unfinished edit? I did this for readability. There "else if" block here containing multiple lines therefore I decided to wrap other blocks by braces also.
Comment 17•16 years ago
|
||
Note: this is the last bug blocking Bug 263575 - [meta] track porting accessibility fixes from Sun Mozilla 1.7 and bug's reporter address (same as this bug) is dead. So please close Bug 263575 when this bug is fixed.
Comment 18•16 years ago
|
||
Comment on attachment 374255 [details] [diff] [review] patch3 Looks fine to me (despite the slightly odd output from hg diff) although I don't see the point of the uuid change.
Attachment #374255 -
Flags: superreview?(neil) → superreview+
Comment 19•16 years ago
|
||
Comment on attachment 374255 [details] [diff] [review] patch3 https://bugzilla.mozilla.org/show_bug.cgi?id=285167> case nsIAccessibleProvider::XULScale: >+ *aAccessible = new nsEnumRoleXBLAccessible(aNode, weakShell, >+ nsIAccessibleRole::ROLE_GROUPING); I still find the mapping of XULScale to ROLE_GROUPING odd, but it works. r=me (if you can resolve Neil's uuid concern) Alexander, I'm not sure I love the method names matching "nsEnumRole*"... but we can IRC on that :)
Attachment #374255 -
Flags: review?(david.bolter) → review+
Comment 20•16 years ago
|
||
(In reply to comment #18) > (From update of attachment 374255 [details] [diff] [review]) > Looks fine to me (despite the slightly odd output from hg diff) although I > don't see the point of the uuid change. Neil, I changed constants values, for example, XULListCell = 0x00001026; - > const long XULListCell = 0x0000100C; I must change uuid in this case, right?
Comment 21•16 years ago
|
||
(In reply to comment #19) > (From update of attachment 374255 [details] [diff] [review]) > I still find the mapping of XULScale to ROLE_GROUPING odd, but it works. > r=me (if you can resolve Neil's uuid concern) me as well. I'll file bug for this. > Alexander, I'm not sure I love the method names matching "nsEnumRole*"... but > we can IRC on that :) Sure, any ideas are great.
Comment 22•16 years ago
|
||
Ah, I hadn't noticed that, I thought you were just reformatting and commenting.
Comment 23•16 years ago
|
||
Enn, any chance to review?
Updated•16 years ago
|
Attachment #374255 -
Flags: review?(enndeakin) → review+
Comment 24•16 years ago
|
||
checked-in, http://hg.mozilla.org/mozilla-central/rev/f640af4933fc
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 25•16 years ago
|
||
I disabled new scrollbar tests on linux due to failure (http://hg.mozilla.org/mozilla-central/rev/ca15d173817d)
Comment 26•16 years ago
|
||
This should be backed-out, as it caused a TXul regression on trunk: http://graphs.mozilla.org/#show=794371,794398,794384&sel=1241843527,1242189127
Comment 27•16 years ago
|
||
Backed out. Let's confirm this regressed TXul. http://hg.mozilla.org/mozilla-central/rev/9aca8f755e95
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 28•16 years ago
|
||
How can we see the regressed test to know what's wrong in this patch?
Comment 29•8 years ago
|
||
Alex, what should we do with this bug? (Doesn't seem like a priority)
Flags: needinfo?(surkov.alexander)
Comment 30•8 years ago
|
||
(In reply to David Bolter [:davidb] from comment #29) > Alex, what should we do with this bug? (Doesn't seem like a priority) it doesn't look like high priority as we don't have complains about inaccessilbe scrollbars.
Flags: needinfo?(surkov.alexander)
Updated•2 years ago
|
Severity: normal → S3
Comment 31•2 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: surkov.alexander → nobody
You need to log in
before you can comment on or make changes to this bug.
Description
•