mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:57:44 +00:00
LibWeb: Create EdgeStyleValue for BackgroundPositionXY with no offset
When specifying either `background-position-x: right` or `background-position-y: bottom` without an offset value no EdgeStyleValue was created. However, the spec says the offset should be optional. Now, if you do not provide an offset, it creates the EdgeStyleValue with a default offset of 0 pixels.
This commit is contained in:
parent
016b31fae2
commit
3fd870a429
4 changed files with 28 additions and 1 deletions
21
Tests/LibWeb/Text/input/background-position-xy.html
Normal file
21
Tests/LibWeb/Text/input/background-position-xy.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
var pos_x = document.getElementById("position-x")
|
||||
var pos_y = document.getElementById("position-y")
|
||||
println(getComputedStyle(pos_x).backgroundPositionX)
|
||||
println(getComputedStyle(pos_y).backgroundPositionY)
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.example {
|
||||
display: inline-block;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
border: 1px solid black;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 30px 30px;
|
||||
background-image: linear-gradient(red, red);
|
||||
}
|
||||
</style>
|
||||
<div id="position-x" class="example" style="background-position-x: right"></div><div id="position-y" class="example" style="background-position-y: bottom"></div>
|
Loading…
Add table
Add a link
Reference in a new issue