CSS Property "background-position" displays incorrectly for vertical alignments that use "center" or a percentage

VERIFIED DUPLICATE of bug 243751

Status

()

VERIFIED DUPLICATE of bug 243751
13 years ago
13 years ago

People

(Reporter: toadking, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

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

When you set a vertical position for a background image, such as "top center" or
"5em 25%", the image appears half cut off at the top of the page and only
negative percent values lower it.

Reproducible: Always

Actual Results:  
The top half of the background image is cut off at the top of the page.

Expected Results:  
The background image should appear in the center of the page horizontally AND
vertically.

http://toadking.ath.cx/background-position.html

Before the Deer Park Alpha releases, I found this to not be a problem. I was
going for the Beta release since I was suspecting it was an obvious bug that
would be found quickly. I guess I was wrong.

Since it works okay in 1.0.6 or earlier versions, I'm pretty sure it has
something to do with a change in the way it handles that CSS property. I would
love to help fix it, but the only non-web programming language I know is Java,
which Firefox isn't coded in.
(Reporter)

Comment 1

13 years ago
Created attachment 195937 [details]
Copy of test page

Since my server isn't allways up, a backup copy of the test page
(Reporter)

Updated

13 years ago
Version: unspecified → Trunk

Comment 2

13 years ago
This is actually exactly what is supposed to happen.  According to the spec[1],
when you specify just "center", it is the same as "50% 50%".  This would place
the pixel 50% from the left and 50% from the top of the image at the spot 50%
across and 50% down the <body> padding area.  If you want to fix this, specify
"top center" or an equivalent.

Resolving INVALID.

[1] http://www.w3.org/TR/CSS21/colors.html#propdef-background-position
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
Actually, I think that current trunk builds are doing it correct here.
Look at the height of the body element in the dom inspector. It has only a very
small height. The background-image is exactly centered vertically in that box.
Opera8 is doing the same.
Keywords: testcase
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---

*** This bug has been marked as a duplicate of 243751 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago13 years ago
Resolution: --- → DUPLICATE

Updated

13 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.