@@ -4,17 +4,16 @@ import cssSelector = require("ui/styling/css-selector");
44import cssParser = require( "css" ) ;
55import application = require( "application" ) ;
66import * as typesModule from "utils/types" ;
7- import * as utilsModule from "utils/utils" ;
87import * as fileSystemModule from "file-system" ;
98
109import keyframeAnimation = require( "ui/animation/keyframe-animation" ) ;
1110import cssAnimationParser = require( "./css-animation-parser" ) ;
1211import observable = require( "ui/core/dependency-observable" ) ;
1312
14- import { convertString } from "utils/utils" ;
15- import { RuleSet , Node , SelectorsMap , SelectorCore , SelectorsMatch , ChangeMap } from "ui/styling/css-selector" ;
16- import { StyleProperty , withStyleProperty } from "ui/styling/style-property" ;
17- import { getSpecialPropertySetter } from "ui/builder/special-properties" ;
13+ import { convertString } from "utils/utils" ;
14+ import { RuleSet , Node , SelectorsMap , SelectorCore , SelectorsMatch , ChangeMap } from "ui/styling/css-selector" ;
15+ import { StyleProperty , withStyleProperty } from "ui/styling/style-property" ;
16+ import { getSpecialPropertySetter } from "ui/builder/special-properties" ;
1817
1918const animationsSymbol : symbol = Symbol ( "animations" ) ;
2019
@@ -25,13 +24,6 @@ function ensureTypes() {
2524 }
2625}
2726
28- var utils : typeof utilsModule ;
29- function ensureUtils ( ) {
30- if ( ! utils ) {
31- utils = require ( "utils/utils" ) ;
32- }
33- }
34-
3527var fs : typeof fileSystemModule ;
3628function ensureFS ( ) {
3729 if ( ! fs ) {
@@ -144,20 +136,16 @@ export class StyleScope {
144136 let url = match && match [ 2 ] ;
145137
146138 if ( ! types . isNullOrUndefined ( url ) ) {
147- ensureUtils ( ) ;
148-
149- if ( utils . isFileOrResourcePath ( url ) ) {
150- ensureFS ( ) ;
139+ ensureFS ( ) ;
151140
152- let appDirectory = fs . knownFolders . currentApp ( ) . path ;
153- let fileName = resolveFileNameFromUrl ( url , appDirectory , fs . File . exists ) ;
141+ let appDirectory = fs . knownFolders . currentApp ( ) . path ;
142+ let fileName = resolveFileNameFromUrl ( url , appDirectory , fs . File . exists ) ;
154143
155- if ( fileName !== null ) {
156- let file : fileSystemModule . File = fs . File . fromPath ( fileName ) ;
157- let text = file . readTextSync ( ) ;
158- if ( text ) {
159- selectors = selectors . concat ( StyleScope . createSelectorsFromCss ( text , fileName , keyframes ) ) ;
160- }
144+ if ( fileName !== null ) {
145+ let file : fileSystemModule . File = fs . File . fromPath ( fileName ) ;
146+ let text = file . readTextSync ( ) ;
147+ if ( text ) {
148+ selectors = selectors . concat ( StyleScope . createSelectorsFromCss ( text , fileName , keyframes ) ) ;
161149 }
162150 }
163151 }
0 commit comments