Open
Bug 344594
Opened 19 years ago
Updated 3 years ago
[rfe] readonly (something) elementIsVisible attribute to nsIScrollBoxObject
Categories
(Core :: XUL, defect)
Tracking
()
NEW
People
(Reporter: moco, Unassigned)
References
()
Details
[rfe] readonly (something) elementIsVisible attribute to nsIScrollBoxObject
for something I'm working on (see bug #343251, the part about coloring menu items based on if a tab is visible) would require this.
I chatted briefly with dbaron about this, and he pointed out that we might want four results:
1) not visible
2) partially visible
3) as visible as possible (*)
4) completely visible
3 is interesting, as it means the element is bigger than the scroll box, so you'd never get "completely visible"
I was surprised this didn't exist already (for accessibility reasons), but maybe people have just implemented the logic in the "caller code" where they checked the element dimensions and position with the scroll box dimensions and position.
Comment 1•19 years ago
|
||
Accessibility uses nsIViewManager::GetRectVisibility
http://lxr.mozilla.org/seamonkey/source/view/public/nsIViewManager.h#561
| Reporter | ||
Comment 2•19 years ago
|
||
aaron:
> Accessibility uses nsIViewManager::GetRectVisibility
> http://lxr.mozilla.org/seamonkey/source/view/public/nsIViewManager.h#561
do you think that's the right approach for what I need, or do you think doing the simple calculations (see my next comment for what I'm current doing) in the ScrollBoxObject is the right approach for this special case of elementIsVisible?
| Reporter | ||
Comment 3•19 years ago
|
||
for bug #343251, I'm currently doing "completely visible" in js, in tabbrowser.xml by comparing just the x coordinates for the box objects, because I know the tab strip is horizontal.
var tsbo = tabbrowser.mTabContainer.mTabstrip.scrollBoxObject;
var tsboStart = tsbo.screenX;
var tsboEnd = tsboStart + tsbo.width;
...
var ctbo = tabs[i].boxObject;
var ctboStart = ctbo.screenX;
var ctboEnd = ctboStart + ctbo.width;
...
if (tsboStart <= ctboStart && ctboEnd <= tsboEnd)
menuItem.setAttribute("completelyvisible", "true");
for the general case, for all ScrollBoxObjects, I obviously have to handle vertical and horizontal scroll box objects, and I need to return one of the four states of visibility that dbaron pointed out.
Status: NEW → ASSIGNED
Comment 4•19 years ago
|
||
Seth, I think roc is a better person to ask about this stuff.
I'm not sure we really want to add a built-in API for this. Maybe a JS API on the scrollbox binding?
| Reporter | ||
Comment 6•18 years ago
|
||
not actively working on this.
Assignee: sspitzer → nobody
Status: ASSIGNED → NEW
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•