From f71dae7d93c651e06224fac62df1fb65b0a5909e Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Wed, 23 Nov 2016 09:58:18 -0800 Subject: [PATCH] [add] support for vendor-prefixed font-smoothing styles Fix #240 --- examples/components/Text/TextExample.js | 2 +- .../Touchable/TouchableHighlight.js | 4 +++- src/propTypes/TextPropTypes.js | 21 ++++++++----------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/examples/components/Text/TextExample.js b/examples/components/Text/TextExample.js index 1c9a9c3c..9259cfa8 100644 --- a/examples/components/Text/TextExample.js +++ b/examples/components/Text/TextExample.js @@ -79,7 +79,7 @@ const examples = [ title: 'Wrap', render: function() { return ( - + The text should wrap if it goes on multiple lines. See, this is going to the next line. diff --git a/src/components/Touchable/TouchableHighlight.js b/src/components/Touchable/TouchableHighlight.js index e8463d68..f3b238e3 100644 --- a/src/components/Touchable/TouchableHighlight.js +++ b/src/components/Touchable/TouchableHighlight.js @@ -18,10 +18,12 @@ var ColorPropType = require('../../propTypes/ColorPropType'); var NativeMethodsMixin = require('../../modules/NativeMethodsMixin'); var React = require('react'); var StyleSheet = require('../../apis/StyleSheet'); +var StyleSheetPropType = require('../../propTypes/StyleSheetPropType'); var TimerMixin = require('react-timer-mixin'); var Touchable = require('./Touchable'); var TouchableWithoutFeedback = require('./TouchableWithoutFeedback'); var View = require('../View'); +var ViewStylePropTypes = require('../View/ViewStylePropTypes'); var ensureComponentIsNative = require('./ensureComponentIsNative'); var ensurePositiveDelayProps = require('./ensurePositiveDelayProps'); @@ -77,7 +79,7 @@ var TouchableHighlight = React.createClass({ * active. */ underlayColor: ColorPropType, - style: React.PropTypes.style, + style: StyleSheetPropType(ViewStylePropTypes), /** * Called immediately after the underlay is shown */ diff --git a/src/propTypes/TextPropTypes.js b/src/propTypes/TextPropTypes.js index 1b9942dd..0e6082a9 100644 --- a/src/propTypes/TextPropTypes.js +++ b/src/propTypes/TextPropTypes.js @@ -20,22 +20,19 @@ const TextPropTypes = process.env.NODE_ENV !== 'production' ? { textAlign: TextAlignPropType, textAlignVertical: oneOf([ 'auto', 'bottom', 'center', 'top' ]), textDecorationLine: string, - /* @platform web */ - textOverflow: string, - /* @platform web */ - textRendering: oneOf([ 'auto', 'geometricPrecision', 'optimizeLegibility', 'optimizeSpeed' ]), textShadowColor: ColorPropType, textShadowOffset: ShadowOffsetPropType, textShadowRadius: number, - /* @platform web */ - textTransform: oneOf([ 'capitalize', 'lowercase', 'none', 'uppercase' ]), - /* @platform web */ - unicodeBidi: oneOf([ 'normal', 'bidi-override', 'embed', 'isolate', 'isolate-override', 'plaintext' ]), - /* @platform web */ - whiteSpace: string, - /* @platform web */ - wordWrap: string, writingDirection: WritingDirectionPropType, + /* @platform web */ + textOverflow: string, + textRendering: oneOf([ 'auto', 'geometricPrecision', 'optimizeLegibility', 'optimizeSpeed' ]), + textTransform: oneOf([ 'capitalize', 'lowercase', 'none', 'uppercase' ]), + unicodeBidi: oneOf([ 'normal', 'bidi-override', 'embed', 'isolate', 'isolate-override', 'plaintext' ]), + whiteSpace: string, + wordWrap: string, + MozOsxFontSmoothing: string, + WebkitFontSmoothing: string, // opt-out of RTL flipping textAlign$noI18n: TextAlignPropType, textShadowOffset$noI18n: ShadowOffsetPropType,