Skip to content

Improved the .gitignore file (It's more dynamic now) - #1

Open
ShaunRoselt wants to merge 1 commit into
tina4stack:masterfrom
ShaunRoselt:gitignore-update
Open

Improved the .gitignore file (It's more dynamic now)#1
ShaunRoselt wants to merge 1 commit into
tina4stack:masterfrom
ShaunRoselt:gitignore-update

Conversation

@ShaunRoselt

Copy link
Copy Markdown

No description provided.

andrevanzuydam added a commit that referenced this pull request May 11, 2026
…aches diag

Bug 18 (2026-05-10 follow-up): user reports that when Twig.Text is
reassigned with an interpolated brand-colour value in a class rule
(.header { background: <BrandColour>; ... }), subsequent renders
keep the FIRST render's colour. Inline style="" flips cleanly.

Investigated and pinned the underlying mechanic with a focused
test (TestClassRuleReassignmentReflectsNewColour):

  1. Parse HTML #1 with `.header { background: #ff8200 }`
  2. FStyleSheet.Clear + AddCSS (mirrors what DoLayout does after
     FParserDirty fires from a Twig.Text reassign)
  3. Layout + capture Style.BackgroundColor → expected #ff8200
  4. Parse HTML #2 with `.header { background: #e60000 }`
  5. FStyleSheet.Clear + AddCSS again
  6. Layout + capture Style.BackgroundColor → expected #e60000
  7. Assert the two differ

Result: test passes. The underlying FStyleSheet.Clear +
re-AddCSS path works correctly — including the indexed cascade
(FRulesByKey) added in f7fac5f. So the cache-invalidation chain
that DoLayout takes is sound.

The user's report could still be real but in a path the test
doesn't exercise — most likely candidates:

  * Frond template engine caching the rendered output between
    Twig.Text reassignments (template engine state, not Tina4
    renderer).
  * Repaint not actually causing Paint -> DoLayout (FMX layer).
  * External-stylesheet file cache (TFileCache) — applies only
    if <link rel="stylesheet"> is used.

To unblock anyone hitting this: new InvalidateAllCaches() method
defensively clears the stylesheet, file cache, parsed DOM,
pseudo-class chains, and forces a relayout. Call it after a
Twig.Text reassign if you suspect cached state is masking the
new value:

  Render.Twig.Text := NewSource;
  Render.InvalidateAllCaches;  // belt-and-braces

Test suite: 489/489.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant