Migrate CSS value consumers to the internal record model#4120
Conversation
Test Results 855 files ±0 855 suites ±0 58m 36s ⏱️ + 7m 11s For more details on these failures, see this check. Results for commit bf091de. ± Comparison against base commit 552c9e4. ♻️ This comment has been updated with latest results. |
7bee5e6 to
9fc55e2
Compare
|
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. |
Move the property handlers, converters, and SWT helpers off the W3C CSSValue accessor API (getCssValueType, getPrimitiveType, getFloatValue, getStringValue, getRGBColorValue) onto pattern matching over the CssValues records. The records get their final internal shape: a CssUnit enum and a shared CssNumeric interface replace the raw W3C primitive type shorts on CssDimension, and CssText carries an explicit Kind (IDENT, STRING, URI, INHERIT). CSS2FontProperties and CSSBorderProperties now store CssPrimitive values, which retires the CSS2PrimitiveValueImpl and CSS2RGBColorImpl shims; CSS2ColorHelper and CSSSWTColorHelper build CssColor records directly. The old code distinguished widget-derived font sizes from CSS-set sizes through a null getCssText() quirk of CSS2PrimitiveValueImpl; that distinction is now an explicit sizeFromCSS flag on CSS2FontProperties, so font definitions still supply the height when no CSS size is set. The records still implement the W3C interfaces as a bridge for the style-declaration layer; the bridge goes away once the computed-style cascade is internal. The css.swt test helpers build real value records instead of Mockito mocks of CSSValueImpl, which the pattern matching would not recognize. Contributes to eclipse-platform#3980
6f7b8a2 to
bf091de
Compare
Migrates the property handlers, converters and SWT helpers to read CSS values directly from the internal
CssValuesrecords (pattern matching onCssNumber,CssDimension,CssColor, ...) instead of going through the W3CCSSValueaccessor methods.With every consumer moved over, the bridge types that only existed to feed them (
CSS2PrimitiveValueImpl,CSS2RGBColorImpl) are removed.Behaviour is unchanged: the same values reach the same setters, just by a more direct route.
Stacked on #4117 (the value records this consumes), so the diff currently also shows that commit; it reduces to just the consumer migration once #4117 is merged and this branch is rebased.
Part of the CSS engine rework (#3980).