This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -54,15 +54,15 @@ class _CssShim {
54
54
55
55
static final RegExp CONTENT = new RegExp (
56
56
r"[^}]*"
57
- r"content\:[\s] *"
58
- r"' ([^' ]*)' "
57
+ r"content:\s *"
58
+ "('| \" ) ([^\\ 1 ]*)\\ 1 "
59
59
r"[^}]*}" ,
60
60
caseSensitive: false ,
61
61
multiLine: true
62
62
);
63
63
64
64
static final String HOST_TOKEN = '-host-element' ;
65
- static final RegExp COLON_SELECTORS = new RegExp (r'(' + HOST_TOKEN + r')(\(.*\)){0,1} (.*)' ,
65
+ static final RegExp COLON_SELECTORS = new RegExp (r'(' + HOST_TOKEN + r')(\(.*\))? (.*)' ,
66
66
caseSensitive: false );
67
67
static final RegExp SIMPLE_SELECTORS = new RegExp (r'([^:]*)(:*)(.*)' , caseSensitive: false );
68
68
static final RegExp IS_SELECTORS = new RegExp (r'\[is="([^\]]*)"\]' , caseSensitive: false );
@@ -152,7 +152,7 @@ class _CssShim {
152
152
}
153
153
154
154
String extractContent (_Rule rule) {
155
- return CONTENT .firstMatch (rule.body)[1 ];
155
+ return CONTENT .firstMatch (rule.body)[2 ];
156
156
}
157
157
158
158
String ruleToString (_Rule rule) {
@@ -412,4 +412,4 @@ class _Parser {
412
412
413
413
_Token get current => tokens[currentIndex];
414
414
_Token get next => tokens[currentIndex + 1 ];
415
- }
415
+ }
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ library css_shim_spec;
2
2
3
3
import '../_specs.dart' ;
4
4
import 'package:angular/core_dom/css_shim.dart' ;
5
- import 'dart:html' as dom;
6
5
7
6
main () {
8
7
describe ("cssShim" , () {
@@ -78,11 +77,17 @@ main() {
78
77
it ("should support polyfill-next-selector" , () {
79
78
var css = s ("polyfill-next-selector {content: 'x > y'} z {}" , "a" );
80
79
expect (css).toEqual ('x[a]>y[a] {}' );
80
+
81
+ css = s ('polyfill-next-selector {content: "x > y"} z {}' , "a" );
82
+ expect (css).toEqual ('x[a]>y[a] {}' );
81
83
});
82
84
83
85
it ("should support polyfill-unscoped-next-selector" , () {
84
86
var css = s ("polyfill-unscoped-next-selector {content: 'x > y'} z {}" , "a" );
85
87
expect (css).toEqual ('x > y {}' );
88
+
89
+ css = s ('polyfill-unscoped-next-selector {content: "x > y"} z {}' , "a" );
90
+ expect (css).toEqual ('x > y {}' );
86
91
});
87
92
88
93
it ("should support polyfill-non-strict-next-selector" , () {
@@ -100,4 +105,4 @@ main() {
100
105
expect (css).toEqual ('a x y {}' );
101
106
});
102
107
});
103
- }
108
+ }
You can’t perform that action at this time.
0 commit comments