From eb7398f9ec7e13cc14289ce5bed1bb3e8d8e7756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 2 Aug 2026 00:55:03 -0300 Subject: [PATCH] Fix HTML loading stalls on large modern pages - batch asynchronous HTTP stylesheets and apply them in a single reload - skip unsupported block at-rules without leaking nested rules - prevent scripts nested in unknown custom elements from entering the render tree - add regression coverage for unsupported at-rules and nested scripts - document the Ninja release workflow for performance testing --- .agent/rules/build-project.md | 21 ++++++++++++++++- include/eepp/ui/uiscenenode.hpp | 7 ++++++ src/eepp/ui/css/stylesheetparser.cpp | 11 +++++++++ src/eepp/ui/uiscenenode.cpp | 33 +++++++++++++++++++++++++-- src/eepp/ui/uitextspan.cpp | 6 +++++ src/tests/unit_tests/uihtml_tests.cpp | 30 ++++++++++++++++++++++++ 6 files changed, 105 insertions(+), 3 deletions(-) diff --git a/.agent/rules/build-project.md b/.agent/rules/build-project.md index bd72d3517..6d610c486 100644 --- a/.agent/rules/build-project.md +++ b/.agent/rules/build-project.md @@ -1,4 +1,23 @@ -# Build Instructions (Debug Mode) +# Build Instructions + +The build configurations in `.ecode/project_build.json` are the source of truth for the +developer's local build workflows. Check that file before selecting a generator, backend, or +build flags. In particular, do not use an AddressSanitizer build to evaluate runtime performance. + +## Release Performance Builds (Linux) + +For performance investigations, use the `eepp-linux-ninja` configuration from +`.ecode/project_build.json`. At the time of writing, its commands are: + +`premake5 --disable-static-build --with-debug-symbols --with-backend=SDL3 ninja` + +`ninja -C make/linux release` + +This produces an optimized release build with debug symbols and without AddressSanitizer. Run the +release executable (for example, `bin/eepp-ui-html`) when measuring performance. Recheck +`.ecode/project_build.json` before use because the local configuration may change. + +## Debug and Unit-Test Builds All build commands must be executed from the **root project directory**. Follow these steps to build the project: diff --git a/include/eepp/ui/uiscenenode.hpp b/include/eepp/ui/uiscenenode.hpp index 91ac563fe..b0091d5a3 100644 --- a/include/eepp/ui/uiscenenode.hpp +++ b/include/eepp/ui/uiscenenode.hpp @@ -958,6 +958,8 @@ class EE_API UISceneNode : public SceneNode { bool mIsLoading{ false }; bool mUpdatingLayouts{ false }; bool mStyleDuringLoad{ false }; + Uint32 mPendingHTTPStyleSheetLoads{ 0 }; + bool mHTTPStyleSheetChanged{ false }; UIThemeManager* mUIThemeManager{ nullptr }; UIIconThemeManager* mUIIconThemeManager{ nullptr }; std::vector mFontFaces; @@ -1183,6 +1185,11 @@ class EE_API UISceneNode : public SceneNode { */ void loadCSS( URI uri, std::optional