Summary: Add first version of test generation script. Currently works for most layouts and styles. Probably has a bunch of broken edge-case. Usage: $ gentest/gentest.sh <Enter HTML with inline styles> e.g. <div style="width: 100px; height: 100px;"></div> Open chrome dev tools console tab. Copy code from console into file and save. Run buck test //:CSSLayout Differential Revision: D3697812 fbshipit-source-id: e6809f95bf6782e7e2cc47b9cdd3a25a13163c5c
41 lines
700 B
HTML
41 lines
700 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>test page</title>
|
|
<script src="gentest.js"></script>
|
|
|
|
<style>
|
|
body {
|
|
padding: 0;
|
|
margin: 0;
|
|
font-family: Helvetica;
|
|
font-size: 14px;
|
|
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;
|
|
justify-content: flex-start;
|
|
flex-shrink: 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div>
|
|
|
|
%s
|
|
|
|
<div id='default'></div>
|
|
</div>
|
|
</body>
|
|
</html>
|