Commit Graph

4265 Commits

Author SHA1 Message Date
Martín Lucas Golini
bd9e70fb83 Fixes in how we process the CSS selector specificity.
Fixes in selector rule parser.
Stub implementation for attributes filter in CSS.
Fixes in `background-position` and `background` shorthand parsers.
Added a few HTML elements tags.
Added body default left and right margin.
2026-05-11 14:43:24 -03:00
Martín Lucas Golini
d2d13cbe41 Fixed a few HTML+CSS parsing errors.
Fixed a crash when loading fonts from web.
Add support for scientific notation in stylesheet lengths.
2026-05-11 00:51:43 -03:00
Martín Lucas Golini
a38ffe2532 Inherit UIHTMLInput from UIHTMLWidget. 2026-05-10 14:26:47 -03:00
Martín Lucas Golini
cafdefbf4a Fix auto-size for HTML images.
Added visibility property support.
Fix display: none.
Added figure and figcaption HTML tags.
2026-05-10 01:55:19 -03:00
Martín Lucas Golini
24bc5edd72 Fixes in whitespace collapsing, added white-space-collapse to the CSS specification. 2026-05-09 21:26:16 -03:00
Martín Lucas Golini
792bae6da2 Make UITextNode easily debuggable by setting its position and size. 2026-05-09 20:05:35 -03:00
Martín Lucas Golini
23b14ba2fe Fix unit-tests (ups).
Fix an issue when setting an invalid color to the terminal display.
Update efsw.
2026-05-09 19:52:06 -03:00
Martín Lucas Golini
9255cf8c35 Nit in UITextNode. 2026-05-09 19:26:52 -03:00
Martín Lucas Golini
10fa8f7411 Fix ex and ch units. 2026-05-09 02:22:06 -03:00
Martín Lucas Golini
f4f30c9979 Improve line-height support (add correct percentage support). 2026-05-09 01:56:55 -03:00
Martín Lucas Golini
bc071bd88d Add line-height and text-indent support. 2026-05-09 01:38:43 -03:00
Martín Lucas Golini
0c3df503b4 Fix in background sizing when using pixel-density != 1. Updated new background tests due to the windowing size issues in the macOS CI. 2026-05-09 00:30:33 -03:00
Martín Lucas Golini
e94550a049 ui: Full HTML background property support + whitespace collapsing rewrite
Part 1: CSS background properties (UINodeDrawable, LayerDrawable)
Add `BackgroundMode` (Native / Html) to `UINodeDrawable`. When Html mode
is active, background rendering follows CSS/HTML semantics (repeat defaults
to repeat, clip plane always enabled, etc.). Native mode preserves the
original eepp behavior (no-repeat by default, clip only when repeating).
Add per-layer `background-origin`, `background-clip`, `background-attachment`
with `fromText` parsers and CSS property registration. `background-origin`
controls the reference box for position/percentage resolution.
`background-clip` enables per-layer content-box clipping.
`background-attachment: fixed` anchors the background to the scene root;
`local` is stubbed (needs per-widget scroll offset plumbing).
Replace the single `Repeat` enum with `RepeatX` / `RepeatY` enums supporting
two-value repeat (e.g. "repeat no-repeat", "space round"). Implement space
and round repeat rendering in `LayerDrawable::draw()`.
Fix `background-size: contain` to scale up (not just down) like HTML.
Rewrite the comma-separated multi-layer `background` shorthand parser with
`/size` separator, box keyword disambiguation, and attachment keywords.
UINode::{getBackground} detects `UI_HTML_ELEMENT` flag and lazily sets
`BackgroundMode::Html`.
Add golden image test: 20-tile image atlas via
`background: url(bnp.png) pos / size no-repeat` with browser-comparable HTML.
Part 2: HTML whitespace collapsing (HTMLFormatter → UIRichText)
Move whitespace collapsing from parse time to layout time. Previously
`HTMLFormatter::collapseXmlWhitespace` ran on the pugixml DOM before
CSS was resolved, using tag-name heuristics for inline/block detection.
This caused whitespace between elements with `display: inline-block`
(via CSS) to be incorrectly stripped.
The new pipeline preserves raw whitespace in `UITextNode` widgets (after
internal whitespace collapsing via `UIRichText::collapseInternalWhitespace`)
and defers boundary stripping to `UIRichText::rebuildRichText`, where every
widget's computed `CSSDisplay` is available via `UIWidget::isInlineDisplay()`.
- `UIWidget::isInlineDisplay()` returns true for text nodes and widgets
  with `CSSDisplay::Inline | InlineBlock`, used by boundary logic.
