The default bug view has changed. See this FAQ.

Select1 does not work inside absolute DIV's

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
12 years ago
9 months ago

People

(Reporter: Peter Nunn, Assigned: Peter Nunn)

Tracking

({fixed1.8})

Trunk
x86
Windows XP
fixed1.8

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

12 years ago
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
(Assignee)

Comment 1

12 years ago
Created attachment 196024 [details]
Test form to show the behavior.

Test form with all controls inside and absolute position DIV
(Assignee)

Comment 2

12 years ago
Created attachment 196025 [details] [diff] [review]
Patch to resolve issue

Fix to make position relative to the container, not the client area
(Assignee)

Updated

12 years ago
Attachment #196025 - Flags: review+
(Assignee)

Updated

12 years ago
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)

Updated

12 years ago
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+

Comment 6

12 years ago
You'll have to walk all parentNodes and add their offsets probably
(Assignee)

Comment 7

12 years ago
Created attachment 196120 [details]
Updated test form

Have added rel and abs test cases.
Attachment #196024 - Attachment is obsolete: true
(Assignee)

Comment 8

12 years ago
(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.
(Assignee)

Comment 10

12 years ago
(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.
Created attachment 196239 [details] [diff] [review]
a hack for absolute layout

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)

Updated

12 years ago
Attachment #196239 - Flags: review?(allan) → review+
Whiteboard: xf-to-branch

Comment 14

12 years ago
checked into branch 20051004
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch

Updated

12 years ago
Keywords: fixed1.8
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.