Closed Bug 393451 Opened 15 years ago Closed 14 years ago

getBoundingClientRects with submenus

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: enndeakin, Assigned: enndeakin)

Details

Attachments

(3 files, 1 obsolete file)

Attached file testcase
getBoundingClientRects on a popup returns a rectangle of the popup relative to the document origin, yet a submenu returns incorrect values.

In this testcase:

1. Click the button to open a menu
2. Open the submenu for item 'Three'
3. Close the menus. The positions of the menus will appear below the button. The outer values look ok, but the values for the inner menu are odd.

The 'top' value looks correct, but 'left' has the same value as the parent menu even though it appears to the right. Also, the 'right' and 'bottom' are the same as 'left' and 'top' making it appear as if the popup has a zero size.
also see the subinner top here, when the menu goes out of screen and is bounced up... it is totally wrong, this makes comparation of menu items with event.clientY a pain
Attached patch let's try this fix (obsolete) — Splinter Review
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Attachment #295622 - Flags: superreview?(roc)
Attachment #295622 - Flags: review?(roc)
+  for (;refFrame && !refFrame->IsFrameOfType(nsIFrame::eSVGForeignObject);
+        refFrame = refFrame->GetParent());

How about stopping when !refFrame->GetParent()? Then you don't need the call to GetRootFrame.

Why do we need to change the boxObject here? I'd rather leave it alone for compatibility and encourage XUL users to use getBoundingClientRect instead.
Attachment #295622 - Attachment is obsolete: true
Attachment #295931 - Flags: superreview?(roc)
Attachment #295931 - Flags: review?(roc)
Attachment #295622 - Flags: superreview?(roc)
Attachment #295622 - Flags: review?(roc)
Attachment #295931 - Flags: superreview?(roc)
Attachment #295931 - Flags: superreview+
Attachment #295931 - Flags: review?(roc)
Attachment #295931 - Flags: review+
Attachment #295931 - Flags: approval1.9?
Attachment #295931 - Flags: approval1.9? → approval1.9+
https://bugzilla.mozilla.org/attachment.cgi?id=295931 was checked in at 2008-01-10 07:48, right?
So this bug can be marked fixed then?
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.