Commit Graph

135 Commits

Author SHA1 Message Date
Yuri Kobets
01cb5911f1 Move tests to the another repository
Tests are moved to this repository:
https://github.com/litehtml/litehtml-tests
2024-09-11 01:15:23 +03:00
Yuri Kobets
78f08f3080 Tests update
1. Using container_cairo_pango for running tests.
2. Added Dockerfile to create docker container for building litehtml
   tests
3. Added script run_render_tests.sh to build litehtml tests in the
   docker container
4. Added render2png target (cmake -DLITEHTML_BUILD_RENDER2PNG). This
   utility allow to render html file into a png file.
5. Tests building are off by default.
   Use "cmake -DLITEHTML_BUILD_TESTING=ON" command to buid tests
6. Added container_cairo_pango::get_font_options. Overwrite this method
   to control fonts rendering.
2024-09-10 02:20:02 +03:00
Yuri Kobets
94104fb60d exclude support folders from render test 2024-08-19 16:34:02 +03:00
stasoid
cf59a56269 fix margin-bottom-043.htm
This only partially fixes the problem exhibited by the test. We still lose precision when converting points to int. document_container::pt_to_px() should take float.
2024-06-01 23:40:54 +03:00
stasoid
3598c7a208 render_test: refactoring 2024-06-01 23:40:54 +03:00
stasoid
1393ff5f21 fix list-style-020.htm
marker positions are still a bit wrong though
2024-05-25 23:00:54 +03:00
stasoid
313b647923 render_test: colorize output in standalone mode
https://stackoverflow.com/questions/62936815/how-to-color-output-in-c-for-cross-platform-app
Windows hack:
https://bugs.python.org/issue30075#msg291732
Windows proper usage:
https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#example
https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#text-formatting
2024-05-25 23:00:54 +03:00
stasoid
c264530997 render_test: use <filesystem> instead of <dirent.h>, <sys/stat.h> 2024-05-25 23:00:54 +03:00
stasoid
a038b36c6d render_test: add -d option to compare png files 2024-05-20 00:40:31 +03:00
stasoid
b2c775434e render_test: print summary in standalone mode 2024-05-20 00:40:31 +03:00
stasoid
27696b8d8e test_container: correctly draw multicolor borders 2024-05-20 00:40:31 +03:00
stasoid
28bbe74ec9 test_container: support TTF fonts 2024-05-20 00:40:31 +03:00
stasoid
218eb74ae8 make m and w more bold in terminus-16px-bold.yaff
They didn't look bold enough. There is no space, so I made m/w wider. This makes terminus-16px-bold.yaff a variable-width font, which may be confusing because normal weight variant is monospace. I also used this variable-width opportunity to improve NMW glyphs.

Rendering of css-box-justify-content.htm changed because width of nbsp is computed correctly now.
2024-05-20 00:40:31 +03:00
stasoid
6c4e6ef10a test_container: add terminus-16px-bold.yaff 2024-05-20 00:40:31 +03:00
stasoid
30e4fd105c test_container: support list-style-type disc and circle 2024-05-16 22:54:49 +03:00
stasoid
802b039e62 cleanup 2024-05-16 22:54:49 +03:00
stasoid
60bd9f18f1 implement gradient color transition hints 2024-05-16 22:54:49 +03:00
stasoid
c80a2a08e9 use optional<css_length> in gradient::color_stop
unitless 0 is a valid length value, stop using it as a <no length> value
2024-05-16 22:54:49 +03:00
stasoid
bb60063a62 fix repeating-conic-gradient 2024-05-16 22:54:49 +03:00
stasoid
423bb82412 canvas_ity: handle zero radius of radial gradient 2024-05-16 22:54:49 +03:00
stasoid
62de3475f3 test_container: add ability to use background repeat styles with gradient images 2024-05-16 22:54:49 +03:00
stasoid
3af10950e7 fix conic-gradient-2.htm 2024-05-16 22:54:49 +03:00
stasoid
869a3cd8ea test_container, canvas_ity: implement conic-gradient 2024-05-16 22:54:49 +03:00
stasoid
70fafc0b86 test_container, canvas_ity: implement radial-gradient
Radial gradient supported by canvas_ity is different (two circles vs one ellipse in CSS), so I implemented new brush type, css_radial. It is created with canvas::set_css_radial_gradient().
2024-05-16 22:54:49 +03:00
stasoid
d8a612adc6 add 2 linear-gradient tests 2024-05-16 22:54:49 +03:00
stasoid
eadeeefbd9 test_container, canvas_ity: do not linearize colors to match Chrome/Firefox gradient rendering
Old behavior is still available with #define CANVAS_ITY_IMPLEMENTATION LINEARIZE_RGB

