Replace the W3C computed-style cascade with internal types#4122
Merged
vogella merged 1 commit intoJul 4, 2026
Conversation
Contributor
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
Contributor
203b751 to
ab1f1ca
Compare
ab1f1ca to
0c3d979
Compare
Contributor
Author
|
This one requires to sync changes on the PDE side, so I plan to merge it early M2 together with the PDE changes. |
0c3d979 to
28a2498
Compare
vogella
added a commit
to vogella/eclipse.platform.ui
that referenced
this pull request
Jul 2, 2026
… add Phase 7 rule indexing
vogella
added a commit
to vogella/eclipse.platform.ui
that referenced
this pull request
Jul 3, 2026
vogella
added a commit
to vogella/eclipse.pde
that referenced
this pull request
Jul 3, 2026
The spy read the e4 CSS engine's stylesheets through CSSEngine.getDocumentCSS() and cast the result to ExtendedDocumentCSS, both of which are removed by eclipse-platform/eclipse.platform.ui#4122. Route the two affected call sites, the matched-rule sources and the scratch pad, through a new reflective CssEngineCompat helper that supports both the current W3C DocumentCSS cascade and the reworked internal cascade, following the version-agnostic approach of eclipse-pde#2352. On the reworked engine the scratch sheet is appended last rather than first, so it now wins ties against the theme, which is the more intuitive behavior for a scratch pad.
Fold the ViewCSS/DocumentCSS machinery into the engine: CSSEngineImpl now holds the stylesheet list and a cached flat rule list directly, and the former ViewCSSImpl.getComputedStyle logic becomes CSSEngine.computeStyle. The rule and stylesheet mirror drops its W3C interfaces: CSSStyleSheetImpl is a plain list of CssRule (a new sealed interface), CSSStyleRuleImpl and CSSImportRuleImpl are simple internal classes, and ViewCSSImpl, DocumentCSSImpl, StyleSheetListImpl, CSSRuleImpl, CSSRuleListImpl, MediaListImpl, AbstractCSSNode, ExtendedCSSRule, and ExtendedDocumentCSS are deleted. CSSEngine.parseStyleSheet now returns the internal stylesheet type and getDocumentCSS()/getViewCSS() are replaced by computeStyle; a deprecated getViewCSS() default method remains as a binary-compatibility bridge for bundles compiled against the old accessor. CSSStyleDeclarationImpl keeps implementing the W3C CSSStyleDeclaration interface because IStylingEngine.getStyle and IThemeEngine.getStyle are frozen public API returning that type; its parent rule is now the internal CSSStyleRuleImpl, reachable via getParentStyleRule(), and the W3C getParentRule() returns null. In-tree callers (ThemeEngine, the font handler, CSSRenderingUtils, PartRenderingEngine) and the css.core parser tests move to the internal API. Contributes to eclipse-platform#3980
28a2498 to
5e98329
Compare
vogella
added a commit
to vogella/eclipse.pde
that referenced
this pull request
Jul 4, 2026
The spy read the e4 CSS engine's stylesheets through CSSEngine.getDocumentCSS() and cast the result to ExtendedDocumentCSS, both of which are removed by eclipse-platform/eclipse.platform.ui#4122. Route the two affected call sites, the matched-rule sources and the scratch pad, through a new reflective CssEngineCompat helper that supports both the current W3C DocumentCSS cascade and the reworked internal cascade, following the version-agnostic approach of eclipse-pde#2352. On the reworked engine the scratch sheet is appended last rather than first, so it now wins ties against the theme, which is the more intuitive behavior for a scratch pad.
vogella
added a commit
to eclipse-pde/eclipse.pde
that referenced
this pull request
Jul 4, 2026
The spy read the e4 CSS engine's stylesheets through CSSEngine.getDocumentCSS() and cast the result to ExtendedDocumentCSS, both of which are removed by eclipse-platform/eclipse.platform.ui#4122. Route the two affected call sites, the matched-rule sources and the scratch pad, through a new reflective CssEngineCompat helper that supports both the current W3C DocumentCSS cascade and the reworked internal cascade, following the version-agnostic approach of #2352. On the reworked engine the scratch sheet is appended last rather than first, so it now wins ties against the theme, which is the more intuitive behavior for a scratch pad.
vogella
added a commit
to vogella/eclipse.platform.ui
that referenced
this pull request
Jul 4, 2026
This was referenced Jul 4, 2026
vogella
added a commit
to vogella/eclipse.pde
that referenced
this pull request
Jul 4, 2026
eclipse-platform/eclipse.platform.ui#4122 replaced the e4 CSS engine's W3C DocumentCSS/ViewCSS cascade with internal types, so the reflective CssEngineCompat bridge that spanned both engines is no longer needed. Call the new API directly: enumerate rules through CSSEngineImpl.getStyleSheets() and CSSStyleSheetImpl.getRules(), apply the scratch sheet through parseStyleSheet(), and compute styles through CSSEngine.computeStyle() instead of the deprecated getViewCSS() bridge. Raise the required org.eclipse.e4.ui.css.core version to 0.14.800 so the spy cannot be installed into older releases whose CSS engine predates the reworked cascade. This requires the reworked engine, so it only builds once a platform build containing #4122 reaches the PDE target platform.
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.
Folds the W3C ViewCSS / DocumentCSS computed-style machinery into the engine:
CSSEngineImplnow holds the stylesheet list and a cached flat rule list directly, and the formerViewCSSImpl.getComputedStylelogic becomesCSSEngine.computeStyle.CSSStyleSheetImplbecomes a plain list ofCssRule(a new sealed interface), andViewCSSImpl,DocumentCSSImpl,StyleSheetListImpl,MediaListImpland the related W3C rule-mirror classes are deleted.CSSStyleDeclarationImplkeeps implementing the W3CCSSStyleDeclarationinterface, sinceIStylingEngine.getStyle/IThemeEngine.getStyleare frozen public API returning that type. A deprecatedgetViewCSS()default method remains as a binary-compatibility bridge.Stacked on #4120 (the consumer migration it builds on), so the diff currently also shows that commit; it reduces to just this change once #4120 is merged and this branch is rebased.
Part of the CSS engine rework (#3980).