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
79 lines
1.2 KiB
HTML
79 lines
1.2 KiB
HTML
<!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>
|
|
@font-face {
|
|
font-family: 'Ahem';
|
|
src: url('./fonts/Ahem.ttf') format('truetype');
|
|
}
|
|
|
|
body {
|
|
padding: 0;
|
|
margin: 0;
|
|
font: 10px/1 Ahem;
|
|
font-weight: 100;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
body>* {
|
|
position: absolute;
|
|
}
|
|
|
|
#ltr-container>* {
|
|
position: absolute;
|
|
direction: ltr;
|
|
}
|
|
|
|
#rtl-container>* {
|
|
position: absolute;
|
|
direction: rtl;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id='ltr-container'>
|
|
|
|
%s
|
|
|
|
<div id='default'></div>
|
|
</div>
|
|
<div id='rtl-container'>
|
|
|
|
%s
|
|
|
|
<div id='default'></div>
|
|
</div>
|
|
|
|
<div>
|
|
|
|
%s
|
|
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|