| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | // List derived from Firefox source code: |
| 9 | // https://github.com/mozilla-firefox/firefox/blob/58f365ba0eb5761a182f1925e4654cc75212b8ac/layout/style/test/property_database.js |
| 10 | export const shorthandToLonghand = { |
| 11 | animation: [ |
| 12 | 'animationDelay', |
| 13 | 'animationDirection', |
| 14 | 'animationDuration', |
| 15 | 'animationFillMode', |
| 16 | 'animationIterationCount', |
| 17 | 'animationName', |
| 18 | 'animationPlayState', |
| 19 | 'animationTimingFunction', |
| 20 | ], |
| 21 | background: [ |
| 22 | 'backgroundAttachment', |
| 23 | 'backgroundClip', |
| 24 | 'backgroundColor', |
| 25 | 'backgroundImage', |
| 26 | 'backgroundOrigin', |
| 27 | 'backgroundPositionX', |
| 28 | 'backgroundPositionY', |
| 29 | 'backgroundRepeat', |
| 30 | 'backgroundSize', |
| 31 | ], |
| 32 | backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'], |
| 33 | border: [ |
| 34 | 'borderBottomColor', |
| 35 | 'borderBottomStyle', |
| 36 | 'borderBottomWidth', |
| 37 | 'borderImageOutset', |
| 38 | 'borderImageRepeat', |
| 39 | 'borderImageSlice', |
| 40 | 'borderImageSource', |
| 41 | 'borderImageWidth', |
| 42 | 'borderLeftColor', |
| 43 | 'borderLeftStyle', |
| 44 | 'borderLeftWidth', |
| 45 | 'borderRightColor', |
| 46 | 'borderRightStyle', |
| 47 | 'borderRightWidth', |
| 48 | 'borderTopColor', |
| 49 | 'borderTopStyle', |
| 50 | 'borderTopWidth', |
| 51 | ], |
| 52 | borderBlock: [ |
| 53 | 'borderBlockEndColor', |
| 54 | 'borderBlockEndStyle', |
| 55 | 'borderBlockEndWidth', |
| 56 | 'borderBlockStartColor', |
| 57 | 'borderBlockStartStyle', |
| 58 | 'borderBlockStartWidth', |
| 59 | ], |
| 60 | borderBlockColor: ['borderBlockEndColor', 'borderBlockStartColor'], |
| 61 | borderBlockEnd: [ |
| 62 | 'borderBlockEndColor', |
| 63 | 'borderBlockEndStyle', |
| 64 | 'borderBlockEndWidth', |
| 65 | ], |
| 66 | borderBlockStart: [ |
| 67 | 'borderBlockStartColor', |
| 68 | 'borderBlockStartStyle', |
| 69 | 'borderBlockStartWidth', |
| 70 | ], |
| 71 | borderBlockStyle: ['borderBlockEndStyle', 'borderBlockStartStyle'], |
| 72 | borderBlockWidth: ['borderBlockEndWidth', 'borderBlockStartWidth'], |
| 73 | borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'], |
| 74 | borderColor: [ |
| 75 | 'borderBottomColor', |
| 76 | 'borderLeftColor', |
| 77 | 'borderRightColor', |
| 78 | 'borderTopColor', |
| 79 | ], |
| 80 | borderImage: [ |
| 81 | 'borderImageOutset', |
| 82 | 'borderImageRepeat', |
| 83 | 'borderImageSlice', |
| 84 | 'borderImageSource', |
| 85 | 'borderImageWidth', |
| 86 | ], |
| 87 | borderInline: [ |
| 88 | 'borderInlineEndColor', |
| 89 | 'borderInlineEndStyle', |
| 90 | 'borderInlineEndWidth', |
| 91 | 'borderInlineStartColor', |
| 92 | 'borderInlineStartStyle', |
| 93 | 'borderInlineStartWidth', |
| 94 | ], |
| 95 | borderInlineColor: ['borderInlineEndColor', 'borderInlineStartColor'], |
| 96 | borderInlineEnd: [ |
| 97 | 'borderInlineEndColor', |
| 98 | 'borderInlineEndStyle', |
| 99 | 'borderInlineEndWidth', |
| 100 | ], |
| 101 | borderInlineStart: [ |
| 102 | 'borderInlineStartColor', |
| 103 | 'borderInlineStartStyle', |
| 104 | 'borderInlineStartWidth', |
| 105 | ], |
| 106 | borderInlineStyle: ['borderInlineEndStyle', 'borderInlineStartStyle'], |
| 107 | borderInlineWidth: ['borderInlineEndWidth', 'borderInlineStartWidth'], |
| 108 | borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'], |
| 109 | borderRadius: [ |
| 110 | 'borderBottomLeftRadius', |
| 111 | 'borderBottomRightRadius', |
| 112 | 'borderTopLeftRadius', |
| 113 | 'borderTopRightRadius', |
| 114 | ], |
| 115 | borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'], |
| 116 | borderStyle: [ |
| 117 | 'borderBottomStyle', |
| 118 | 'borderLeftStyle', |
| 119 | 'borderRightStyle', |
| 120 | 'borderTopStyle', |
| 121 | ], |
| 122 | borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'], |
| 123 | borderWidth: [ |
| 124 | 'borderBottomWidth', |
| 125 | 'borderLeftWidth', |
| 126 | 'borderRightWidth', |
| 127 | 'borderTopWidth', |
| 128 | ], |
| 129 | colorAdjust: ['printColorAdjust'], |
| 130 | columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'], |
| 131 | columns: ['columnCount', 'columnWidth'], |
| 132 | containIntrinsicSize: ['containIntrinsicHeight', 'containIntrinsicWidth'], |
| 133 | container: ['containerName', 'containerType'], |
| 134 | flex: ['flexBasis', 'flexGrow', 'flexShrink'], |
| 135 | flexFlow: ['flexDirection', 'flexWrap'], |
| 136 | font: [ |
| 137 | 'fontFamily', |
| 138 | 'fontFeatureSettings', |
| 139 | 'fontKerning', |
| 140 | 'fontLanguageOverride', |
| 141 | 'fontSize', |
| 142 | 'fontSizeAdjust', |
| 143 | 'fontStretch', |
| 144 | 'fontStyle', |
| 145 | 'fontVariant', |
| 146 | 'fontVariantAlternates', |
| 147 | 'fontVariantCaps', |
| 148 | 'fontVariantEastAsian', |
| 149 | 'fontVariantLigatures', |
| 150 | 'fontVariantNumeric', |
| 151 | 'fontVariantPosition', |
| 152 | 'fontWeight', |
| 153 | 'lineHeight', |
| 154 | ], |
| 155 | fontSynthesis: [ |
| 156 | 'fontSynthesisPosition', |
| 157 | 'fontSynthesisSmallCaps', |
| 158 | 'fontSynthesisStyle', |
| 159 | 'fontSynthesisWeight', |
| 160 | ], |
| 161 | fontVariant: [ |
| 162 | 'fontVariantAlternates', |
| 163 | 'fontVariantCaps', |
| 164 | 'fontVariantEastAsian', |
| 165 | 'fontVariantLigatures', |
| 166 | 'fontVariantNumeric', |
| 167 | 'fontVariantPosition', |
| 168 | ], |
| 169 | gap: ['columnGap', 'rowGap'], |
| 170 | grid: [ |
| 171 | 'gridAutoColumns', |
| 172 | 'gridAutoFlow', |
| 173 | 'gridAutoRows', |
| 174 | 'gridTemplateAreas', |
| 175 | 'gridTemplateColumns', |
| 176 | 'gridTemplateRows', |
| 177 | ], |
| 178 | gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'], |
| 179 | gridColumn: ['gridColumnEnd', 'gridColumnStart'], |
| 180 | gridColumnGap: ['columnGap'], |
| 181 | gridGap: ['columnGap', 'rowGap'], |
| 182 | gridRow: ['gridRowEnd', 'gridRowStart'], |
| 183 | gridRowGap: ['rowGap'], |
| 184 | gridTemplate: [ |
| 185 | 'gridTemplateAreas', |
| 186 | 'gridTemplateColumns', |
| 187 | 'gridTemplateRows', |
| 188 | ], |
| 189 | inset: ['bottom', 'left', 'right', 'top'], |
| 190 | insetBlock: ['insetBlockEnd', 'insetBlockStart'], |
| 191 | insetInline: ['insetInlineEnd', 'insetInlineStart'], |
| 192 | listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'], |
| 193 | margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'], |
| 194 | marginBlock: ['marginBlockEnd', 'marginBlockStart'], |
| 195 | marginInline: ['marginInlineEnd', 'marginInlineStart'], |
| 196 | marker: ['markerEnd', 'markerMid', 'markerStart'], |
| 197 | mask: [ |
| 198 | 'maskClip', |
| 199 | 'maskComposite', |
| 200 | 'maskImage', |
| 201 | 'maskMode', |
| 202 | 'maskOrigin', |
| 203 | 'maskPositionX', |
| 204 | 'maskPositionY', |
| 205 | 'maskRepeat', |
| 206 | 'maskSize', |
| 207 | ], |
| 208 | maskPosition: ['maskPositionX', 'maskPositionY'], |
| 209 | offset: [ |
| 210 | 'offsetAnchor', |
| 211 | 'offsetDistance', |
| 212 | 'offsetPath', |
| 213 | 'offsetPosition', |
| 214 | 'offsetRotate', |
| 215 | ], |
| 216 | outline: ['outlineColor', 'outlineStyle', 'outlineWidth'], |
| 217 | overflow: ['overflowX', 'overflowY'], |
| 218 | overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'], |
| 219 | padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'], |
| 220 | paddingBlock: ['paddingBlockEnd', 'paddingBlockStart'], |
| 221 | paddingInline: ['paddingInlineEnd', 'paddingInlineStart'], |
| 222 | pageBreakAfter: ['breakAfter'], |
| 223 | pageBreakBefore: ['breakBefore'], |
| 224 | pageBreakInside: ['breakInside'], |
| 225 | placeContent: ['alignContent', 'justifyContent'], |
| 226 | placeItems: ['alignItems', 'justifyItems'], |
| 227 | placeSelf: ['alignSelf', 'justifySelf'], |
| 228 | scrollMargin: [ |
| 229 | 'scrollMarginBottom', |
| 230 | 'scrollMarginLeft', |
| 231 | 'scrollMarginRight', |
| 232 | 'scrollMarginTop', |
| 233 | ], |
| 234 | scrollMarginBlock: ['scrollMarginBlockEnd', 'scrollMarginBlockStart'], |
| 235 | scrollMarginInline: ['scrollMarginInlineEnd', 'scrollMarginInlineStart'], |
| 236 | scrollPadding: [ |
| 237 | 'scrollPaddingBottom', |
| 238 | 'scrollPaddingLeft', |
| 239 | 'scrollPaddingRight', |
| 240 | 'scrollPaddingTop', |
| 241 | ], |
| 242 | scrollPaddingBlock: ['scrollPaddingBlockEnd', 'scrollPaddingBlockStart'], |
| 243 | scrollPaddingInline: ['scrollPaddingInlineEnd', 'scrollPaddingInlineStart'], |
| 244 | textDecoration: [ |
| 245 | 'textDecorationColor', |
| 246 | 'textDecorationLine', |
| 247 | 'textDecorationStyle', |
| 248 | 'textDecorationThickness', |
| 249 | ], |
| 250 | textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'], |
| 251 | textWrap: ['textWrapMode', 'textWrapStyle'], |
| 252 | transition: [ |
| 253 | 'transitionBehavior', |
| 254 | 'transitionDelay', |
| 255 | 'transitionDuration', |
| 256 | 'transitionProperty', |
| 257 | 'transitionTimingFunction', |
| 258 | ], |
| 259 | verticalAlign: ['alignmentBaseline', 'baselineShift', 'baselineSource'], |
| 260 | whiteSpace: ['textWrapMode', 'whiteSpaceCollapse'], |
| 261 | wordWrap: ['overflowWrap'], |
| 262 | }; |