Add test support for intrinsic sized nodes (#1671)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1671 This diff adds support for intrinsic sizing in generated tests. This is done by importing a testing font called "Ahem" which, as used, has an exact width and height of 10px for each character. Support has been added for C++, Java, and Javascript generated tests. Reviewed By: NickGerleman Differential Revision: D58307002 fbshipit-source-id: e1dcc1e03310d35a32e0c70f71994880d8f7de55
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0888b20098
commit
1a3bc6bfbc
@@ -1,70 +1,78 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>%s</title>
|
||||
<script src="gentest.js"></script>
|
||||
<script src="gentest-cpp.js"></script>
|
||||
<script src="gentest-java.js"></script>
|
||||
<script src="gentest-javascript.js"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-family: Helvetica;
|
||||
font-size: 14px;
|
||||
font-weight: 100;
|
||||
}
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>%s</title>
|
||||
<script src="gentest.js"></script>
|
||||
<script src="gentest-cpp.js"></script>
|
||||
<script src="gentest-java.js"></script>
|
||||
<script src="gentest-javascript.js"></script>
|
||||
|
||||
div, span {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
border: 0 solid black;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
align-content: flex-start;
|
||||
justify-content: flex-start;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Ahem';
|
||||
src: url('./fonts/Ahem.ttf') format('truetype');
|
||||
}
|
||||
|
||||
body > * {
|
||||
position: absolute;
|
||||
}
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font: 10px/1 Ahem;
|
||||
font-weight: 100;
|
||||
}
|
||||
|
||||
#ltr-container > * {
|
||||
position: absolute;
|
||||
direction: ltr;
|
||||
}
|
||||
div,
|
||||
span {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
border: 0 solid black;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
align-content: flex-start;
|
||||
justify-content: flex-start;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
#rtl-container > * {
|
||||
position: absolute;
|
||||
direction: rtl;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
body>* {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
<body>
|
||||
<div id='ltr-container'>
|
||||
#ltr-container>* {
|
||||
position: absolute;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
%s
|
||||
#rtl-container>* {
|
||||
position: absolute;
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
<div id='default'></div>
|
||||
</div>
|
||||
<div id='rtl-container'>
|
||||
</style>
|
||||
</head>
|
||||
|
||||
%s
|
||||
<body>
|
||||
<div id='ltr-container'>
|
||||
|
||||
<div id='default'></div>
|
||||
</div>
|
||||
%s
|
||||
|
||||
<div>
|
||||
<div id='default'></div>
|
||||
</div>
|
||||
<div id='rtl-container'>
|
||||
|
||||
%s
|
||||
%s
|
||||
|
||||
<div id='default'></div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
%s
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user