Commit Graph

951 Commits

Author SHA1 Message Date
mgambrell
4d82733621 add missing virtual destructors 2022-12-02 18:12:11 -05:00
mgambrell
a3fbd370a0 gumbo.h (and others) has two problems among them:
1. #define _CRT_SECURE_NO_WARNINGS is done unconditionally (but what if I've already done it?)
2. #define fileno _fileno is done unconditionally.. this actually is more related to compiling against the windows platform than using MSC. anyway a simple way to resolve it is to conditionalize it.
2022-12-02 18:09:16 -05:00
stasoid
758c51cf6e make web_color::is_color return false for identifiers that don't represent color
this fixes links with black background on Obama wiki
2022-12-01 18:50:39 +06:00
stasoid
df33364021 gdiplus_container: draw dotted, dashed and double borders
- "dots" are squares
- dashed border artifacts at corners are not handled
- double border artifacts at corners are not handled
2022-12-01 16:41:45 +06:00
Yuri Kobets
137038f94a
Merge pull request #229 from BailiFlyingCat/master
Solve the problem that the parent class calls the subclass function in the destructor
2022-11-29 00:30:44 +03:00
Yuri Kobets
ed5a551ec1
Merge pull request #228 from stasoid/master
document::createFromString optimizations
2022-11-29 00:30:22 +03:00
lich
11a681f5c8 Solve the problem that the parent class calls the subclass function in the destructor 2022-11-27 20:33:34 +08:00
stasoid
6ff77337fd remove tests that don't test anything 2022-11-27 13:26:56 +06:00
stasoid
c38cff9e4e readd var() support
I don't see any performance degradation on Obama wiki (which does not use vars)
2022-11-27 04:37:18 +06:00
stasoid
de4893f0b6 document::createFromString optimization:
Move css property parsing from css_properties::parse (which is called from html_tag::parse_styles for every tree node)
to style::add_property (which is called during stylesheet parsing).
document::createFromString: 1287 ms -> 1048 ms on Obama wiki
2022-11-27 02:48:04 +06:00
stasoid
25773b4943 This basically reverts commit 5a00888b "var()" to improve performance.
I'll readd var() support later in a way that doesn't hurt performance so much.
document::createFromString: 1730 ms -> 1287 ms on Obama wiki
2022-11-21 23:32:07 +06:00
stasoid
0ba38c6bde remove style::m_valid_values 2022-11-18 19:50:07 +06:00
stasoid
56c31aac10 remove attributes.h 2022-11-17 05:38:58 +06:00
Yuri Kobets
c61ede9dfa
Merge pull request #227 from stasoid/master
apply_stylesheet optimizations
2022-11-16 19:32:47 +03:00
stasoid
3798ad6cf4 fix cssTest.cpp 2022-11-16 14:54:57 +06:00
stasoid
e02ac9ce74 add element::tag() method 2022-11-16 09:07:27 +06:00
stasoid
a060e727c8 move pseudo-class parameter parsing to css_element_selector::parse 2022-11-16 08:26:02 +06:00
stasoid
7df81ba288 use string_id for tag names
apply_stylesheet: 1050 ms

