28 Commits
Author SHA1 Message Date
Liu 08778d8bf6 fix(yutil): strlist_sorted_add should not leave a dangling list
realloc() may move the array before the duplicate check returns
early, leaving *strlist pointing at freed memory. Assign the new
pointer before inspecting entries.

Refs GHSA-v42w-m2h7-fm23.
2026-11-24 21:49:21 +08:00
Liu ec5cd503fa fix(css): oversized selectors should not overflow parser buffers
- Cap the token buffer position across chunked input so a selector
  spanning 511-byte reads cannot write past css_parser_t::buffer.
- Reject selector names longer than MAX_NAME_LEN in
  css_selector_create() instead of writing past name[].
- Bound selector name composition in css_selector_collect_name()
  with explicit length checks.
- Fix trim-left in css_parser_commit() reading buffer[pos] instead
  of buffer[i] and moving the wrong number of bytes.

Fixes GHSA-v42w-m2h7-fm23.
2026-11-24 21:24:49 +08:00
Liu a9de756541 test(css): identify properties and cursor values in assertions 2026-11-21 15:58:52 +08:00
Liu edf192475d test(css): identify properties in inheritance assertions
The shorthand and default-inheritance checks reused one fixed description inside loops, so the log showed identical lines with no property context. Include the selector and property name in each assertion name.
2026-11-19 23:38:27 +08:00
Liu 9f1cb8a6e1 test: stabilize layout tests for Linux font metrics
Use Linux-specific expected heights for Ubuntu Mono wrapping, relax the auto-size width bound, and fix selector/style leaks in the CSS text decoration tests.
2026-11-19 22:03:59 +08:00
Liu a5444668ac test: unused helpers should be removed and footer initialized
Drop ad_count_children and count_by_type, which no longer have any callers, and initialize footer to NULL before scanning dialog children to silence GCC's -Wmaybe-uninitialized in release builds.
2026-11-19 01:19:58 +08:00
Liu 855855263b feat(css): add align-self support for flex items
- register align-self and resolve auto against the container align-items
- apply per-item alignment to measuring, cross-axis layout and static positions
- align item media icons with the first title line
2026-11-14 00:31:15 +08:00
Liu 1f46778893 fix(ui): stabilize layout measurement and style refresh
- restore intrinsic sizes before measuring flex and block children
- resolve percentage widths against indefinite parents as auto
- reflow parents when child content changes and refresh background geometry
- ignore hidden flex items in gap insertion and use spec static positions
- keep text paint size in sync with the current capture scale
2026-11-13 21:56:39 +08:00
Liu 844802374d feat(css): support cursor property with standard keyword values
Register the `cursor` property (36 standard keywords, no url() images),
add css_cursor_t, a 6-bit type_bits field and the 34 new keywords, and
implement css_cascade_cursor(). Defaults to `auto`.
2026-10-17 21:16:46 +08:00
Liu 604e9226e8 feat(css): add CSS property inheritance support 2026-10-17 21:16:44 +08:00
Liu 812391f1f5 feat(css): support CSS Color 4 rgb alpha syntax 2026-10-17 21:16:41 +08:00
Liu ae5b7d2ed9 feat(css): add text-decoration property 2026-10-17 21:16:41 +08:00
Liu 6cd01b468e chore: update copyright comment 2026-08-05 22:42:22 +08:00
Liu 7f9f52b904 chore: update copyright and email 2026-08-05 22:42:16 +08:00
Liu f54cd12539 feat(css): add gap, row-gap and column-gap support
Add the CSS gap shorthand and its row-gap/column-gap longhands for flex
containers.

- Register row-gap/column-gap as longhand properties and gap as a
  shorthand accepting [ normal | <length-percentage> ]{1,2}.
- Add css_gap_t (CSS_GAP_INHERIT/SET/NORMAL) and corresponding
  type/unit/value fields on css_computed_style_t.
- Implement cascade logic in lib/css/src/properties/gap.c, resolving
  normal to zero and rejecting auto.
- Apply gaps in ui_flexbox_layout: main-axis gap participates in line
  size, wrap detection, justify-content space and per-item positioning;
  cross-axis gap participates in cross-size accumulation and line
  positioning. The last item/line never gets a trailing gap. Percentage
  gaps resolve against the container content-box on the corresponding
  axis.
- Cover gap parsing/cascading in lib/css/tests (single/two values,
  axis-only, normal, percentage) and add a flex layout integration test
  exercising column-gap, row-gap, wrapped two-value gap and normal.
2026-08-05 22:41:30 +08:00
Liu 940a0fc33a chore: update copyright 2025-01-05 23:29:56 +08:00
Liu 85c34e6c31 feat(css): support selector containing escape characters 2024-12-07 13:30:30 +08:00
Liu d60ec9227d chore: update copyright year 2024-05-13 22:49:22 +08:00
Liu 023b35e245 chore: add copyright header 2024-05-13 22:49:20 +08:00
Liu 5c8186faad refactor: clear compiler warnings 2024-05-13 22:49:19 +08:00
Liu 59e3220370 style: euqal -> equal 2024-05-13 22:49:18 +08:00
Liu 549f8077a6 fix(ui): correct widget box comparison and dirty rectangle collection 2024-05-13 22:49:17 +08:00
Liu 7f409cb120 feat(css): add border-top/right/bottom/left shorthand properties 2023-08-27 17:55:05 +08:00
Liu 329b7c192d refactor: simplify naming and function parameters 2023-06-07 23:39:01 +08:00
Liu c2930907cb feat: add libui-router 2023-05-03 17:49:51 +08:00
Liu f3f1fc612c feat: update libctest 2023-05-02 14:44:41 +08:00
Liu cc5dfe4690 refactor: remove the dependency of libcss on LCUI 2023-04-01 22:36:09 +08:00
Liu e533853908 feat: update css library
feat(css): add css value definition parser

refactor(css): change the parameter types of css_parse_* functions

refactor(css): migrate to new data types

refactor(css): migrate to new data types (2)

refactor(css): migrate to new data types (3)

test: add valdef test

feat(css): add css_valdef_parser_finish()

refactor(css): split css_library.c

refactor(css): css_data_type.c -> css_data_types.c

fix(css): the parsing error message of sign is not truncated

fix(css): correct initialization of data type library

fix(css): error message should not be empty

feat(css): add css_valdef_to_string()

feat(css): add double bar combinator

feat(css): add double ampersand combinator

feat(css): add curly braces multiplier

feat(css): add brackets combinator parser

docs: update css value matcher section

feat(css): add question mark multiplier

test(css): add test for brackets combinator

docs(css): update libcss_css_value.md

docs: update directory structure

refactor: numberic -> numeric

refactor(css): delete style property parser

refactor: migrate to css property API

docs(css): add css value converter section

feat(css): add css_computed_style_t

refactor(css): rename `css_style` associated identifiers

feat(css): add css_cascade_style()

refactor(css): change type of css_value_matcher_t::value

refactor(css): update args of css_register_property()

refactor(css): move css_computed_style_t

feat(css): update opacity property

feat(css): update z-index property

feat(css): update display property

feat(css): update pointer-events property

feat(css): update flex-wrap property

feat(css): update flex-direction property

feat(css): update flex-grow property

feat(css): update flex-shrink property

feat(css): update align-items property

feat(css): update justify-content property

feat(css): update position property

feat(css): update box-sizing property

feat(css): update align-content property

feat(css): update white-space property

feat(css): update content property

feat(css): update text-align property

feat(css): automatically register new keywords

feat(css): update font-style property

feat(css): update visibility property

feat(css): update border-*-style property

refactor: update css_unit_t definition

feat(css): update border-*-*-radius properties

refactor(css): delete CSS_PERCENTAGE_VALUE

refactor(css): css_cascade_length() -> css_cascade_length_auto()

refactor(css): update enum definitions

feat(css): update border-*-width properties

feat(css): update border-*-color properties

feat(css): add css_array_value_get_length()

feat(css): add border-width shorthand property

feat(css): add border-style shorthand property

feat(css): add border-radius shorthand property

feat(css): add border-color shorthand property

feat(css): add border shorthand property

feat(css): add margin shorthand property

feat(css): add padding shorthand property

feat(css): update size related properties

feat(css): update top, right, bottom, left properties

feat(css): update flex-basis property

feat(css): update line-height property

feat(css): update color property

refactor(css): add css_cascade_bg_border_color()

refactor(css): bits -> keyword_bits

refactor(css): flag -> keyword

refactor(css): update css_color_value_t definition

feat(css): add CSS_COLOR_TRANSPARENT

refactor(css): remove transparent keyword

feat(css): update font-size property

feat(css): update font-family property

feat(css): update background shorthand property

