Closed Bug 90624 Opened 24 years ago Closed 24 years ago

Active Accessibility: accGetBounds returning incorrect values

Categories

(Core Graveyard :: Embedding: APIs, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

References

Details

(Keywords: access, Whiteboard: Fix checked into branch)

Attachments

(3 files)

Our implementation of accGetBounds is incorrect. It returns incorrect values for links that contains images, and for any text that flows to a new line. It's also difficult to follow the old code. A new implementation is needed.
Keywords: access
John and Chris, I test this and it works. Ready for review/superreview
Whiteboard: looking for r=/sr=/a=
- you assign aRelativeParent to the parent of the BoundsFrame and then before using it reassign it: firstFrame->GetParent(aRelativeParent); then: *aRelativeParent = parentFrame; It is in a while condition, but if we don't enter the while basically the rest of the function doesn't get executed either because we have no frames around. ( trace back the assignment into parentFrame -- first time through, no parentFrame, no BoundsFrame. so we always enter the while at least once ) - You reuse the variable parentFrame, is there a different name you can use? // Find common relative parent nsIFrame *parentFrame = iterFrame; while (iterContent == firstContent || depth > 0) { // Coordinates will come back relative to parent frame nsIFrame *parentFrame = iterFrame; if nothing else, maybe not creating a new parentFrame.
Attached patch patch #2Splinter Review
QA Contact: mdunn → dsirnapalli
r=jgaunt on patch 42226
Blocks: 90182
Removing waterson ( on vacation ) adding brendan for sr=
Whiteboard: looking for r=/sr=/a= → looking for sr=/a=
Cool -- patches should try to remove code rather than add code, to fix buts -- or else code tends to bloat over time! + while (ancestorFrame) { + *aRelativeParent = ancestorFrame; + if (IsCorrectFrameType(ancestorFrame, nsLayoutAtoms::blockFrame) || + IsCorrectFrameType(ancestorFrame, nsLayoutAtoms::areaFrame)) + break; + ancestorFrame->GetParent(&ancestorFrame); + } Shouldn't you set *aRelativeParent = nsnull; before the loop, in case it does not iterate? Style nit: Wouldn't it look better if the underhanging part of the condition were indented so that IsCorrectFrameType lined up (started in the same column on both lines)? You might even brace the break; so the statement boundaries are clearer at a glance. Style nit: Wouldn't aRelativeAncestor be a better name? Actually, the "relative" part is confusion when mixed with "ancestor" or "parent" -- why not aBoundingFrame or some such? I studied enough of the big hair frame-tree walking loop to believe that it works as designed. One nit only: + if (!iterNextFrame && --depth >= 0) + iterFrame->GetParent(&iterFrame); + else break; Maybe put the break on its own line, so you can breakpoint it cleanly on all debuggers? That also suggests applying De Morgan's theorem: + if (iterNextFrame || --depth < 0) + break; + iterFrame->GetParent(&iterFrame); This also shows more clearly (to me, at any rate) that depth can and should go negative (to -1), which helps motivate its signed-ness. I am so not a frames jock that I'm cc'ing waterson (in case he cares when he gets back), attinasi, and dbaron. Marc, David: if one or both of you could take a look and give a benediction, I'll owe you. Not an obstacle to checkin, but a sanity check that might result in sequel bugs or last-minute saves. Pick my nits, heed attinasi&dbaron if they come back with comments fast, and sr=brendan@mozilla.org. If you really need to get this into the trunk, I don't see it doing any harm, so I'm giving a real sr= here -- but I hope to get backup review from a frames guru, because I'm not one. /be
Whiteboard: looking for sr=/a= → looking for a=
Set *aBoundingFrame = nsnull; before any return, was what I had in mind when I wrote "Shouldn't you set *aRelativeParent = nsnull; before the loop, in case it does not iterate?" If aBoundingFrame is a pure out parameter pointer (to a frame pointer), the caller should not have to initialize the frame pointer that it passes to nsnull, in order to have a well-defined return value in all cases. /be
Whiteboard: looking for a= → Fixed on branch, waiting for dbaron's thoughts, need a=
I have added Brendan's last suggestion of setting the out parameter to null right .away It's implemented in my local tree.
The patch looks good to me, but I am curious if the check if (IsCorrectFrameType(iterFrame, nsLayoutAtoms::inlineFrame)) { is sufficient. I mean, are there inline frames that will return some other type, I am not sure. It might be worth checking, though this probably covers most cases. r=attinasi
I think that nsLayoutAtoms::inlineFrame check should be sufficient since the only ones he cares about are those that can have descendents outside of their bounds, which are only non-replaced inline elements, and should thus all be standard inline frames.
Whiteboard: Fixed on branch, waiting for dbaron's thoughts, need a= → need a=
Chofmann has approved via email.
Whiteboard: need a= → a=
Whiteboard: a= → PDT+
Keywords: vbranch
Whiteboard: PDT+
Fix checked into branch as well.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: Fix checked into branch
Blocks: 95819
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: