Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix block size for absolute replaced element
Absolutely replaced elements with padding were incorrectly setting their block size to include twice the padding values. This attempts to stop that extra padding for replaced elements but leave the working flow for non replaced elements
- Loading branch information
1 parent
3ecd017
commit 21e2ed5
Showing
6 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
tests/wpt/mozilla/tests/css/absolute_div_with_padding.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title></title> | ||
<link rel="match" href="absolute_div_with_padding_ref.html"> | ||
<style> | ||
.absolute{ | ||
position: absolute; | ||
top: 0px; | ||
left: 0px; | ||
padding: 100px; | ||
width: 150px; | ||
height: 150px; | ||
background-color: green; | ||
} | ||
.box{ | ||
width: 350px; | ||
height: 350px; | ||
position: relative; | ||
background: red; | ||
} | ||
</style> | ||
<div class="box"> | ||
<div class="absolute"></div> | ||
</div> |
20 changes: 20 additions & 0 deletions
20
tests/wpt/mozilla/tests/css/absolute_div_with_padding_ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title></title> | ||
<style> | ||
.absolute{ | ||
padding: 100px; | ||
width: 150px; | ||
height: 150px; | ||
background-color: green; | ||
} | ||
.box{ | ||
width: 350px; | ||
height: 350px; | ||
position: relative; | ||
background: red; | ||
} | ||
</style> | ||
<div class="box"> | ||
<div class="absolute"></div> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
tests/wpt/mozilla/tests/css/absolute_img_with_padding.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Test: Absolute position image with padding should not increase in size</title> | ||
<link rel="match" href="absolute_img_with_padding_ref.html"> | ||
<body> | ||
<style> | ||
img{ | ||
position: absolute; | ||
top: 0px; | ||
left: 0px; | ||
padding: 100px; | ||
} | ||
</style> | ||
<img src="100x100_green.png" alt="img"> | ||
</body> |
6 changes: 6 additions & 0 deletions
6
tests/wpt/mozilla/tests/css/absolute_img_with_padding_ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Test: Absolute position image with padding should not increase in size</title> | ||
<body style="margin:0"> | ||
<img style="padding: 100px;" src="100x100_green.png" alt="img"> | ||
</body> |