Closed Bug 308452 Opened 19 years ago Closed 19 years ago

Select1 does not work inside absolute DIV's

Categories

(Core Graveyard :: XForms, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: peter.nunn, Assigned: peter.nunn)

Details

(Keywords: fixed1.8)

Attachments

(2 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050914 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050914 Firefox/1.6a1

When a select1 xbl binding is placed into a div with absolute positioning the
combo box is opened with an offset that is relative to the body of the document,
not the enclosing container

Reproducible: Always
Attached file Test form to show the behavior. (obsolete) —
Test form with all controls inside and absolute position DIV
Attached patch Patch to resolve issue (obsolete) — Splinter Review
Fix to make position relative to the container, not the client area
Attachment #196025 - Flags: review+
Attachment #196025 - Flags: review+ → review?(smaug)
Peter, when opening XForms bugs, could you CC me.

Good catch btw, I'll review as soon as I've updated my trees.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: aaronr → peter.nunn
Comment on attachment 196025 [details] [diff] [review]
Patch to resolve issue

yeah, this does seem to fix the problem.
Attachment #196025 - Flags: review?(smaug)
Attachment #196025 - Flags: review?(aaronr)
Attachment #196025 - Flags: review+
Attachment #196025 - Flags: review?(aaronr) → review?(doronr)
Attachment #196025 - Flags: review?(doronr) → review+
Comment on attachment 196025 [details] [diff] [review]
Patch to resolve issue

Sorry, no. If the documentElement has border or margin, this breaks
non-absolute layout.
Attachment #196025 - Flags: review-
Attachment #196025 - Flags: review+
You'll have to walk all parentNodes and add their offsets probably
Attached file Updated test form
Have added rel and abs test cases.
Attachment #196024 - Attachment is obsolete: true
(In reply to comment #5)
> (From update of attachment 196025 [details] [diff] [review] [edit])
> Sorry, no. If the documentElement has border or margin, this breaks
> non-absolute layout.
> 

Can you please provide a test case?  cannot see any adverse behavior if the
controls are in an absolute div with borders
(In reply to comment #8)
> (In reply to comment #5)
> > (From update of attachment 196025 [details] [diff] [review] [edit] [edit])
> > Sorry, no. If the documentElement has border or margin, this breaks
> > non-absolute layout.
> > 
> 
> Can you please provide a test case?  cannot see any adverse behavior if the
> controls are in an absolute div with borders

Try a non-absolute layout and add border: 50px black solid; to html element.
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #5)
> > > (From update of attachment 196025 [details] [diff] [review] [edit] [edit] [edit])
> > > Sorry, no. If the documentElement has border or margin, this breaks
> > > non-absolute layout.
> > > 
> > 
> > Can you please provide a test case?  cannot see any adverse behavior if the
> > controls are in an absolute div with borders
> 
> Try a non-absolute layout and add border: 50px black solid; to html element.
> 

Did some searching on goggle and found a few reference to this issue.  It is a
bug is it not?
What do we do, do we code around it and perpetuate the issue, or fix the bug in
the codebase and possibly cause other issues?
Happy to work out the fix and get it done properly or work out a hack to get
around the problem.
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #8)
> > > (In reply to comment #5)
> > > > (From update of attachment 196025 [details] [diff] [review] [edit] [edit] [edit] [edit])
> > > > Sorry, no. If the documentElement has border or margin, this breaks
> > > > non-absolute layout.
> > > > 
> > > 
> > > Can you please provide a test case?  cannot see any adverse behavior if the
> > > controls are in an absolute div with borders
> > 
> > Try a non-absolute layout and add border: 50px black solid; to html element.
> > 
> 
> Did some searching on goggle and found a few reference to this issue.  It is a
> bug is it not?
> What do we do, do we code around it and perpetuate the issue, or fix the bug in
> the codebase and possibly cause other issues?
> Happy to work out the fix and get it done properly or work out a hack to get
> around the problem.

For now I think we have to hack something which can be used with FF1.5.
This works in my test cases.
Attachment #196025 - Attachment is obsolete: true
Attachment #196239 - Flags: review?(doronr)
Comment on attachment 196239 [details] [diff] [review]
a hack for absolute layout

>? dependentLibs.h
>? newui_working_progress.diff
>Index: resources/content/select1.xml
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/xforms/resources/content/select1.xml,v
>retrieving revision 1.2
>diff -u -8 -p -r1.2 select1.xml
>--- resources/content/select1.xml	23 Aug 2005 18:35:52 -0000	1.2
>+++ resources/content/select1.xml	15 Sep 2005 20:59:49 -0000
>@@ -459,33 +459,57 @@
> 
>       <method name="togglePopup">
>         <body>
>           <![CDATA[
>           if (!this.popupOpen && !this.delegate.isReadonly) {
>             // Calculating the size and position of the popup.
>             var style = "";
>             var containerBox = document.getBoxObjectFor(this.container);
>-            var x = containerBox.x;
>-            var y = containerBox.y;
>+            var x;
>+            var y;

var x,y looks nicer probably ;)
Attachment #196239 - Flags: review?(doronr) → review+
Attachment #196239 - Flags: review?(allan)
Attachment #196239 - Flags: review?(allan) → review+
Whiteboard: xf-to-branch
checked into branch 20051004
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
Keywords: fixed1.8
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: