diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2015-08-01 17:42:37 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2015-08-03 22:30:20 +0100 |
commit | 8449bb0c102a0ff85e3dc8d4319fac531ea5374f (patch) | |
tree | fd86edde456e9534475e364264d9128379abcddb /dev | |
parent | ba2cea6270dc014bf2751f373404fa915d2c38b6 (diff) | |
download | libnslayout-8449bb0c102a0ff85e3dc8d4319fac531ea5374f.tar.gz libnslayout-8449bb0c102a0ff85e3dc8d4319fac531ea5374f.tar.bz2 |
Add simple development testing harness.
Diffstat (limited to 'dev')
-rw-r--r-- | dev/main.c | 31 | ||||
-rw-r--r-- | dev/test-writing-mode.html | 40 |
2 files changed, 71 insertions, 0 deletions
diff --git a/dev/main.c b/dev/main.c new file mode 100644 index 0000000..ca87816 --- /dev/null +++ b/dev/main.c @@ -0,0 +1,31 @@ +/* + * This file is part of LibNSLayout's tests + * Licensed under the ISC License, http://opensource.org/licenses/ISC + * Copyright 2015 Michael Drake <tlsa@netsurf-browser.org> + */ + +#include "../test/test-loader.c" + +/* + * cd ../ && make && make install && cd dev/ && gcc `pkg-config libnslayout --cflags` main.c `pkg-config libnslayout --libs` && ./a.out ; cd ~/dev-netsurf/workspace/libnslayout/dev + */ + + +static void lwc_iterator(lwc_string *str, void *pw) +{ + printf("[%3u] %.*s", str->refcnt, + (int)lwc_string_length(str), + lwc_string_data(str)); +} + +int main(void) +{ + nslayout_init(); + test_loader("test-writing-mode.html", CSS_MEDIA_ALL, 15); + nslayout_fini(); + + printf("Reamining lwc strings:\n"); + lwc_iterate_strings(lwc_iterator, NULL); + + return EXIT_SUCCESS; +} diff --git a/dev/test-writing-mode.html b/dev/test-writing-mode.html new file mode 100644 index 0000000..96c811e --- /dev/null +++ b/dev/test-writing-mode.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html> +<head> +<style> +html { + -ms-writing-mode: lr-tb; + -webkit-writing-mode: horizontal-tb; + -moz-writing-mode: horizontal-tb; + -ms-writing-mode: horizontal-tb; + writing-mode: horizontal-tb; +} +html:hover { + -ms-writing-mode: tb-rl; + -webkit-writing-mode: vertical-rl; + -moz-writing-mode: vertical-rl; + -ms-writing-mode: vertical-rl; + writing-mode: vertical-rl; +} +h1 { + background: #600; + color: #fff; + width: 50%; + margin: 0; + padding: 3px; + border-bottom: 2px solid black; +} +p { + margin: 0; + padding: 3px; + border: 1px solid green; + border-left-width: 1em; + margin-top: 3em; +} +</style> +</head> +<body> +<h1>Test</h1> +<p>Here's some text to test CSS3 writing modes <a href="https://drafts.csswg.org/css-writing-modes/#abstract-layout">abstract box layout</a>!</p> +</body> +</html> |