Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PE] Don't truncate table cell's padding
Truncation caused inadequate logical width when padding is like 1.7px. Bug: 817342 Change-Id: Ibdb76cc528cc7e04801fe65409bb8f60e5ac69a5
- Loading branch information
1 parent
c7c6f86
commit 9f63ae0
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
css/css-tables/width-distribution/td-with-subpixel-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,52 @@ | ||
<!DOCTYPE html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<style> | ||
div { | ||
display: inline-block; | ||
width: 20px; | ||
height: 20px; | ||
background: blue; | ||
} | ||
</style> | ||
Passes if each row has two blue squares. | ||
<table> | ||
<tr> | ||
<td class='target' style="padding: 0 0.8px"><div></div> <div></div></td> | ||
<td style="padding: 0 0.8px; width: 30px"></td> | ||
</tr> | ||
</table> | ||
<table> | ||
<tr> | ||
<td class='target' style="padding: 0 1px"><div></div> <div></div></td> | ||
<td style="padding: 0 1px; width: 30px"></td> | ||
</tr> | ||
</table> | ||
<table> | ||
<tr> | ||
<td class='target' style="padding: 0 1.3px"><div></div> <div></div></td> | ||
<td style="padding: 0 1.3px; width: 30px"></td> | ||
</tr> | ||
</table> | ||
<table> | ||
<tr> | ||
<td class='target' style="padding: 0 1.5px"><div></div> <div></div></td> | ||
<td style="padding: 0 1.5px; width: 30px"></td> | ||
</tr> | ||
</table> | ||
<table> | ||
<tr> | ||
<td class='target' style="padding: 0 1.7px"><div></div> <div></div></td> | ||
<td style="padding: 0 1.7px; width: 30px"></td> | ||
</tr> | ||
</table> | ||
<script> | ||
test(() => { | ||
var targets = document.getElementsByClassName('target'); | ||
for (var i = 0; i < targets.length; ++i) { | ||
var divs = targets[i].getElementsByTagName('div'); | ||
assert_equals(divs.length, 2); | ||
assert_equals(divs[0].offsetTop, divs[1].offsetTop, 'Contents of td.target[' + i + '] should not wrap'); | ||
} | ||
}); | ||
</script> |