Migrate CSS value consumers to the internal record model#4120
Open
vogella wants to merge 1 commit into
Open
Conversation
Contributor
7bee5e6 to
9fc55e2
Compare
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. |
6f7b8a2 to
bf091de
Compare
5a2e52b to
601ea36
Compare
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
601ea36 to
7de38ec
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.
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).