I've changed _s to return const string& instead of string not because of performance, but because of this code in get_tagName:
return _s(m_tag).c_str();
2022-11-15 21:13:30 +06:00
stasoid
17f6854348 use string_id for class names
I've kept m_str_classes too for convenience.
apply_stylesheet: 1300 ms -> 1200 ms
I don't understand why the gain is so small. This commit replaces string comparisons with int comparisons on a very hot path.
2022-11-15 19:35:50 +06:00
stasoid
5707cf8a46 preparation before switching class names to string_id 2022-11-15 16:01:15 +06:00
stasoid
78bb7b21c4 separate #name from [id=name]
apply_stylesheet: 1300 ms
2022-11-15 15:34:53 +06:00
stasoid
5a60cb868e separate .name from [class=name] 2022-11-15 15:25:22 +06:00
stasoid
e14622ad9e create select_attribute method 2022-11-15 07:12:08 +06:00
stasoid
4dae578b09 create select_pseudoclass method to improve readability
this also speeds up apply_stylesheet: 1710 ms -> 1550 ms on Obama wiki
About 2/3 of the speedup is because parent() is not called every time. I don't know where the rest of the speedup comes from.
2022-11-14 09:38:55 +06:00
stasoid
32744df44d select optimization: don't call get_attr for class selectors
apply_stylesheet: 1883 ms -> 1710 ms on Obama wiki
2022-11-14 08:14:53 +06:00
stasoid
ac05726ac4 simplify class matching
this also speeds up apply_stylesheet (2146 ms -> 1958 ms on Obama wiki)
2022-11-12 16:19:39 +06:00
stasoid
07f940dffe small refactor 2022-11-12 15:00:05 +06:00
stasoid
5ab0448dd5 rename m_class_values -> m_classes 2022-11-12 05:54:01 +06:00
stasoid
bd2bb6cb8c apply_stylesheet optimization: reject some non-matching rules quickly
reduces apply_stylesheet time by 27% on Obama wiki (2910 ms -> 2120 ms)
2022-11-12 05:26:09 +06:00
stasoid
3cfa3b2155 remove css_attribute_selector::class_val
each .class has its own css_attribute_selector
2022-11-11 22:36:43 +06:00
Yuri Kobets
8a191eb64e
Merge pull request #226 from stasoid/master
add LITEHTML_NO_THREADS option (fixes #225)
2022-11-09 10:50:48 +03:00
stasoid
71f8d71f52 add LITEHTML_NO_THREADS option (fixes #225) 2022-11-09 13:40:39 +06:00
Yuri Kobets
7b09804fff
Merge pull request #224 from stasoid/master
parse_styles optimization: use string_id for CSS property names
2022-11-08 16:01:32 +03:00
stasoid
d3335a4f16 cosmetics 2022-11-07 23:46:35 +06:00
stasoid
9848d5b65b remove litehtml.sln 2022-11-07 23:25:42 +06:00
stasoid
d1179d5167 more wchar cleanup 2022-11-07 23:21:32 +06:00
stasoid
8c7621034f parse_styles optimization: use string_id for CSS property names
decreases parse_styles time by 37% (750 ms -> 468 ms on Obama wiki on my machine)
2022-11-07 22:11:00 +06:00
stasoid
f843d66fb3 win32_container: fixes for VS2022 2022-11-07 14:53:32 +06:00
Yuri Kobets
1a8b4c987e apply user css in document::append_children_from_string 2022-10-31 22:50:18 +03:00
Yuri Kobets
3a7954d04e
Merge pull request #222 from TobiasBohnen/TobiasBohnen-fix-font-weights
fix missing font-weights
2022-10-31 21:25:53 +03:00
TobiasBohnen
d5ff5eb375
added missing font weights to enum and string 2022-10-31 18:43:48 +01:00
TobiasBohnen
ab857afe9a
added missing font weights to switch 2022-10-31 18:42:09 +01:00
Yuri Kobets
6b38b1d4f1
Merge pull request #221 from stasoid/master
Remove litehtml::context, replace master.css -> master_css.h and make document::createFromString receive master/user css as strings
2022-10-31 19:23:13 +03:00
stasoid
d00f5d032b create document_container.h/cpp 2022-10-30 19:07:55 +06:00
stasoid
8927a44515 Remove litehtml::context, replace master.css -> master_css.h and make document::createFromString receive master/user css as strings
closes issue #219
2022-10-30 16:25:56 +06:00
stasoid
2a3091d505 win32_container: fix incorrect text length computation 2022-10-30 13:21:49 +06:00
Yuri Kobets
427b14aa2a
Merge pull request #218 from stasoid/master
remove wchar support
2022-10-21 16:44:07 +03:00
stasoid
a6177d1d5e remove wchar support
closes issue #217
2022-10-21 17:51:29 +06:00
Yuri Kobets
4b44982c06
Merge pull request #216 from stasoid/master
Update win32_container and gdiplus_container
2022-10-18 22:25:04 +03:00
stasoid
8e21841ad9 Update win32_container and gdiplus_container 2022-10-18 09:13:45 +06:00