[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.default = logical;
|
---|
| 7 | var alternativeProps = {
|
---|
| 8 | marginBlockStart: ['WebkitMarginBefore'],
|
---|
| 9 | marginBlockEnd: ['WebkitMarginAfter'],
|
---|
| 10 | marginInlineStart: ['WebkitMarginStart', 'MozMarginStart'],
|
---|
| 11 | marginInlineEnd: ['WebkitMarginEnd', 'MozMarginEnd'],
|
---|
| 12 | paddingBlockStart: ['WebkitPaddingBefore'],
|
---|
| 13 | paddingBlockEnd: ['WebkitPaddingAfter'],
|
---|
| 14 | paddingInlineStart: ['WebkitPaddingStart', 'MozPaddingStart'],
|
---|
| 15 | paddingInlineEnd: ['WebkitPaddingEnd', 'MozPaddingEnd'],
|
---|
| 16 | borderBlockStart: ['WebkitBorderBefore'],
|
---|
| 17 | borderBlockStartColor: ['WebkitBorderBeforeColor'],
|
---|
| 18 | borderBlockStartStyle: ['WebkitBorderBeforeStyle'],
|
---|
| 19 | borderBlockStartWidth: ['WebkitBorderBeforeWidth'],
|
---|
| 20 | borderBlockEnd: ['WebkitBorderAfter'],
|
---|
| 21 | borderBlockEndColor: ['WebkitBorderAfterColor'],
|
---|
| 22 | borderBlockEndStyle: ['WebkitBorderAfterStyle'],
|
---|
| 23 | borderBlockEndWidth: ['WebkitBorderAfterWidth'],
|
---|
| 24 | borderInlineStart: ['WebkitBorderStart', 'MozBorderStart'],
|
---|
| 25 | borderInlineStartColor: ['WebkitBorderStartColor', 'MozBorderStartColor'],
|
---|
| 26 | borderInlineStartStyle: ['WebkitBorderStartStyle', 'MozBorderStartStyle'],
|
---|
| 27 | borderInlineStartWidth: ['WebkitBorderStartWidth', 'MozBorderStartWidth'],
|
---|
| 28 | borderInlineEnd: ['WebkitBorderEnd', 'MozBorderEnd'],
|
---|
| 29 | borderInlineEndColor: ['WebkitBorderEndColor', 'MozBorderEndColor'],
|
---|
| 30 | borderInlineEndStyle: ['WebkitBorderEndStyle', 'MozBorderEndStyle'],
|
---|
| 31 | borderInlineEndWidth: ['WebkitBorderEndWidth', 'MozBorderEndWidth']
|
---|
| 32 | };
|
---|
| 33 |
|
---|
| 34 | function logical(property, value, style) {
|
---|
| 35 | if (Object.prototype.hasOwnProperty.call(alternativeProps, property)) {
|
---|
| 36 | var alternativePropList = alternativeProps[property];
|
---|
| 37 | for (var i = 0, len = alternativePropList.length; i < len; ++i) {
|
---|
| 38 | style[alternativePropList[i]] = value;
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
| 41 | } |
---|