Commit Graph

  • 8a5a7af3e0 Revert "Avoid stack-overflow when updating UIHTMLWidget::updateOutOfFlowPosition." develop nightly Martín Lucas Golini 2026-05-27 21:20:56 -03:00
  • eb2b919354 Avoid stack-overflow when updating UIHTMLWidget::updateOutOfFlowPosition. Martín Lucas Golini 2026-05-27 19:52:03 -03:00
  • df3ac4508b Add plan to implement a more complete font-weight support. Martín Lucas Golini 2026-05-27 01:10:28 -03:00
  • bdf94fea21 Added font-weight support. Martín Lucas Golini 2026-05-27 00:53:59 -03:00
  • 55e0fb9736 float and clear fixes Martín Lucas Golini 2026-05-26 21:57:32 -03:00
  • 2dbbd7d56d Do not compute for layouting hidden rows in TableLayouter. Martín Lucas Golini 2026-05-26 20:24:02 -03:00
  • 0c98717089 Improvements for SpartanJ/ecode#906. Martín Lucas Golini 2026-05-26 19:49:32 -03:00
  • 28290c20ef Quick crash fix SpartanJ/eepp#181. Martín Lucas Golini 2026-05-26 13:56:48 -03:00
  • 85b706869e Float and text wrap fixes. Martín Lucas Golini 2026-05-25 02:42:55 -03:00
  • b36ef2cf85 Fix background draw in atomic boxes. Fix in selector parser. Martín Lucas Golini 2026-05-25 01:49:04 -03:00
  • fa537eaaaa More WIP, several HTML fixes compatibility. Martín Lucas Golini 2026-05-24 15:29:00 -03:00
  • c5e39f4c6d More fixes. Martín Lucas Golini 2026-05-24 13:43:29 -03:00
  • aa9efcf13b Load CSS default HTML element styles from a CSS file with no specificity. This simplyfies how to setup the HTML defaults. Also set new defaults matching closer HTML spec. Martín Lucas Golini 2026-05-24 13:15:31 -03:00
  • bb7682dd8f CSS float improvements. Martín Lucas Golini 2026-05-24 02:21:53 -03:00
  • a4a39b5491 Update IME location on cursor position change in TerminalDisplay. Martín Lucas Golini 2026-05-23 20:37:37 -03:00
  • a7e1c03f25 Fix bug loading style elements from UIRichText. Martín Lucas Golini 2026-05-23 20:22:53 -03:00
  • 49971701ed float fixes. Martín Lucas Golini 2026-05-23 19:24:14 -03:00
  • d7807a1aa9 Ups fix Linux nightly env vars. Martín Lucas Golini 2026-05-23 17:49:54 -03:00
  • a90a003384 Update the Linux nightly. Martín Lucas Golini 2026-05-23 17:17:33 -03:00
  • 89028491ef Try fix macOS not passing tests due to incorrect Window sizing in macOS CI. Add support to diff images in UIDiffView. Martín Lucas Golini 2026-05-23 14:17:48 -03:00
  • 15db9e90eb Body height miscalculation fix. Martín Lucas Golini 2026-05-23 00:25:27 -03:00
  • 428cd55c48 Fix bug in CSS id selectors not working properly because we were lower-casing them for no reason. Martín Lucas Golini 2026-05-22 01:11:39 -03:00
  • ba3576aa8c Add text-transform support for UIRichText and UITextSpan. Martín Lucas Golini 2026-05-22 00:41:30 -03:00
  • 0c742d6431 Fix Windows build. Martín Lucas Golini 2026-05-21 21:25:19 -03:00
  • ed333b3839 Optimization in RichText and added benchmark. Martín Lucas Golini 2026-05-21 19:19:47 -03:00
  • ca56d7d935 Should fix build in some envs. Martín Lucas Golini 2026-05-21 14:10:29 -03:00
  • c834f82566 Huge RichText refactor to improve inline-box support. Still WIP. Martín Lucas Golini 2026-05-21 12:22:49 -03:00
  • dd2134b0d0 Fix unit-tests build. Martín Lucas Golini 2026-05-21 01:02:06 -03:00
  • 71bea09f2d Added UITabWidgetSplitter (what should have been the UICodeEditorSplitter). Martín Lucas Golini 2026-05-21 00:30:33 -03:00
  • 0defa0ada3 Fix hex color string parsing. UIMarkdownView now uses the HTMLFormatter::HTMLtoXML. Removed formatting hack to force strict XML from HTML, now we should always use HTMLFormatter::HTMLtoXML. Martín Lucas Golini 2026-05-20 01:39:05 -03:00
  • 7daca81bd6 Allow to select the default "New Tab Position" (SpartanJ/ecode#904) from the settings menu at Settings -> Document -> Global Settings -> New Tab Position. Martín Lucas Golini 2026-05-19 20:38:24 -03:00
  • d27590753a Don't let <head> participate in layouting. Martín Lucas Golini 2026-05-19 18:49:38 -03:00
  • ea1a148b30 Fix a possible crash when loading fonts. Martín Lucas Golini 2026-05-19 02:04:48 -03:00
  • 9d8dc55445 Fix crash when displaying signature help (SpartanJ/ecode#902). Martín Lucas Golini 2026-05-19 01:40:10 -03:00
  • e5c5b77c2c Fix fixed tr height not being applied. Martín Lucas Golini 2026-05-18 19:05:00 -03:00
  • 97fc336955 Fix: When build is triggered with unsaved files don't display the file save dialog for files that are just in text buffer. Fix: Ctrl+W does not close the tab in Build Settings: Added Event::OnFocusWithin so the tab widget registers that event to setCurrenWidget in UICodeEditorSplitter. Martín Lucas Golini 2026-05-18 01:08:14 -03:00
  • 8cfedc4590 Added alignment-baseline and vertical-align support in RichText and all its consumers. Martín Lucas Golini 2026-05-17 21:54:08 -03:00
  • f22ce3f8d2 Fix some draw invalidation issues. Martín Lucas Golini 2026-05-17 03:21:15 -03:00
  • afe3df0650 Improve baseline aligment in inline-blocks. Improved html architecture documentation. Martín Lucas Golini 2026-05-17 03:19:08 -03:00
  • e223ed6d3c Initial support for HTML element tags: details and summary. Martín Lucas Golini 2026-05-16 22:23:31 -03:00
  • 702f995608 Add support for data attributes and CSS selectors using them. Martín Lucas Golini 2026-05-16 19:23:48 -03:00
  • acc27edd8a Fix macOS tests (it was a driver bug ¬¬) Martín Lucas Golini 2026-05-16 14:18:46 -03:00
  • 3dadd58ce1 Various fixes for HTML compat layer. Martín Lucas Golini 2026-05-16 03:26:55 -03:00
  • a580b3b97b Try luck with the complexLayout2 test (macOS CI is failing with no reason). Martín Lucas Golini 2026-05-15 23:41:41 -03:00
  • 9086a58524 Fixed responseHeaderLineLargerThanReceiveBuffer test on Windows. Some extra minor fixes. Martín Lucas Golini 2026-05-15 22:29:56 -03:00
  • a6b9f39ac3 Several crashes fixes for HTML loading. Martín Lucas Golini 2026-05-15 18:59:51 -03:00
  • 852adaa2c5 CSS Block Semantics plan executed. Martín Lucas Golini 2026-05-15 02:42:05 -03:00
  • 1af86f9110 Merge branch 'feature/system-font-resolver' into develop Martín Lucas Golini 2026-05-15 01:52:29 -03:00
  • 4c25197e85 Thread-safety. Martín Lucas Golini 2026-05-15 01:10:44 -03:00
  • 6c7b513494 More clean up. Martín Lucas Golini 2026-05-15 00:54:06 -03:00
  • af88532361 Nit. Martín Lucas Golini 2026-05-15 00:26:33 -03:00
  • d6906d2ebf A few nits. Martín Lucas Golini 2026-05-14 22:07:34 -03:00
  • 368510cdff Fix Android build. A few adjustments in the tests. Martín Lucas Golini 2026-05-14 21:58:40 -03:00
  • b440f0e2a2 Fixes for Haiku and all fallbacks. Martín Lucas Golini 2026-05-15 00:10:40 +00:00
  • b00547655d Some mingw build fixes for my local build. Martín Lucas Golini 2026-05-14 19:27:16 -03:00
  • 5b7804dc32 Fixes and improvements. Martín Lucas Golini 2026-05-14 13:59:27 -03:00
  • 65068c1b45 compilation fix Martín Lucas Golini 2026-05-14 13:14:14 -03:00
  • 3824bb9c8a Try fixes. Martín Lucas Golini 2026-05-14 12:56:14 -03:00
  • 138c6eb30e Merge branch 'develop' into feature/system-font-resolver Martín Lucas Golini 2026-05-14 02:29:04 -03:00
  • f815d99489 Some extra fixes. fontconfig is now loaded at runtime. Martín Lucas Golini 2026-05-14 02:28:48 -03:00
  • 1b34eb7b2f Fix small text collapse bug. Martín Lucas Golini 2026-05-14 01:43:27 -03:00
  • 359dc8f157 block and inline-block layouter fixes, added a plan for a definitive fix in block layouter. Martín Lucas Golini 2026-05-14 00:32:58 -03:00
  • 828adf581d Initial work on the system font resolver. Martín Lucas Golini 2026-05-13 17:32:39 -03:00
  • 4b58b2f61b Fix line-height. Martín Lucas Golini 2026-05-13 12:53:40 -03:00
  • 7be0f28c31 Fix text collapsing in UITextSpan. Martín Lucas Golini 2026-05-13 11:54:30 -03:00
  • 1b263a531b Do not set broken colors. Martín Lucas Golini 2026-05-13 01:52:57 -03:00
  • ae0150ae75 Fix inline-blocks with fixed size. Martín Lucas Golini 2026-05-13 01:43:03 -03:00
  • 9f257c6fef CSS: Inline-block layout, line-height inheritance, and font shorthand fixes Core problem Three interconnected bugs caused incorrect rendering of display: inline-block elements: 1. Inline-block elements with explicit width/height (e.g. share buttons with width: 20px; height: 20px) had zero dimensions — their internal children were never laid out. 2. Text-based inline-blocks (e.g. <a href="...">Download</a> styled as display: inline-block) were affected by an incorrect font shorthand that failed to reset line-height to normal, allowing an inherited line-height: 10 on <body> to inflate element heights via the line box strut. 3. Inline-block elements with long text did not wrap atomically to the next line when they exceeded the container width. Changes by file include/eepp/graphics/richtext.hpp / src/eepp/graphics/richtext.cpp - Added lineHeight (Float) and isAtomic (bool) fields to SpanBlock. The lineHeight field provides per-span line-height overriding the global mLineHeight — this is used by inline-block spans to set their line height to the font's em height rather than inheriting the container's line-height. The isAtomic flag marks a span as an atomic inline-level box: during RichText Pass 1 (both the non-float and float-aware paths), atomic spans check whether the full text width plus margins fits on the current line; if not, they push to the next line before any text wrapping occurs. This matches the CSS behavior where an inline-block drops to a new line as an opaque unit rather than having its text wrap within the parent line. - Updated addSpan() to accept lineHeight and isAtomic parameters (with defaults of 0 and false to preserve existing call sites). - Added per-span line-height priority (3-tier cascade): a span's own lineHeight takes precedence over the global mLineHeight, which takes precedence over the font's intrinsic line spacing. This ensures inline-block spans use font em height (set by UIRichText::rebuildRichText), pure inline text uses the container's line-height, and all fall back to font metrics. - Added line box strut in Pass 2 (both paths): line.height = std::max(line.height, mLineHeight) ensures every line box respects the containing block's line-height, per CSS 2.1 §10.8.1. Previously a line box's height was determined solely by the tallest inline element on that line; now the container's line-height acts as a minimum. - Propagated pText->lineHeight and pText->isAtomic through to the SpanBlock construction in RenderSpan creation in both the non-float and float-aware paths, so the per-span values persist from addSpan() through to layout. include/eepp/ui/uitextspan.hpp / src/eepp/ui/uitextspan.cpp - isMergeable() now returns true for both CSSDisplay::Inline and CSSDisplay::InlineBlock. Previously only Inline was mergeable. This allows text-based inline-block content to participate in the parent container's RichText flow (baseline-aligned), while the widget still draws its own border and background independently. - Added isInlineBlock() helper method that returns mDisplay == CSSDisplay::InlineBlock, used by callers throughout the layouter and RichText code to distinguish inline-block treatment from pure inline. - Fixed drawBorder(): inline-block widgets now draw their border at the widget bounds (mScreenPos, mSize) without expanding by padding, because padding has already been incorporated into the widget's size via the RichText bounds expansion. Pure inline spans continue to draw the border expanded by padding (the old behavior). src/eepp/ui/uirichtext.cpp - In rebuildRichText(), inline-block widgets are now handled via two distinct code paths: - Text-based inline-block (has its own text content): treated as mergeable — text flows into the parent container's RichText as a SpanBlock with isAtomic = true for atomic line-wrapping, and the span's lineHeight set to the font's em height. Padding and margins are propagated through the SpanBlock. The widget's size and hit-boxes are computed from the parent RichText's layout (via BlockLayouter::positionRichTextChildren bounds expansion). - Inline-block without text (has only child widgets, e.g. share buttons containing nested <span> elements): diverted to the CustomBlock path — the widget runs its own BlockLayouter::updateLayout() to process internal children and determine its intrinsic size, and is added to the parent's RichText as a CustomBlock (atomic inline-level box). This ensures inner children are properly laid out rather than left at zero dimensions. - Whitespace collapse logic around inline-block spans now accounts for whether the adjacent nodes are inline, preventing incorrect stripping of leading/trailing spaces. src/eepp/ui/blocklayouter.cpp - BlockLayouter::updateLayout(): the early return for mergeable widgets now makes an exception for inline-block widgets that have no text of their own — these still need their internal children laid out, so the layouter proceeds rather than returning early. - BlockLayouter::positionRichTextChildren(): inline-block widgets are processed in two ways depending on whether they have text: - Text-based: bounds computed from the parent RichText's span positions, expanded by padding. The widget's position and size are set from these bounds. - No-text (CustomBlock): positioned via getNextCustomSpan() from the parent RichText's CustomBlock spans, with padding expansion for bounds. Martín Lucas Golini 2026-05-13 00:49:36 -03:00
  • eaa82411c3 Improve @font-face font loading. Added new flag UI_CREATING_NODE that will be used for performance optimizations. Martín Lucas Golini 2026-05-12 01:51:35 -03:00
  • 0f8d930e80 Add support for --var: var(--other-var). Reset global definition for body and html elements when new styles are loaded (required when these elements have only variable definitions). Martín Lucas Golini 2026-05-11 21:22:49 -03:00
  • 4fa495f0e1 Fix CSS parsing issues with media queries and imports. Added sup and sub html elements. Martín Lucas Golini 2026-05-11 19:00:58 -03:00
  • 2557f3c0be Added HTML label element support. Martín Lucas Golini 2026-05-11 16:28:49 -03:00
  • 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. Martín Lucas Golini 2026-05-11 14:43:24 -03:00
  • d2d13cbe41 Fixed a few HTML+CSS parsing errors. Fixed a crash when loading fonts from web. Add support for scientific notation in stylesheet lengths. Martín Lucas Golini 2026-05-11 00:51:43 -03:00
  • a38ffe2532 Inherit UIHTMLInput from UIHTMLWidget. Martín Lucas Golini 2026-05-10 14:26:47 -03:00
  • cafdefbf4a Fix auto-size for HTML images. Added visibility property support. Fix display: none. Added figure and figcaption HTML tags. Martín Lucas Golini 2026-05-10 01:55:19 -03:00
  • 24bc5edd72 Fixes in whitespace collapsing, added white-space-collapse to the CSS specification. Martín Lucas Golini 2026-05-09 21:26:16 -03:00
  • 792bae6da2 Make UITextNode easily debuggable by setting its position and size. Martín Lucas Golini 2026-05-09 20:05:35 -03:00
  • 23b14ba2fe Fix unit-tests (ups). Fix an issue when setting an invalid color to the terminal display. Update efsw. Martín Lucas Golini 2026-05-09 19:52:06 -03:00
  • 9255cf8c35 Nit in UITextNode. Martín Lucas Golini 2026-05-09 19:26:52 -03:00
  • 10fa8f7411 Fix ex and ch units. Martín Lucas Golini 2026-05-09 02:22:06 -03:00
  • f4f30c9979 Improve line-height support (add correct percentage support). Martín Lucas Golini 2026-05-09 01:56:55 -03:00
  • bc071bd88d Add line-height and text-indent support. Martín Lucas Golini 2026-05-09 01:38:43 -03:00
  • 0c3df503b4 Fix in background sizing when using pixel-density != 1. Updated new background tests due to the windowing size issues in the macOS CI. Martín Lucas Golini 2026-05-09 00:30:33 -03:00
  • 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. Martín Lucas Golini 2026-05-08 22:13:07 -03:00
  • 7452cbf492 Fix mingw build on openSUSE. Martín Lucas Golini 2026-05-08 18:01:41 -03:00
  • a870a278bb Forgot to update versioning. A couple of minor nits. Martín Lucas Golini 2026-05-08 16:50:46 -03:00
  • 02a9c3708b Pump internal remote SDL2 version. Martín Lucas Golini 2026-05-07 20:11:07 -03:00
  • 8f13e62dd7 Slightly debounce UICodeEditorSplitter::addEditorPositionToNavigationHistory. Martín Lucas Golini 2026-05-06 22:48:57 -03:00
  • dc603d4275 Some rendering optimizations. Martín Lucas Golini 2026-05-05 01:42:54 -03:00
  • 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. Martín Lucas Golini 2026-05-04 19:30:56 -03:00
  • 19c0f15196 Merge branch 'feature/sdl3' into develop Martín Lucas Golini 2026-05-04 12:21:19 -03:00
  • 02b6076cee mojoAL SDL3 Martín Lucas Golini 2026-05-04 11:47:54 -03:00
  • 9e3c13903d Improve percentage resolution in HTML elements. Martín Lucas Golini 2026-05-03 19:49:38 -03:00
  • da30372aae Remove concepts dependency, switch temporally Linux nightly to clang. Martín Lucas Golini 2026-05-03 19:40:56 -03:00
  • 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). Martín Lucas Golini 2026-05-03 12:32:27 -03:00
  • 7150633c1a Fixes in URI implementation to handle some special cases, added some tests too. Fix flaky test. Renamed tests to have consistent naming. Martín Lucas Golini 2026-05-03 02:22:37 -03:00
  • ecf7c20262 Fix foreground-radius definition. Martín Lucas Golini 2026-05-03 00:48:13 -03:00
  • 2dcc787ed7 Fix top + bottom and left + right html element expanding. Martín Lucas Golini 2026-05-03 00:33:32 -03:00
  • a698348abd Improve font loading and URL handling in external CSS. Martín Lucas Golini 2026-05-02 23:55:45 -03:00