Skip to content

Replace the W3C computed-style cascade with internal types#4122

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:css-cascade-internal-types
Jul 4, 2026
Merged

Replace the W3C computed-style cascade with internal types#4122
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:css-cascade-internal-types

Conversation

@vogella

@vogella vogella commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Folds the W3C ViewCSS / DocumentCSS computed-style 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.
CSSStyleSheetImpl becomes a plain list of CssRule (a new sealed interface), and ViewCSSImpl, DocumentCSSImpl, StyleSheetListImpl, MediaListImpl and the related W3C rule-mirror classes are deleted.

CSSStyleDeclarationImpl keeps implementing the W3C CSSStyleDeclaration interface, since IStylingEngine.getStyle / IThemeEngine.getStyle are frozen public API returning that type. A deprecated getViewCSS() 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).

@eclipse-platform-bot

Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF

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 patch
From e3856411752e7395e0f6481eaf2e2df7b869c813 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Fri, 19 Jun 2026 09:15:12 +0000
Subject: [PATCH] Version bump(s) for 4.41 stream


diff --git a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
index 37a7e9d1ea..75d82205e6 100644
--- a/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.ui.workbench.swt/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-SymbolicName: org.eclipse.e4.ui.workbench.swt;singleton:=true
-Bundle-Version: 0.18.100.qualifier
+Bundle-Version: 0.18.200.qualifier
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-- 
2.54.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Test Results

   855 files  ±0     855 suites  ±0   54m 30s ⏱️ + 7m 27s
 8 100 tests ±0   7 857 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 202 runs  ±0  19 548 ✅ ±0  654 💤 ±0  0 ❌ ±0 

Results for commit 5e98329. ± Comparison against base commit fa1a384.

♻️ This comment has been updated with latest results.

@vogella vogella force-pushed the css-cascade-internal-types branch 3 times, most recently from 203b751 to ab1f1ca Compare June 25, 2026 18:40
@vogella vogella marked this pull request as ready for review June 25, 2026 18:40
@vogella vogella force-pushed the css-cascade-internal-types branch from ab1f1ca to 0c3d979 Compare June 26, 2026 05:51
@vogella

vogella commented Jul 2, 2026

Copy link
Copy Markdown
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.

@vogella vogella force-pushed the css-cascade-internal-types branch from 0c3d979 to 28a2498 Compare July 2, 2026 16:00
vogella added a commit to vogella/eclipse.platform.ui that referenced this pull request Jul 2, 2026
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
@vogella vogella force-pushed the css-cascade-internal-types branch from 28a2498 to 5e98329 Compare July 3, 2026 14:35
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 vogella merged commit ef8e9f8 into eclipse-platform:master Jul 4, 2026
18 checks passed
@vogella vogella deleted the css-cascade-internal-types branch July 4, 2026 16:46
vogella added a commit to vogella/eclipse.platform.ui that referenced this pull request 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.
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.

2 participants