- `UITextNode::isWhitespaceOnly()` identifies collapsible text nodes.
- `findLogicalPrev/Next` walks up through inline ancestors to find the
  correct boundary element, matching HTML's whitespace transparency rule.
- Boundary stripping: leading/trailing spaces removed at block edges,
  preserved between inline-level siblings.
- Double-space prevention: when adding text that starts with a space,
  peeks at the last `SpanBlock` in RichText if it ends with a space,
  the leading space is stripped. This prevents consecutive spaces when
  whitespace nodes are separated by empty inline elements.
- `UITextNode::mLayoutCharCount` syncs the character index between
  `rebuildRichText` (where boundary-stripped text is added) and
  `positionRichTextChildren` (where widgets are mapped to render spans),
  fixing hitbox alignment for all text-bearing widgets.
Remove `HTMLFormatter::collapseXmlWhitespace`, `isInlineNode`,
`hasSignificantText`, `getLogicalPrev`, `getLogicalNext`, and the
`precomputeDisplayStyles` hack (~200 lines removed). `HTMLFormatter`
now only exposes `HTMLtoXML`.
Other fixes
- Remove `@import url(https://fonts.googleapis.com/css?family=Lato)`
  from ensoft.css (async HTTP use-after-free in test suite).
- `BlockLayouter::positionRichTextChildren` skips whitespace-only text
  nodes when advancing the character index.
- Fix in DrawableSearcher not finding already loaded textures.
2026-05-08 22:13:07 -03:00
Martín Lucas Golini
7452cbf492 Fix mingw build on openSUSE. 2026-05-08 18:01:41 -03:00
Martín Lucas Golini
a870a278bb Forgot to update versioning. A couple of minor nits. 2026-05-08 16:50:46 -03:00
Martín Lucas Golini
02a9c3708b Pump internal remote SDL2 version. 2026-05-07 20:11:07 -03:00
Martín Lucas Golini
8f13e62dd7 Slightly debounce UICodeEditorSplitter::addEditorPositionToNavigationHistory. 2026-05-06 22:48:57 -03:00
Martín Lucas Golini
dc603d4275 Some rendering optimizations. 2026-05-05 01:42:54 -03:00
Martín Lucas Golini
336afe90d7 Fixed a rendering bug in the terminal emulator when updated line only updated spaces.
Added an optimization for scene loading.
Do not allow the spell checker renderer to try to render on too long lines.
2026-05-04 19:30:56 -03:00
Martín Lucas Golini
19c0f15196 Merge branch 'feature/sdl3' into develop 2026-05-04 12:21:19 -03:00
Martín Lucas Golini
02b6076cee mojoAL SDL3 2026-05-04 11:47:54 -03:00
Martín Lucas Golini
9e3c13903d Improve percentage resolution in HTML elements. 2026-05-03 19:49:38 -03:00
Martín Lucas Golini
da30372aae Remove concepts dependency, switch temporally Linux nightly to clang. 2026-05-03 19:40:56 -03:00
Martín Lucas Golini
03a798820d Fix percentage resolution when parent is WrapContent (only for height's, for width we need to do some extra changes in layouters, added a plan to fix it later). 2026-05-03 12:32:27 -03:00
Martín Lucas Golini
7150633c1a Fixes in URI implementation to handle some special cases, added some tests too.
Fix flaky test.
Renamed tests to have consistent naming.
2026-05-03 02:22:37 -03:00
Martín Lucas Golini
ecf7c20262 Fix foreground-radius definition. 2026-05-03 00:48:13 -03:00
Martín Lucas Golini
2dcc787ed7 Fix top + bottom and left + right html element expanding. 2026-05-03 00:33:32 -03:00
Martín Lucas Golini
a698348abd Improve font loading and URL handling in external CSS. 2026-05-02 23:55:45 -03:00
Martín Lucas Golini
fcb2cca844 Fixes for position: sticky, absolute and fixed. 2026-05-02 19:41:10 -03:00
Martín Lucas Golini
393a784e8f Merge branch 'develop' into feature/sdl3 2026-05-02 14:45:56 -03:00
Martín Lucas Golini
89329123fb Added UIWebView and ui_html now uses that. 2026-05-02 14:45:07 -03:00
Martín Lucas Golini
1bd29d5df2 Should fix windows build. 2026-05-02 01:50:58 -03:00
Martín Lucas Golini
3226efdb24 Do not allow to set width and height of html and body from CSS since they need to have very specific sizing. 2026-05-02 01:47:08 -03:00
Martín Lucas Golini
307d9249ac Add float and clear support.
Fixes in Base64 implementation.
Fixes in remote image loading.
2026-05-02 01:12:13 -03:00
Martín Lucas Golini
d54fd398f6 Fix bad includes.
Add very hacky and basic overflow support.
2026-05-01 19:06:36 -03:00
Martín Lucas Golini
e765160a44 Merge remote-tracking branch 'origin/develop' into develop 2026-05-01 18:52:57 -03:00
Martín Lucas Golini
157bc2962f Added HTML forms support.
Added cookies support (now it's possible to login in websites).
Improved redirect handling in HTTP client.
Fix in `Node::find*` and `UIWidget::find*` functions to ignore closing nodes.
Fix in Node min width and height handling with pixel scale different than 1.
2026-05-01 18:52:46 -03:00
Martín Lucas Golini
6849401968 Merge remote-tracking branch 'origin/develop' into develop 2026-05-01 11:30:29 -03:00
Martín Lucas Golini
d64638d989 Out of flow positioning fixes. 2026-05-01 11:30:22 -03:00
Pierre Dittgen
ff96ef10c5 fix and update french translations (#177) 2026-05-01 10:51:41 -03:00
Martín Lucas Golini
717f3c1b9b Fix in StyleSheetPropertiesParser::readPropertyValue. 2026-05-01 03:16:39 -03:00
Martín Lucas Golini
eafdb240ea Try an alternative. 2026-05-01 02:55:58 -03:00
Martín Lucas Golini
1cd57f3b65 Try fix issue with ubuntu ppa repo. 2026-05-01 02:17:13 -03:00
Martín Lucas Golini
936938b71f Added an option to set dynamic theming in the UICodeEditor. 2026-05-01 01:07:06 -03:00
Martín Lucas Golini
fc45707cd1 Fix padding and margin in empty spans with children. 2026-05-01 00:37:28 -03:00
Martín Lucas Golini
12b1ff0d62 Create the code element with the correct tag. 2026-04-30 20:59:13 -03:00
Martín Lucas Golini
76de6553b4 Introducing UITextNode, a native text node representation within the eepp UI hierarchy. This solves issues where text content incorrectly intercepts CSS structural pseudo-classes (like :nth-child and :first-of-type) because it was previously wrapped in standard UIWidget components (UITextSpan).
In standard web browsers, a `Node` represents anything in the DOM (including text), whereas an `Element` represents an HTML tag. CSS selectors strictly filter by `Element`.
Currently, `eepp`'s CSS engine (`StyleSheetSpecification`) evaluates selectors directly against `Node` sibling counts (`getNodeIndex()`, `getChildCount()`). By distinguishing between "Widgets" (Elements) and "Text Nodes" at the node level, we updated these selectors to count only true structural elements, matching web standards with zero performance overhead.
2026-04-30 20:57:32 -03:00
Martín Lucas Golini
2b5d08d3b0 UITextSpan now inherits from UIRichText, if it's inline-block it will behave as a block otherwise it will continue behaving as inline. This improves inline-block behavior and it's much close to the specification. 2026-04-30 16:49:03 -03:00
Martín Lucas Golini
10b8ed8622 Fix incorrect wrap in inline-blocks. 2026-04-30 13:31:36 -03:00
Martín Lucas Golini
6691d9c174 Improvements for ul and ol.
Added a few tags: dl, dt, dd.
Load style tags inside UIRichText blocks.
Added `display: list-item`.
2026-04-30 12:58:05 -03:00