Closed Bug 262398 Opened 22 years ago Closed 22 years ago

Fixed positioned box is not placed in its containing box

Categories

(Core :: Layout: Positioned, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: unger, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910 Fixed positioned boxes should have the same bahavior like absolute positioned boxes - the only difference is the fixing. If the container is not placed in the top left corner, the positioning is wrong, normally the fixed box is not placed in its container but in the body container. A work-around is to place the fixed positioned box in an absolute positioned box without using left and top statements. Reproducible: Always Steps to Reproduce: 1. Use the attached file 2. 3. Actual Results: Wrong positions. Expected Results: The same behavior on screen like in the case of absolute positioning but fixed (and repeated for paged media). See also: http://www.w3.org/TR/CSS21/visuren.html#fixed-positioning
Attachment #160714 - Attachment mime type: text/plain → text/html
Component: Layout → Layout: R & A Pos
QA Contact: core.layout → core.layout.r-and-a-pos
There seems to be a misunderstanding. "the box is fixed with respect to some reference. In the case of continuous media, the box is fixed with respect to the viewport (and doesn't move when scrolled)." http://www.w3.org/TR/CSS2/visuren.html#propdef-position "the box is fixed with respect to some reference. (...) In the case of handheld, projection, screen, tty, and tv media types, the box is fixed with respect to the viewport and doesn't move when scrolled." http://www.w3.org/TR/CSS21/visuren.html#propdef-position > Fixed positioned boxes should have the same bahavior like absolute positioned > boxes - the only difference is the fixing. It is not said that the fixing is relative to the offsetParent or its closest abs. pos. parent in the DOM hierarchy but relative to the viewport. "The only difference is that for a fixed positioned box, the containing block is established by the viewport." > If the container is not placed in the > top left corner, the positioning is wrong, normally the fixed box is not placed > in its container but in the body container. The specs says relative to viewport, not body container. > See also: http://www.w3.org/TR/CSS21/visuren.html#fixed-positioning At the url you provided, it is said: "The only difference is that for a fixed positioned box, the containing block is established by the viewport." Is this bug related to the 1.7 branch or to the trunk?
I was going to mark this bug INVALID, but the spec does not define behaviour when no positioning information is given for a fixed or absolute element. In such case what Mozilla does is positions the box as it would be placed within normal flow. A fixed box is then fixed in this position inside viewport. What I understand you propose is that all fixed unpositioned boxes be stacked one on top of the other in the top left corner of viewport, behaving as if each of them is a first child of the viewport container? Note, in your testcase every absolute box has it's positions specified, but only 1 out of 3 fixed boxes does. So saying fixed should have the same behaviour as absolute doesn't really bring a point across.
Actually it does, see CSS 2.1 secton 10.3.7.
ok INVALID then, as current behaviour is per spec. "For the purposes of calculating the static position, the containing block of fixed positioned elements is the initial containing block instead of the viewport." http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: