Add CSS selector integration tests for tab selection, .active class, and preference pseudo#3983
Merged
vogella merged 1 commit intoeclipse-platform:masterfrom May 8, 2026
Conversation
1c9d07b to
3cb397e
Compare
Contributor
6468cbd to
ffcd8e6
Compare
…and preference pseudo Pins three engine behaviours not covered by the matcher/parser unit tests: CTabItem:selected styling on the parent CTabFolder, CTabFolder.active painting, and IEclipsePreferences#node:pseudo matching. Also registers the new classes (plus a previously orphaned core test) in the test suites so the nightly integration build runs them.
ffcd8e6 to
6622d2a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three JUnit 5 tests under
tests/org.eclipse.e4.ui.tests.css.swtthat pin engine behaviours not covered end-to-end today: howCTabItem:selectedrules surface onCTabFolder#getSelectionForeground/Backgroundand how theCTabFolderElementSWT selection listener triggers a reapply, howCTabFolder.activerules toggle onWidgetElement#setCSSClass, and how theIEclipsePreferences#node:contributorpseudo selector form (Bug 466075) lets multiple stylesheets contribute to the same preference node.Two scenarios were adjusted to match observed behaviour rather than the originally drafted expectation. The selected-foreground assertion runs against
folder.getSelectionForeground()(consistent with the existingCTabItemTest#testSelectionForeground) instead ofCTabItem#getForeground(), and the listener path is exercised by dispatching anSWT.Selectionevent because programmaticCTabFolder#setSelectiondoes not fire it. The "clearing .active reverts the background" case was flipped: the folder retains the previously painted background after the class is cleared, so the test pins that behaviour with a comment so a future revert fix shows up as a failure.The third scenario (
IEclipsePreferences#node:key) was reframed: the pseudo slot in shipped CSS is a contributor namespace tag (Bug 466075), not a preference key, andEclipsePreferencesHandleronly acts on thepreferences:declaration. An additional cascade-override test pins the source-order tiebreak: when two equal-specificity rules under the same pseudo write the same preference key, the later rule wins becauseviewCSSresolves the duplicatepreferences:property before the handler runs. The class javadocs were trimmed to single sentences with the non-obvious context kept as inline comments next to the relevant assertions.