Commit Graph

267 Commits

Author SHA1 Message Date
Andy Maloney
dffdeb6c40 {style} Use "= default" where possible
https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/checks/modernize/use-equals-default.html

Part of #336
2024-04-24 22:32:16 +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
Andy Maloney
3bd39a2366 Two small fixes
- remove const on bool parameter
- replace problematic character encodings in comments in stylesheet.cpp
2024-04-22 00:07:20 +03:00
Andy Maloney
a55b89f012 Modernize some code based on static analysis
- replace deprecated c-style headers
- including iso646.h has no effect in C++
- use bool instead of int
- replace typedefs with "using"
2024-04-20 04:23:36 +03:00
Andy Maloney
a6eb6e6197 These strings are not modified, so pass by ref
Also use .empty() instead of equality.
2024-04-18 19:04:56 +03:00
Andy Maloney
2752a1fa8c document_container destructor should be virtual 2024-04-18 01:08:08 +03:00
Yuri Kobets
b53da3e508 added #include <cstdint> to fix compilation errors 2024-04-16 01:30:34 +03:00
stasoid
f6ebf12e28 add comment 2024-04-15 06:37:06 +05:00
stasoid
75aec46870 cleanup 2024-04-13 13:12:00 +05:00
stasoid
40750a2e28 cleanup 2024-04-12 18:12:33 +05:00
stasoid
5dc6f9153d Merge remote-tracking branch 'upstream/master' 2024-04-11 13:06:19 +05:00
stasoid
5e7c2b7a14 cleanup 2024-04-11 12:55:25 +05:00
stasoid
78ca14ea32 support currentcolor 2024-04-10 10:23:38 +05:00
stasoid
41ce3de06f web_color::from_ident -> parse_color 2024-04-10 09:52:46 +05:00
stasoid
ab216b2f15 fix linux build
* gcc 9.4 doesn't support non-ascii identifiers (ε 🡒 epsilon, π 🡒 pi)
* media_query.cpp: '<=' 🡒 u'⩽' to fix gcc warning, media_query.cpp now has UTF-8 BOM for Visual Studio, alternatively /utf-8 compiler switch can be used
2024-04-10 08:51:24 +05:00
Petr Kobalicek
ccd05a010b Fixed compiler warnings produced by gcc/clang at -Wall -Wextra levels
* delete called on non-final 'litehtml::line_box_item' that has
    virtual functions but non-virtual destructor
  * definition of implicit copy constructor for 'typed_int' is
    deprecated because it has a user-provided copy assignment operator
  * suggest braces around initialization of subobject
