gecko-dev/testing/web-platform/tests/css/css-backgrounds/reference/background-position-three-four-values-ref.html
George Steel 748aad0ef7 Bug 1625667 [wpt PR 22509] - fix background-position-xy serialization for right/bottom offsets, a=testonly
Automatic update from web-platform-tests
fix background-position-xy serialization for right/bottom offsets

Make the implementations of CSSValueFromComputedStyle for
background-position-x/y return correct values when three/four-value
syntax is used with background-position. Since these properties only
support single-value syntax, positions from the right or bottom will
use calc() values if they result in mixed lengths and percentages when
converted to be from the left/top. This is not the canonical form in
the css-backgrounds-4 spec proposal, but does not require changes to
the parser.

Add a reftest (passes without patch) for three/four-value
background-position syntax (there is currently only a manual test).
Add another version of the reftest (fails without patch) which takes
the above and attempts to write back the computed values of
background-position-x/y.

This is done in preparation to make transitions use normal keyframes
which require round-trip serialization of all transition properties.

Change-Id: I50e714746cc15fd0591bcd0a41cf9ecd56f55c44
Bug: 610627
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121415
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: George Steel <gtsteel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755462}

--

wpt-commits: e8d4020b565b63adfde507cb7ab112d76aeaf603
wpt-pr: 22509
2020-04-06 12:43:57 +00:00

37 lines
No EOL
592 B
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
div {
width: 200px;
height: 200px;
border: 2px solid black;
background-image: url("../support/blue_color.png");
background-repeat: no-repeat;
display: inline-block;
}
.test1 {
background-position: 50px 50%;
}
.test2 {
background-position: 75% 75%;
}
.test3 {
background-position: 25px 25%;
}
.test4 {
background-position: 75% 75%;
}
</style>
</head>
<body>
<div class="test1"></div>
<div class="test2"></div>
<div class="test3"></div>
<div class="test4"></div>
</body>
</html>