Fold ICSSPropertyHandler2 into ICSSPropertyHandler#4048
Merged
vogella merged 1 commit intoJun 2, 2026
Conversation
ICSSPropertyHandler2 added a single capability on top of ICSSPropertyHandler: a callback the engine fires after every property in a style declaration has been applied. Java 21 default methods make the second interface redundant: move the two onAllCSSPropertiesApplyed defaults onto ICSSPropertyHandler so every handler picks up a no-op default and only handlers that need the final-step hook (border, font) override it. ICSSPropertyHandler2Delegate had no implementations in the platform tree at all, so its branch in CSSEngineImpl.applyStyleDeclaration was dead. Drop the interface and the dead branch in the same pass. CSSEngineImpl.applyStyleDeclaration now collects every applied ICSSPropertyHandler (de-duped, order-preserving) and fires the callback on each. The previous singleton-list cache stays, just keyed on ICSSPropertyHandler instead of ICSSPropertyHandler2. CSSPropertyBorderSWTHandler and CSSPropertyFontSWTHandler drop their explicit "implements ICSSPropertyHandler2" since they already extend ICSSPropertyHandler-compatible bases. All bundles internal (x-friends only); no API surface changed. Contributes to eclipse-platform#3980
Contributor
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.
Same flatten-the-hierarchy pattern as the recent engine merges (#4040, #4042).
ICSSPropertyHandler2added just one capability on top ofICSSPropertyHandler: anonAllCSSPropertiesApplyedcallback fired after a whole style declaration is applied. Java 21 default methods make the second interface redundant, so the callback moves ontoICSSPropertyHandleras a no-op default and only the handlers that need it (border, font) override it.ICSSPropertyHandler2Delegatehad no implementors anywhere in the platform tree, so its branch inCSSEngineImpl.applyStyleDeclarationwas dead and is dropped in the same pass. Dispatch now collects every applied handler (de-duped, order-preserving) and fires the callback on each.The bundles are internal (
x-friendsonly), so no API surface changes. Net effect is two fewer interfaces and a simpler property-apply path. css.swt tests still pass.Contributes to #3980