Skip to content

Re-apply CSS colors that only match the inherited color - #4499

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:css-reapply-inherited-colors
Open

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:css-reapply-inherited-colors

Conversation

@vogella

@vogella vogella commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

After a theme switch, CSSSWTColorHelper skipped setting a control's new background whenever the parent already had the same color, because getBackground() also reports inherited colors. The reset control then owned no color, and children of a Forms Section painted the Section's title gradient image instead, for example the white text fields in the PDE manifest editor after switching from Light to Dark. The helper now remembers the color it applied and only skips when the control really owns it, and the element resets clear colors through the helper. The existing optimization for unchanged colors stays in place for ordinary re-applies, and a regression test covers the reset case.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   52m 11s ⏱️ - 7m 57s
 8 467 tests +2   8 225 ✅ +2  242 💤 ±0  0 ❌ ±0 
21 279 runs  +6  20 596 ✅ +6  683 💤 ±0  0 ❌ ±0 

Results for commit ac8a718. ± Comparison against base commit 3faf11c.

♻️ This comment has been updated with latest results.

@vogella
vogella force-pushed the css-reapply-inherited-colors branch from 8311f3a to 32fce3f Compare October 16, 2026 18:17
CSSSWTColorHelper skipped setting a color when the control already
reported it, but getBackground() also reports colors inherited from
the parent. After a theme switch reset a control that owned a color,
the new color was skipped whenever the parent had the same one, so the
control owned no color. Children of a Forms Section then painted the
Section's title gradient image.

The helper now remembers that it applied a color and, after a reset,
applies the new color even if it equals the inherited one. Controls
that never owned a color keep inheriting, so the Section title label
still shows the title bar. Element resets clear colors through the
helper so the record stays accurate.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the css-reapply-inherited-colors branch from 32fce3f to ac8a718 Compare October 16, 2026 18:25
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