Last Comment Bug 308452 - Select1 does not work inside absolute DIV's
: Select1 does not work inside absolute DIV's
Status: RESOLVED FIXED
: fixed1.8
Product: Core
Classification: Components
Component: XForms (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Peter Nunn
: Stephen Pride
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-14 03:23 PDT by Peter Nunn
Modified: 2005-10-10 20:47 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Test form to show the behavior. (2.00 KB, application/xhtml+xml)
2005-09-14 03:24 PDT, Peter Nunn
no flags Details
Patch to resolve issue (1.14 KB, patch)
2005-09-14 03:26 PDT, Peter Nunn
bugs: review-
Details | Diff | Review
Updated test form (3.39 KB, application/xhtml+xml)
2005-09-14 22:51 PDT, Peter Nunn
no flags Details
a hack for absolute layout (2.79 KB, patch)
2005-09-15 14:02 PDT, Olli Pettay [:smaug]
doronr: review+
allan: review+
Details | Diff | Review

Description Peter Nunn 2005-09-14 03:23:20 PDT
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
Comment 1 Peter Nunn 2005-09-14 03:24:48 PDT
Created attachment 196024 [details]
Test form to show the behavior.

Test form with all controls inside and absolute position DIV
Comment 2 Peter Nunn 2005-09-14 03:26:08 PDT
Created attachment 196025 [details] [diff] [review]
Patch to resolve issue

Fix to make position relative to the container, not the client area
Comment 3 Olli Pettay [:smaug] 2005-09-14 10:22:09 PDT
Peter, when opening XForms bugs, could you CC me.

Good catch btw, I'll review as soon as I've updated my trees.
Comment 4 Olli Pettay [:smaug] 2005-09-14 12:12:08 PDT
Comment on attachment 196025 [details] [diff] [review]
Patch to resolve issue

yeah, this does seem to fix the problem.
Comment 5 Olli Pettay [:smaug] 2005-09-14 12:21:01 PDT
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.
Comment 6 Doron Rosenberg (IBM) 2005-09-14 12:22:35 PDT
You'll have to walk all parentNodes and add their offsets probably
Comment 7 Peter Nunn 2005-09-14 22:51:33 PDT
Created attachment 196120 [details]
Updated test form

Have added rel and abs test cases.
Comment 8 Peter Nunn 2005-09-14 22:52:37 PDT
(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
Comment 9 Olli Pettay [:smaug] 2005-09-14 23:53:38 PDT
(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.
Comment 10 Peter Nunn 2005-09-15 03:59:08 PDT
(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.
Comment 11 Olli Pettay [:smaug] 2005-09-15 14:01:51 PDT
(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.
Comment 12 Olli Pettay [:smaug] 2005-09-15 14:02:57 PDT
Created attachment 196239 [details] [diff] [review]
a hack for absolute layout

This works in my test cases.
Comment 13 Doron Rosenberg (IBM) 2005-09-15 15:18:14 PDT
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 ;)
Comment 14 aaronr 2005-10-06 17:30:55 PDT
checked into branch 20051004

Note You need to log in before you can comment on or make changes to this bug.