Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests and clean up *_mode_assign_inline_sizes
Clean up block_mode_assign_inline_sizes and inline_mode_assign_inline_sizes and add extra css tests.
- Loading branch information
1 parent
90ab488
commit e0454e0
Showing
3 changed files
with
84 additions
and
10 deletions.
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
67 changes: 67 additions & 0 deletions
67
tests/wpt/mozilla/tests/css/flex-item-assign-inline-size.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,67 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Test inline size against percentage</title> | ||
<style> | ||
#container { | ||
width: 500px; | ||
height: 500px; | ||
background: white; | ||
} | ||
#container > div { | ||
display: flex; | ||
background: red; | ||
} | ||
#container > div > div { | ||
background: green; | ||
} | ||
#flex-container0 { | ||
flex-direction: column; | ||
height: 20%; | ||
width: 10%; | ||
} | ||
#flex-item0 { | ||
width: 10%; | ||
} | ||
#flex-container1 { | ||
flex-direction: row; | ||
height: 20%; | ||
width: 10%; | ||
} | ||
#flex-item1 { | ||
width: 10%; | ||
background: green; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="container"> | ||
<div id="flex-container0"> | ||
<div id="flex-item0"> | ||
</div> | ||
</div> | ||
<div id="flex-container1"> | ||
<div id="flex-item1"> | ||
</div> | ||
</div> | ||
</div> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(function() { | ||
var flex_container0 = document.getElementById("flex-container0"); | ||
var flex_item0 = document.getElementById("flex-item0"); | ||
|
||
var flex_container1 = document.getElementById("flex-container1"); | ||
var flex_item1 = document.getElementById("flex-item1"); | ||
|
||
assert_equals(flex_container0.clientWidth, 50); | ||
assert_equals(flex_item0.clientWidth, 5); | ||
|
||
assert_equals(flex_container1.clientWidth, 50); | ||
assert_equals(flex_item1.clientWidth, 5); | ||
}); | ||
</script> | ||
</body> | ||
</html> |