CSS background-position: The vertical value is calculated wrong when positive value given




10 years ago
6 months ago


(Reporter: tobiasengstrom, Unassigned)


Firefox Tracking Flags

(Not tracked)



(3 attachments, 1 obsolete attachment)



10 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.21022; .NET CLR 3.0.04506)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b2) Gecko/20081201 Firefox/3.1b2

If I set the CSS property background-position: 0px 20px; Then I expect the same result as: background-position: 0px -20px; on a picture that is 40px high, but the positive value (20px) won't give the expected result.

Reproducible: Always

Steps to Reproduce:
1. background-position: 0px 20px; on one element
2. background-position: 0px -20px; on another element
3. Make sure the picture in 40px high for this setting
4. Compare the result
Actual Results:  
The pictures are vertical aligned differently

Expected Results:  
The both elements should look the same
Please attach a small testcase.
Component: General → Style System (CSS)
Product: Firefox → Core
QA Contact: general → style-system

Comment 2

10 years ago
Created attachment 366595 [details]
background-position in action with in different cases
Component: Style System (CSS) → Layout: View Rendering
QA Contact: style-system → layout.view-rendering
Works for me too, on Mac, even at all zoom levels.

Tobias, can you a) try trunk to see if that works for you and b) post a screenshot of what you see.

I'll ask Chris to test this on Windows trunk...
Looks correct in [Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a1pre) Gecko/20090227 Minefield/3.2a1pre (.NET CLR 3.5.30729)], even when zooming in and out. Our rendering also matched IE7 and Safari 4beta.

Comment 8

10 years ago
Created attachment 366868 [details]
Screenshot from my version

I reported this bug from the version given above, I don't have access to the trunk version, or atleast don't know where to download it, so this screenshot shows how it looks in the "public beta" that is available for download.


Comment 9

10 years ago
Hi again,

I found a nightly build and tested my test case in it, and it worked perfectly, so I guess this bug is fixed until it's reintroduced ;)

Best regards

Version used:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a1pre) Gecko/20090311 Minefield/3.2a1pre (.NET CLR 3.5.30729)
Last Resolved: 10 years ago
Resolution: --- → WORKSFORME


6 months ago
Component: Layout: View Rendering → Layout: Web Painting
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.