2024-04-10 02:54:38 +03:00
stasoid
4c26e02618 fix windows cmake build 2024-04-09 19:51:00 +05:00
stasoid
56d7222b08 fix font-weight 2024-04-09 19:25:07 +05:00
stasoid
e381714a35 cleanup css_length.cpp 2024-04-09 18:45:32 +05:00
stasoid
916576c0ca cleanup web_color.cpp 2024-04-09 16:45:53 +05:00
stasoid
8007e72dcd move gradient parsing to gradient.cpp 2024-04-09 15:57:11 +05:00
stasoid
9324c9a06f ensure CSS tokenizer always works on a valid UTF-8 string 2024-04-09 15:17:48 +05:00
stasoid
dd140a1707 use litehtml::variant with property_value 2024-04-09 14:36:53 +05:00
stasoid
3154b7248d cleanup html.h 2024-04-09 14:20:10 +05: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
Yuri Kobets
e32bcf584a removed assert from html_tag::get_property 2024-03-31 18:06:47 +03:00
Yuri Kobets
b9ec0c5047 utf8: replace some other wchar with char32_t in utf8 code 2024-03-31 00:25:44 +03:00
Yuri Kobets
66e0f0cc32 utf8: use char32_t in utf8 conversions.
utf8_to_wchar is renamed to utf8_to_utf32
wchar_to_utf8 is renamed to utf32_to_utf8
2024-03-31 00:25:44 +03:00
stasoid
54646bdbda Merge remote-tracking branch 'upstream/master' 2024-03-29 08:59:35 +05:00
Yuri Kobets
8f647f1188 Some fixes in gradients parsing and rendering
* Issues with multiline in gradient definitions
* Parsing angles
* Preprocess transparent color
2024-03-29 03:04:40 +03:00
Yuri Kobets
3307c8d875 Added support for repeating gradients 2024-03-29 03:04:40 +03:00
Yuri Kobets
7d1ca0328f Added support for conic gradient 2024-03-29 03:04:40 +03:00
Yuri Kobets
333109cd75 some cleaning 2024-03-29 03:04:40 +03:00
Yuri Kobets
c09b943216 draw radial gradient 2024-03-29 03:04:40 +03:00
Yuri Kobets
9cbf84edc6 Parse radial gradient 2024-03-29 03:04:40 +03:00
Yuri Kobets
e455a0b50f Background draw redesigned. Linear gradient support. 2024-03-29 03:04:40 +03:00
Yuri Kobets
9a6f1d9892 Support for inherit value for he background property 2024-03-29 03:04:40 +03:00
Yuri Kobets
58a1db79b9 Background parsing fixex. Added support for linear gradient 2024-03-29 03:04:40 +03:00
stasoid
60d912a5be get_color_property -> get_property<web_color>, etc. 2024-03-23 21:04:52 +05:00
stasoid
55612fcc7c Convert property_value to use std::variant 2024-03-23 20:07:28 +05:00
stasoid
434054cf76 fix Visual Studio warnings 2024-03-07 17:18:48 +03:00
stasoid
c81d16368b implement "prescan the byte stream to determine its encoding" 2024-03-07 17:18:48 +03:00
stasoid
a2b0035649 remove some litehtml:: from document.h 2024-03-05 12:11:29 +03:00
stasoid
4cd7347888 Support standard HTML character encodings 2024-03-05 12:11:29 +03:00
Yuri Kobets
289c153aa6 flex: bug in processing box-sizing in flex items (#295) 2024-02-26 03:10:11 +03:00
Yuri Kobets
738275bc30 Revert "Fix windows build issues."
This reverts commit e8788a97ef.
2024-02-25 19:40:52 +03:00
Grzegorz Makarewicz
4e73b58ee1
Merge branch 'litehtml:master' into master 2024-02-24 01:09:58 +01:00
Matthew Allen
e8788a97ef Fix windows build issues. 2024-02-19 21:41:56 +11:00
m32
082b83f680 -Wpedantic 2024-02-18 13:03:12 +01:00
Yuri Kobets
f0fb2eea07 Linux container: added support for borders style
Added support for styles:
dotted, dashed, double, inset, outset, groove, ridge
2024-02-10 01:17:36 +03: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
Yuri Kobets
cca054779b flexbox: some tests are resolved 2024-01-31 02:36:05 +03:00
Yuri Kobets
ef70eefe4f flexbox rendering fixes 2024-01-28 02:38:20 +03:00
Yuri Kobets
f195ffbd08 flex: refactoring flexbox redering 2024-01-25 23:46:30 +03:00
Yuri Kobets
7f77236246 flex: support for auto-margins in the cross direction 2024-01-11 03:08:38 +03:00
Yuri Kobets
b6e60a6803 flex: added support for align-items: baseline 2024-01-09 02:44:04 +03:00
Yuri Kobets
88e255c37c flex: support for items max-width/max-height and auto-margins 2024-01-06 03:19:02 +03:00
Yuri Kobets
691965bf2e flex: fix auto-shrink tests 2024-01-04 16:08:49 +03:00
Yuri Kobets
a230188b31 flex: fixes in rendering of the justify-content css property 2023-12-29 03:46:49 +03:00
Yuri Kobets
23a8523cdf Scale borders radius to prevent corner overlap
Ref: https://www.w3.org/TR/css-backgrounds-3/#corner-overlap
Also changes in cairo_linux container to support corners with different
radius.
2023-12-29 00:27:30 +03:00
MichelCalonder
c6954248d6 reverted whitespace-only changes 2023-12-28 19:40:26 +01:00
Yuri Kobets
76ffcfa841 flex: more flex tests passed 2023-12-28 02:54:09 +03:00
MichelCalonder
05ae1051ee used string_id instead of string 2023-12-26 07:15:55 +01:00
MichelCalonder
b9368a4bc1 support for counter_s_ 2023-12-25 11:18:00 +01:00
Yuri Kobets
6922a8497d flex: fixed rendering issues 2023-12-25 01:15:43 +03:00
Yuri Kobets
ce7d5a16fc flex: added support for align-content property 2023-12-23 17:31:09 +03:00
Yuri Kobets
bf940939d8 flex: added order property support 2023-12-23 03:49:38 +03:00
Yuri Kobets
d764b9fa64 added support row-reverse and column-reverse for flex-direction 2023-12-22 01:23:38 +03:00
MichelCalonder
ff6aa5fcc5 included siblings in search so exapmple 2 (H1/H2, not nested) works too 2023-12-21 18:42:48 +01:00
Yuri Kobets
90b3dff03c added support for start, end values for align_items css property 2023-12-21 02:24:11 +03:00
MichelCalonder
08bf1aa685 moved m_counter_values and corresponding functions to element.h 2023-12-20 06:51:15 +01:00
Yuri Kobets
33b8699a3c flex layout: support for flex-direction: column 2023-12-17 16:46:49 +03:00
MichelCalonder
391e71a6ef started support int values for counter-reset and counter-increment 2023-12-13 07:44:32 +01:00
MichelCalonder
28f72f8a32 moved isnumber to html helper functions for later reuse 2023-12-13 07:41:16 +01:00
MichelCalonder
c6faa2e6c7 fixed issue after merge (due to beautifying, type change from elements-vector to elements-list was not auto-merged) 2023-12-08 19:33:26 +01:00
Yuri Kobets
d1eedd33a4
Merge branch 'master' into css_counters_basic 2023-12-08 18:27:32 +03:00
MichelCalonder
871d08390a basic implementaion for css counters 2023-12-08 15:36:50 +01:00
Yuri Kobets
7117be9018 flex layout: small refactoring 2023-11-07 01:41:05 +03:00
Yuri Kobets
6d065eaef5 flex layout - the first implementation 2023-11-05 17:04:28 +03:00
Yuri Kobets
d4409bc232 Added support for caption-side CSS property 2023-08-01 17:49:24 +03:00
Yuri Kobets
96769e7a29 Added tags figure and fugcaption into master css 2023-08-01 16:22:52 +03:00
Yuri Kobets
92ce50b7fb refactor render_item based classes
All render_item based classes are moved into the own headers
2023-06-13 00:36:18 +03:00
Yuri Kobets
14b31106c3 fixed rendering of ::before and ::after elements
* now ::before and ::after elements are created if content is not
  defined
* styles ::before and ::after without other selectors are applied
  to the already created before/after elements
2023-06-08 04:28:18 +03:00
Yuri Kobets
0c700d2409 optimization: elements_vector replaced with elements_list
Also added element::children() method.
Closes issue #27
2023-06-07 15:47:51 +03:00
Yuri Kobets
672b603eff Process align attribute for table tag via master.css
Fixes issue #114
2023-06-07 03:03:54 +03:00
Yuri Kobets
7ec04267b1 Fixed calculating min with for elements with floats
Fixes issue #99
2023-06-07 02:52:59 +03:00
Yuri Kobets
b0a6930308 Optimizing floating boxes rendering
* is_floats_holder function is renamed to is_block_formatting_context
* All floating boxes related functions are moved to new class formatting_context
* The class formatting_context was passed as argument to the render
  function
* render function is now is wrapper for _render. The render function
  creates formatting_context when required
2023-06-06 00:29:19 +03:00
Yuri Kobets
87c622789a blocks re-rendering refactor
moved display property based re-rendering from render_item_block::render
to the top functions: place_float, place_inline and
render_item_block_context::_render_content
2023-05-28 18:53:39 +03:00
Yuri Kobets
03104d39e0 fixed floating boxes rendering, apply box-sizing to min/max width/height 2023-05-13 02:24:36 +03:00
Yuri Kobets
3b896beede changed signature of document_container::set_clip
Removed arguments valid_x and valid_y because they are always true
2023-05-12 18:13:13 +03:00
Yuri Kobets
819c20e682 fixed rendering elements with position absoute and fixed
Also:
* refactoring: have_parent is replaced with is_root in render_item
* fixed: The tag <body> is not floats holder by default
* expanding <html> and <body> elements auto-expanding up to client
  rectangle
2023-05-12 17:29:44 +03:00
Yuri Kobets
ec2d94639f fixed rendering of <html> and <body> tags
* Removed "width: 100%; height: 100%" from <html> style
* extend <html> and <body> elements to the client rectangle if
  width/height is auto
* Reverse inherit for <html> background is working again
* Always draw <html> element background into document clipping area to
  fill entire "browser window".
* Added document::content_width and document::content_height. These
  methodts return the document size without <html> and <body> tags for
  using in tests and other applications
2023-05-12 00:06:54 +03:00
Yuri Kobets
3ba397469c refactoring: rename have_parent to is_root 2023-05-10 02:13:33 +03:00
Yuri Kobets
0a1b32aedb Rendering refactoring
* max_width argument removed from _render function
* added render_width into containing_block_context structure. This
  member should be used to render element instead of max_width
* _render protected function is replaced with render function
* apply auto-margins from parent element. Auto margins must not be
  applied inside render function
2023-05-09 02:51:03 +03:00
Yuri Kobets
dea6f7fad5 fix re-render table into returned min width in block context 2023-04-25 02:26:21 +03:00
Yuri Kobets
714d234090 fixed support for box-sizing: border-box 2023-04-24 00:20:26 +03:00