@@ -187,38 +187,37 @@ function findPseudoElement(
187
187
} while ( ( vNode = vNode . parent ) ) ;
188
188
}
189
189
190
- const getPseudoElementArea = memoize ( function getPseudoElementArea (
191
- node ,
192
- pseudo
193
- ) {
194
- const style = window . getComputedStyle ( node , pseudo ) ;
195
- const matchPseudoStyle = ( prop , value ) =>
196
- style . getPropertyValue ( prop ) === value ;
197
- if (
198
- matchPseudoStyle ( 'content' , 'none' ) ||
199
- matchPseudoStyle ( 'display' , 'none' ) ||
200
- matchPseudoStyle ( 'visibility' , 'hidden' ) ||
201
- matchPseudoStyle ( 'position' , 'absolute' ) === false
202
- ) {
203
- return 0 ; // The pseudo element isn't visible
204
- }
190
+ const getPseudoElementArea = memoize (
191
+ function getPseudoElementArea ( node , pseudo ) {
192
+ const style = window . getComputedStyle ( node , pseudo ) ;
193
+ const matchPseudoStyle = ( prop , value ) =>
194
+ style . getPropertyValue ( prop ) === value ;
195
+ if (
196
+ matchPseudoStyle ( 'content' , 'none' ) ||
197
+ matchPseudoStyle ( 'display' , 'none' ) ||
198
+ matchPseudoStyle ( 'visibility' , 'hidden' ) ||
199
+ matchPseudoStyle ( 'position' , 'absolute' ) === false
200
+ ) {
201
+ return 0 ; // The pseudo element isn't visible
202
+ }
205
203
206
- if (
207
- getOwnBackgroundColor ( style ) . alpha === 0 &&
208
- matchPseudoStyle ( 'background-image' , 'none' )
209
- ) {
210
- return 0 ; // There is no background
211
- }
204
+ if (
205
+ getOwnBackgroundColor ( style ) . alpha === 0 &&
206
+ matchPseudoStyle ( 'background-image' , 'none' )
207
+ ) {
208
+ return 0 ; // There is no background
209
+ }
212
210
213
- // Find the size of the pseudo element;
214
- const pseudoWidth = parseUnit ( style . getPropertyValue ( 'width' ) ) ;
215
- const pseudoHeight = parseUnit ( style . getPropertyValue ( 'height' ) ) ;
216
- if ( pseudoWidth . unit !== 'px' || pseudoHeight . unit !== 'px' ) {
217
- // IE doesn't normalize to px. Infinity gets everything to undefined
218
- return pseudoWidth . value === 0 || pseudoHeight . value === 0 ? 0 : Infinity ;
211
+ // Find the size of the pseudo element;
212
+ const pseudoWidth = parseUnit ( style . getPropertyValue ( 'width' ) ) ;
213
+ const pseudoHeight = parseUnit ( style . getPropertyValue ( 'height' ) ) ;
214
+ if ( pseudoWidth . unit !== 'px' || pseudoHeight . unit !== 'px' ) {
215
+ // IE doesn't normalize to px. Infinity gets everything to undefined
216
+ return pseudoWidth . value === 0 || pseudoHeight . value === 0 ? 0 : Infinity ;
217
+ }
218
+ return pseudoWidth . value * pseudoHeight . value ;
219
219
}
220
- return pseudoWidth . value * pseudoHeight . value ;
221
- } ) ;
220
+ ) ;
222
221
223
222
function textIsEmojis ( visibleText ) {
224
223
const options = { nonBmp : true } ;
0 commit comments