feat(css): update vertical-align property

feat(css): update box-shadow property

feat(css): update the computing of the box-shadow property

 feat(css): update the computing of the background property

feat(css): update the computing of the border property

refactor(css): keyword_bits -> type_bits

refactor(css): enum css_*_e -> uint8_t

feat(css): add absolute size computing

feat(css): add absolute padding computing

feat(css): add absolute margin computing

style(css): format code

feat(css): add top, right, bottom, and left absolute value computing

feat(css): add flex-basis absolute value computing

refactor(ui): replace data type of computed style

feat(ui): update widget background style computing

feat(ui): update widget box-shadow style computing

feat(ui): update widget border style computing

feat(ui): update widget box computing

feat(ui): use tabindex instead of focusable

feat(css): remove focusable property

feat(css): update font-weight property

fix(css): clear compile errors

refactor(ui): adapt to new computed style data structure

refactor(ui): delete ui_widget_box_model_t

fix: clear some compiler warnings

refactor(ui): ui_font_style.c -> ui_text_style.c

feat(ui): remove unnecessary helper functions

fix: clear some compiler warnings

fix(font): correct bitmap cache access

fix(css): correct the key assignment of keywords

fix(css): some memory access errors

fix: missing NULL at the end of font names

fix: clear gcc errors

refactor: clear gcc warnings

fix(css): array subscript is above array bounds

fix(css): incorrect property name memory allocation

fix(css): style parser memory leak

fix(css): prop->valdef memory leak

refactor(css): logger_debug -> DEBUG_MSG

refactor(ui-builder): clear warnings

fix(css): css_properties.list memory leak

fix(css): css_style_link_group_create() memory leak

fix(css): incorrect keyword storage

test(css): correct color_value comparison

test: clear compiler errors

fix(css): correct the return value of css_register_keyword()

fix(css): correct integer type value parsing

chore(css): _DEBUG -> DEBUG

feat(css): add string value parsing

fix(css): correct font-family initial value

test(css): add test_css_computed.c

fix(css): value read error in css_cascade_background()

fix(css): add some missing properties

feat(css): add flex shorthand property

build: update rundir of lcui-css-test

fix(css): font-family parsing error

feat(css): style array value to string

chore(vscode): add compileCommands

fix(css): string value parsing error

fix(css): correct content property initial value

fix(css): the parsed style data is not stored correctly

fix(css): correct cascading of some properties

fix(css): percentage value parsing inccorect

fix(css): <length> should not contain <percentage>

fix(css): css_array_value_duplicate() did not copy the last value

feat(css): add visible keyword

feat(css): cascade each property in order

refactor(css): add style_decl.c

refactor(css): use css_style_decl_t instead of css_style_t

fix(css): incorrect number of resolved values

refactor(css): add css_style.c

feat(css): parse shorthand properties in the parsing phase

refactor(css): add background property parser

refactor(css): add border property parser

refactor(css): css_select_style_decl -> css_find_style_store

refactor(css): add css_select_style_with_cache()

refactor(css): add margin property parser

refactor(css): add padding property parser

refactor(css): add flex property parser

fix(ui): incorrect widget style cascading order

refactor(css): const css_propdef_t* -> css_propdef_t*

refactor(css): update arguments of shorthand property parser

fix(css): incorrect value parsing of shorthand property

fix(css): unexpected truncation while parsing color value

fix(css): correct value matching and style computing

fix(ui): correct css style operation

fix(platform): crash when closing window

refactor(css): delete file prefix

refactor(css): delete style.c

refactor(css): clear compiler warnings

refactor: update directory structure and build configuration

feat(css): add dump functions

fix(css): correct valdef parser cursor operation

fix(css): correct the definition of margin and padding

fix(css): correct flex property parsing and definition

refactor(ui): adjust the use of calculated styles in the layout engine

chore: tests/helloword -> examples/hello

fix(ui): some bugs in block layout

fix(css): correct flex property definition

refactor(ui): simplify the naming of widget style and layout diff API

refactor(ui): update reflow trigger rules

refactor(ui): ui_widget_auto_reflow -> ui_widget_reflow

feat(ui): allow multiple observers to connect to the same widget

refactor(ui): simplify widget update process

refactor(ui): adjust row processing in block layout

refactor(ui): adjust the data structure used in the flexbox layout

fix(ui): correct flex layout algorithm

build: update config
2023-04-01 22:36:07 +08:00