Closed
Bug 102192
Opened 24 years ago
Closed 24 years ago
Active Accessibility: Support STATE_OFFSCREEN in IAccessible states
Categories
(SeaMonkey :: General, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla0.9.5
People
(Reporter: aaronlev, Assigned: aaronlev)
Details
(Keywords: access)
Attachments
(3 files, 3 obsolete files)
|
3.92 KB,
patch
|
mozilla
:
review+
|
Details | Diff | Splinter Review |
|
10.96 KB,
patch
|
Details | Diff | Splinter Review | |
|
12.93 KB,
patch
|
kmcclusk
:
review+
waterson
:
superreview+
|
Details | Diff | Splinter Review |
The STATE_OFFSCREEN bitflag should be returned in Accessible state when an
element is offscreen. The accessibility vendors have asked for a quick, rough
calculation. Therefore, for simplicity we just check to see if the top left
corner of the object's frame is off screen.
More comments in patch.
| Assignee | ||
Updated•24 years ago
|
| Assignee | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
Umm.... I need code to do a review and all I see in the patch is some text
comments.
| Assignee | ||
Comment 3•24 years ago
|
||
| Assignee | ||
Updated•24 years ago
|
Attachment #51240 -
Attachment is obsolete: true
Attachment #51240 -
Attachment is patch: false
Comment 4•24 years ago
|
||
Comment on attachment 51258 [details] [diff] [review]
The last patch was the wrong file - this is the right one
looks good. I'm confused why the GetOffsetFromView returns negative numbers for both the x and y, but I trust you and I'll do digging for my own satisfaction later.
r=jgaunt
Attachment #51258 -
Flags: review+
| Assignee | ||
Comment 5•24 years ago
|
||
Sorry, I might have told you that GetOffsetFromView returns negative numbers.
The one returning negative numbers is this:
containingView->GetBounds(containingViewRect);
Therefore our final comparison works:
if (frameOffset.y < -containingViewRect.y || frameOffset.y +
containingViewRect.y > scrollViewRect.height || frameOffset.x <
-containingViewRect.x || frameOffset.x + containingViewRect.x >
scrollViewRect.width)
*aAccState |= STATE_OFFSCREEN;
The expression |-containingViewRect.y| becomes a 0 or positive value
representing how much of the top of document, in twips, is not currently shown
on the screen.
Comment 6•24 years ago
|
||
kmcclusk, this looks okay to me...what do you think?
Comment 7•24 years ago
|
||
This is fine for most cases, but I think it will fail if there are intervening views
consider the following view hierarchy where viewC has the frame:
scrollview
|- viewA
|-viewB
|-viewC (Frame)
To get the absolute position of the Frame you must add together the offsets for
ViewA, ViewB, and ViewC as well as the frame's offset. The patch looks like it
always assumes it can calculate the position of the frame relative to the view
by adding in only it's containing views offset.
Another issue is if the frame is inside a scrolling div:
scrollingViewA
view1
scrollingViewB
view2
view3 (frame)
The position of scrollingViewB may be off screen and that may cause all of the
views it contains to also be offscreen, but the patch only looks for the nearest
enclosing scrollingView, so relative to ScrollingViewB the frame appears to be
onscreen.
A third issue would be clipping. Views may have clip set which would make the
element invisible, but I'm not sure if they would still be considered on screen.
Comment 8•24 years ago
|
||
The current patch will probably satisfy 90%+ of the existing websites.
If you want a more accurate determination of visibility, You should be able to
use some code nsViewManager.cpp to help you out.
PRBool nsViewManager::IsRectVisible(nsIView *aView, const nsRect &aRect).
This method takes the view in question and rect within the view and returns a
bool to indicate whether it is visible.
You should be able to pass the frames bounds as aRect and the frames containing
view and you will get back a boolean which indicates whether any portion of the
rect is visible.
This call is used within the viewmanager to avoid invalidating rects which are
completely invisible.
IsRectVisible would need to made part of nsIViewManager's public interface.
| Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Whiteboard: seeking r=, sr= → seeking more advice - Kevin's instructions not working for me
| Assignee | ||
Comment 9•24 years ago
|
||
| Assignee | ||
Comment 10•24 years ago
|
||
| Assignee | ||
Comment 11•24 years ago
|
||
Kevin, I had to copy and paste IsRectVisible into my code, because it needed
some modification for my purposes. Mainly, I wanted half-visible rectangles to
be counted as not visible.
In the process, I had to expose two methods through nsIViewManager
GetAbsoluteRect(nsIView *aView, const nsRect &aRect, nsRect&
aAbsRect)GetVisibleRect(nsRect& aVisibleRect)
Whiteboard: seeking more advice - Kevin's instructions not working for me → seeking new r= from jgaunt, ready for sr= from kmcclusk
Comment 12•24 years ago
|
||
Comment on attachment 51494 [details] [diff] [review]
Fix using some altered code from nsIViewManager::IsRectVisible
looks good!
r=kmcclusk@netscape.com
Attachment #51494 -
Flags: review+
Comment 13•24 years ago
|
||
Rather than copying and pasting this code (and worse, copying it _out_ of the
view module to a place where we'll never be able to find it again), how about
you modify the view manager in such a way that you can issue the query you need
to. Maybe add a boolean argument to IsRectVisible(), or at least implement
IsRectEntirelyVisible() as another method on the view manager. Kevin, would you
have any objections to this approach?
Comment 14•24 years ago
|
||
"Kevin, would you have any objections to this approach?". No thats fine with
me. If we need to add a new argument to a method on the ViewManager which
indicates whether only part of the rectangle is visible that's fine with me.
Comment 15•24 years ago
|
||
IsRectVisible(nsIView *aView, const nsRect &aRect) could be modified to have an
additional argument which the visible part of the aRect that is passed in.
IsRectVisible(nsIView *aView, const nsRect &aRect, nsRect &aVisibleRect)
If (aVisibleRect==aRect) then the entire rect is visible.
Comment 16•24 years ago
|
||
(aaronl: hope I didn't sound like too much of a smarty pants: I didn't know
about the IsRectVisible method, either. But now that we _do_ know, it seems like
putting this in view manager may be better...)
| Assignee | ||
Comment 17•24 years ago
|
||
| Assignee | ||
Updated•24 years ago
|
Whiteboard: seeking new r= from jgaunt, ready for sr= from kmcclusk → seeking new r= from kmcclusk and sr= from waterson
| Assignee | ||
Comment 18•24 years ago
|
||
| Assignee | ||
Updated•24 years ago
|
Attachment #51730 -
Attachment is obsolete: true
| Assignee | ||
Updated•24 years ago
|
Attachment #51494 -
Attachment is obsolete: true
Comment 19•24 years ago
|
||
I'd be fine with you leaving nsIViewManager::IsRectVisible()'s return signature
as a PRBool...no need to get carried away with COM here. (I suspect in the long
run we probably ought to consider getting rid of the extra COM layer here anyway...)
Comment 20•24 years ago
|
||
Comment on attachment 51736 [details] [diff] [review]
This is the patch that needs r=/sr=
r=kmcclusk@netscape.com. Patch looks fine to me. I agree with waterson in regard to not needing to maintain nsIViewManager.h as a com interface, but it's OK with me if you check it in "as is".
Attachment #51736 -
Flags: review+
Comment 21•24 years ago
|
||
Go ahead and revert the return type to PRBool, and sr=waterson.
Comment 22•24 years ago
|
||
Oy, I'm sorry. I thought that this was already a publicly accessible method that
you'd changed the signature of. (Who's not reading the patch carefully?) Go
ahead with attachment 51736 [details] [diff] [review] as it is. sr=waterson
Comment 23•24 years ago
|
||
Comment on attachment 51736 [details] [diff] [review]
This is the patch that needs r=/sr=
sr=waterson
Attachment #51736 -
Flags: superreview+
| Assignee | ||
Comment 24•24 years ago
|
||
-> checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: seeking new r= from kmcclusk and sr= from waterson
Updated•21 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•