Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly place images with background-position: center #19699

Merged
merged 1 commit into from Jan 5, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Correctly place images with background-position: center

Add a regression ref test.
See also #19680.
  • Loading branch information
pyfisch committed Jan 5, 2018
commit 859f002bf2efa64a97c14b512307f14978be6357
@@ -1581,7 +1581,7 @@ impl FragmentDisplayListBuilding for Fragment {
let mut tile_size = compute_background_image_size(bg_size, bounds.size, intrinsic_size);

let mut tile_spacing = Size2D::zero();
let own_position = bounds.size - intrinsic_size.unwrap_or(Size2D::zero());
let own_position = bounds.size - tile_size;
let pos_x = bg_position_x.to_used_value(own_position.width);
let pos_y = bg_position_y.to_used_value(own_position.height);
tile_image_axis(
{}
]
],
"css/css-backgrounds/background-image-centered.html": [
[
"/css/css-backgrounds/background-image-centered.html",
[
[
"/css/css-backgrounds/background-image-centered-ref.html",
"=="
]
],
{}
]
],
"css/css-backgrounds/background-image-first-letter.html": [
[
"/css/css-backgrounds/background-image-first-letter.html",
{}
]
],
"css/css-backgrounds/background-image-centered-ref.html": [
[
{}
]
],
"css/css-backgrounds/background-origin/list.txt": [
[
{}
"b0231f487c5d467ac707eb91dcdd561462a54ca1",
"reftest"
],
"css/css-backgrounds/background-image-centered-ref.html": [
"655c4a1f457630f0788d4d4eae465d757b26c6df",
"support"
],
"css/css-backgrounds/background-image-centered.html": [
"dfb5aed73f04867336a353a53698ba851b2a1da8",
"reftest"
],
"css/css-backgrounds/background-image-first-letter.html": [
"7e296a53a2abebcd5fcee2431b182efe6f148c64",
"reftest"
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Centered Background Gradient</title>
<style>
#a {
width: 200px;
height: 150px;
border-style: solid;
border-width: 10px;
background-position: 0px 0px;
background-image: repeating-radial-gradient(blue, green 20px);
}
</style>
<body>
<div id="a"></div>
</body>
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Centered Background Gradient</title>
<link rel="match" href="background-image-centered-ref.html">
<link rel="help" href="http://www.w3.org/TR/css3-background/">
<style>
#a {
width: 200px;
height: 150px;
border-style: solid;
border-width: 10px;
background-position: center center;
background-image: repeating-radial-gradient(blue, green 20px);
}
</style>
<body>
<div id="a"></div>
</body>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.