Elements absolute positioned from the right start at window edge rather than page area edge

RESOLVED INVALID

Status

()

Core
Layout
RESOLVED INVALID
14 years ago
14 years ago

People

(Reporter: sgarrity, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030714 Mozilla Firebird/0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5a) Gecko/20030714 Mozilla Firebird/0.6

Elements absolute positioned from the right start at window edge rather than
page area edge. If you have a the CSS attribute "min-width" on the BODY element,
the BODY, or page, can be wider than the window, causing side-scrolling (as it
should - this is what min-width is for). However, if you have an element using
CSS absolute positioning positioned to the right of the page (CSS: position:
absolute; left: 0;), it starts at the edge of the window, rather than the page.

So, if you go to a page like this (http://www.wificharlottetown.org), and resize
the window to be less than the min-width (550px, in this case), the right menu
box should stick to the right of the page, even when there is side-scrolling.
Instead, it sticks to the right of the window, allowing you to scoll past it.

Reproducible: Always

Steps to Reproduce:
1. Page with a min-width on the BODY element
2. Element positioned to the right with absolute positioning (CSS: position:
absolute; left: 0;)
3. Resize the window to be less than the min-width of the BODY element

Actual Results:  
The element absolutely positioned to the right will start at the window edge.

Expected Results:  
The element absolutely positioned to the right should start at the edge of the
page edge of the PAGE (the body), which is to the right of the viewable page
area,  and should need to be side-scrolled to be seen.
The containing block for positioned elements it a positioned ancestor or the
initial containing block.  In this case there is no positioned ancestor, and the
<body> is NOT the initial containing block (for one thing, it's got a parent
block -- that corresponding to the <html> node).

The rendering shown by the testcase is correct.  If it is desired that the
<body> be the containing block for abs. pos. boxes, it should be relatively
positioned.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID
(Reporter)

Comment 2

14 years ago
Boris is right. Appologies. Turns out that putting the min-width on the HTML
element has the desired effect.
Note that the definition of initial containing block is in flux, and in CSS2.1
it may become the viewport instead of the root element... So to ensure
compatible rendering in various browsers you really do want to relatively
position the thing that you want to be the containing block.
You need to log in before you can comment on or make changes to this bug.