Comparison of rendering linear-gradient-1.htm with and without LINEARIZE_RGB:
![image](https://github.com/stasoid/test/assets/2577509/074f2593-1beb-49f6-a387-370a8dfedaad)

Browsers don't render gradients identically, so I use max_color_diff() to compare them.
It measures max difference in each RGBA component in each pixel.
                                                 max_color_diff
chrome vs firefox                                1
chrome vs canvas_ity without linearized colors   1
chrome vs canvas_ity with linearized colors      74
2024-05-16 22:54:49 +03:00
stasoid
7b0d9e33a5 test_container: remove unused code 2024-05-16 22:54:49 +03:00
stasoid
44ac33f825 test_container: convert to using canvas_ity 2024-05-16 22:54:49 +03:00
stasoid
1611b789f1 don't ignore @import after bad rules 2024-05-11 13:21:22 +03:00
stasoid
c51f0defba render_test: getcwd is redundant 2024-05-11 13:21:22 +03:00
stasoid
ddbdf8a67a add padding test 2024-05-11 13:21:22 +03:00
stasoid
430d5a127f render_test: add ability to run standalone (without gtest) 2024-05-11 13:21:22 +03:00
stasoid
0e2dd95528 remove cssTest.cpp and mediaQueryTest.cpp, they are covered by render tests now 2024-05-04 23:31:55 +03:00
stasoid
e207a989f9 add media query tests, fix @media not unknown 2024-05-04 23:31:55 +03:00
stasoid
99dd1ffec7 test_container: support images 2024-05-04 23:31:55 +03:00
stasoid
78ad19a0fd test_container: support nbsp 2024-05-04 23:31:55 +03:00
stasoid
3c2ca4fbbc render_test: remove redundant resize 2024-05-04 23:31:55 +03:00
stasoid
4c3e774bbf add selector tests for 8 previous commits 2024-04-29 20:24:16 +05:00
stasoid
053824996e fix parsing selector [x|=a] 2024-04-23 10:28:22 +03:00
stasoid
639d44f645 fix #338 2024-04-23 10:28:22 +03:00
Yuri Kobets
554fcc70b4 fix: image::is_empty returns invalid value for type none (#326) 2024-04-23 03:07:22 +03:00
stasoid
0137aa400a fix @import 2024-04-22 00:11:45 +03:00
stasoid
7065da66f2 Merge remote-tracking branch 'upstream/master' 2024-04-09 13:17:47 +05:00
stasoid
3226d74add Add standard-compliant css parser 2024-04-09 10:12:46 +05:00
stasoid
986a9c53a6 add test for utf_8_decoder 2024-03-07 17:18:48 +03:00
Yuri Kobets
289c153aa6 flex: bug in processing box-sizing in flex items (#295) 2024-02-26 03:10:11 +03:00
stasoid
82982bffda fix min/max on Windows 2024-02-22 21:20:07 +06:00
Matthew Allen
e8788a97ef Fix windows build issues. 2024-02-19 21:41:56 +11:00
Yuri Kobets
d4453f5d4e Refactoring for zero warnings
Added compiler options: -Werror -Wall -Wextra -Wpedantic
2024-02-01 01:32:13 +03:00
Yuri Kobets
d85ebec101
Merge branch 'master' into flex_layout 2024-01-31 03:46:27 +03:00