Commit 91e5e73
authored
Revamp system for generating and mixing in property descriptors
Previously the workflow for installing property descriptors on CSSStyleDeclaration was complex:
* The `download` task would download a subset of property names from https://www.w3.org/Style/CSS/all-properties.en.json, which would get written to the checked-in file `lib/generated/allProperties.js`.
* Those properties, plus those in the checked-in file `lib/utils/allExtraProperties.js`, would be used to generate `lib/generated/propertyDefinitions.js` at prepare time, by using the data in `@webref/css`. (If a property did not exist in `@webref/css`, no property definition would be generated.)
* The property handlers in `lib/properties/*.js` would be used both in code like `normalize.js`, and also to generate `lib/generated/properties.js` at prepare time by copying most of the body of those handlers into `properties.js`. `lib/generated/properties.js` would then be used to install the actual property descriptors.
This was overly complex and confusing. The new flow is:
* `@webref/css` becomes the single source of truth for which CSS properties we support. The w3.org JSON file and checked-in `allProperties.js` and `allExtraProperties.js` are deleted.
* One prepare-time script generates all relevant property definitions in `lib/generated/propertyDefinitions.js`.
* One prepare-time script then uses those property definitions to generate an object of property descriptors, which either delegate directly to the existing handler files, or use the generic property descriptor code. There is no longer any complicated AST-munging to move code from `lib/properties/*.js` into a generated file. And the generated object of property descriptors can be simply and easily mixed in to `CSSStyleDeclaration`.
As part of standardizing on `@webref/css` as our source of truth, this makes some changes to the supported list of CSS properties:
* Many new ones are added with generic processing.
* The following are added with fully-implemented processing: border-block-end-color, border-block-start-color, border-inline-end-color, border-inline-start-color, text-emphasis-color.
* The following nonstandard properties are deleted: -webkit-background-composite, -webkit-border-after, -webkit-border-after-color, -webkit-border-after-style, -webkit-border-after-width, -webkit-border-before, -webkit-border-before-color, -webkit-border-before-style, -webkit-border-before-width, -webkit-border-end, -webkit-border-end-color, -webkit-border-end-style, -webkit-border-end-width, -webkit-border-fit, -webkit-border-horizontal-spacing, -webkit-border-start, -webkit-border-start-color, -webkit-border-start-style, -webkit-border-start-width, -webkit-border-vertical-spacing, -webkit-color-correction, -webkit-column-axis, -webkit-column-break-after, -webkit-column-break-before, -webkit-column-break-inside, -webkit-column-rule-color, -webkit-flex-align, -webkit-flex-item-align, -webkit-flex-line-pack, -webkit-flex-order, -webkit-flex-pack, -webkit-font-size-delta, -webkit-font-smoothing, -webkit-highlight, -webkit-hyphenate-limit-after, -webkit-hyphenate-limit-before, -webkit-locale, -webkit-logical-height, -webkit-logical-width, -webkit-margin-after, -webkit-margin-after-collapse, -webkit-margin-before, -webkit-margin-before-collapse, -webkit-margin-bottom-collapse, -webkit-margin-collapse, -webkit-margin-end, -webkit-margin-start, -webkit-margin-top-collapse, -webkit-marquee, -webkit-marquee-direction, -webkit-marquee-increment, -webkit-marquee-repetition, -webkit-marquee-speed, -webkit-marquee-style, -webkit-mask-attachment, -webkit-mask-position-x, -webkit-mask-position-y, -webkit-mask-repeat-x, -webkit-mask-repeat-y, -webkit-match-nearest-mail-blockquote-color, -webkit-max-logical-height, -webkit-max-logical-width, -webkit-min-logical-height, -webkit-min-logical-width, -webkit-nbsp-mode, -webkit-overflow-scrolling, -webkit-padding-after, -webkit-padding-before, -webkit-padding-end, -webkit-padding-start, -webkit-perspective-origin-x, -webkit-perspective-origin-y, -webkit-region-break-after, -webkit-region-break-before, -webkit-region-break-inside, -webkit-region-overflow, -webkit-rtl-ordering, -webkit-svg-shadow, -webkit-tap-highlight-color, -webkit-text-decorations-in-effect, -webkit-text-emphasis-color, -webkit-text-security, -webkit-transform-origin-x, -webkit-transform-origin-y, -webkit-transform-origin-z, -webkit-user-drag, -webkit-user-modify, -webkit-wrap, -webkit-wrap-margin, -webkit-wrap-padding, -webkit-wrap-shape-inside, -webkit-wrap-shape-outside, -webkit-zoom, color-profile, color-rendering, enable-background, glyph-orientation-horizontal, kerning, marker-offset, marks, size, src, text-line-through, text-line-through-color, text-line-through-mode, text-line-through-style, text-line-through-width, text-overline, text-overline-color, text-overline-mode, text-overline-style, text-overline-width, text-underline, text-underline-color, text-underline-mode, text-underline-style, text-underline-width, unicode-range.
This additionally deletes the `propertyList` export from the package's main module, as that was an artifact of our previous over-complicated pipeline.1 parent 8b4cd29 commit 91e5e73
23 files changed
Lines changed: 162 additions & 1737 deletions
File tree
- lib
- generated
- properties
- utils
- scripts
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 23 | | |
29 | 24 | | |
30 | 25 | | |
| |||
363 | 358 | | |
364 | 359 | | |
365 | 360 | | |
366 | | - | |
| 361 | + | |
367 | 362 | | |
368 | 363 | | |
369 | 364 | | |
| |||
626 | 621 | | |
627 | 622 | | |
628 | 623 | | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
645 | 627 | | |
646 | 628 | | |
647 | | - | |
648 | | - | |
| 629 | + | |
649 | 630 | | |
Whitespace-only changes.
0 commit comments