This repository was archived by the owner on Sep 20, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +47
-29
lines changed Expand file tree Collapse file tree 8 files changed +47
-29
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,12 @@ window.CustomElements = window.CustomElements || {flags:{}};
16
16
// Flags. Convert url arguments to flags
17
17
var flags = { } ;
18
18
if ( ! flags . noOpts ) {
19
- location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( o ) {
20
- o = o . split ( '=' ) ;
21
- o [ 0 ] && ( flags [ o [ 0 ] ] = o [ 1 ] || true ) ;
19
+ location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( option ) {
20
+ var parts = option . split ( '=' ) ;
21
+ var match ;
22
+ if ( parts [ 0 ] && ( match = parts [ 0 ] . match ( / w c - ( .+ ) / ) ) ) {
23
+ flags [ match [ 1 ] ] = parts [ 1 ] || true ;
24
+ }
22
25
} ) ;
23
26
}
24
27
Original file line number Diff line number Diff line change @@ -16,9 +16,12 @@ window.HTMLImports = window.HTMLImports || {flags:{}};
16
16
// Flags. Convert url arguments to flags
17
17
var flags = { } ;
18
18
if ( ! flags . noOpts ) {
19
- location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( o ) {
20
- o = o . split ( '=' ) ;
21
- o [ 0 ] && ( flags [ o [ 0 ] ] = o [ 1 ] || true ) ;
19
+ location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( option ) {
20
+ var parts = option . split ( '=' ) ;
21
+ var match ;
22
+ if ( parts [ 0 ] && ( match = parts [ 0 ] . match ( / w c - ( .+ ) / ) ) ) {
23
+ flags [ match [ 1 ] ] = parts [ 1 ] || true ;
24
+ }
22
25
} ) ;
23
26
}
24
27
Original file line number Diff line number Diff line change @@ -11,19 +11,22 @@ window.WebComponents = window.WebComponents || {};
11
11
12
12
// process flags
13
13
( function ( scope ) {
14
-
14
+
15
15
// import
16
16
var flags = scope . flags || { } ;
17
-
17
+
18
18
var file = 'webcomponents-lite.js' ;
19
19
var script = document . querySelector ( 'script[src*="' + file + '"]' ) ;
20
20
21
21
// Flags. Convert url arguments to flags
22
22
if ( ! flags . noOpts ) {
23
23
// from url
24
- location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( o ) {
25
- o = o . split ( '=' ) ;
26
- o [ 0 ] && ( flags [ o [ 0 ] ] = o [ 1 ] || true ) ;
24
+ location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( option ) {
25
+ var parts = option . split ( '=' ) ;
26
+ var match ;
27
+ if ( parts [ 0 ] && ( match = parts [ 0 ] . match ( / w c - ( .+ ) / ) ) ) {
28
+ flags [ match [ 1 ] ] = parts [ 1 ] || true ;
29
+ }
27
30
} ) ;
28
31
// from script
29
32
if ( script ) {
@@ -48,7 +51,7 @@ window.WebComponents = window.WebComponents || {};
48
51
// Determine default settings.
49
52
// If any of these flags match 'native', then force native ShadowDOM; any
50
53
// other truthy value, or failure to detect native
51
- // ShadowDOM, results in polyfill
54
+ // ShadowDOM, results in polyfill
52
55
flags . shadow = ( flags . shadow || flags . shadowdom || flags . polyfill ) ;
53
56
if ( flags . shadow === 'native' ) {
54
57
flags . shadow = false ;
Original file line number Diff line number Diff line change @@ -21,9 +21,12 @@ window.WebComponents = window.WebComponents || {};
21
21
// Flags. Convert url arguments to flags
22
22
if ( ! flags . noOpts ) {
23
23
// from url
24
- location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( o ) {
25
- o = o . split ( '=' ) ;
26
- o [ 0 ] && ( flags [ o [ 0 ] ] = o [ 1 ] || true ) ;
24
+ location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( option ) {
25
+ var parts = option . split ( '=' ) ;
26
+ var match ;
27
+ if ( parts [ 0 ] && ( match = parts [ 0 ] . match ( / w c - ( .+ ) / ) ) ) {
28
+ flags [ match [ 1 ] ] = parts [ 1 ] || true ;
29
+ }
27
30
} ) ;
28
31
// from script
29
32
if ( script ) {
Original file line number Diff line number Diff line change 10
10
11
11
htmlSuite ( 'ShadowCss' , function ( ) {
12
12
htmlTest ( 'html/pseudo-scoping.html' ) ;
13
- htmlTest ( 'html/pseudo-scoping.html?shadow' ) ;
13
+ htmlTest ( 'html/pseudo-scoping.html?wc- shadow' ) ;
14
14
htmlTest ( 'html/pseudo-scoping-strict.html' ) ;
15
- htmlTest ( 'html/pseudo-scoping-strict.html?shadow' ) ;
15
+ htmlTest ( 'html/pseudo-scoping-strict.html?wc- shadow' ) ;
16
16
htmlTest ( 'html/polyfill-directive.html' ) ;
17
17
htmlTest ( 'html/polyfill-rule.html' ) ;
18
18
htmlTest ( 'html/colon-host.html' ) ;
19
- htmlTest ( 'html/colon-host.html?shadow' ) ;
20
- htmlTest ( 'html/combinators.html?shadow' ) ;
19
+ htmlTest ( 'html/colon-host.html?wc- shadow' ) ;
20
+ htmlTest ( 'html/combinators.html?wc- shadow' ) ;
21
21
htmlTest ( 'html/combinators-shadow.html' ) ;
22
- htmlTest ( 'html/combinators-shadow.html?shadow' ) ;
22
+ htmlTest ( 'html/combinators-shadow.html?wc- shadow' ) ;
23
23
htmlTest ( 'html/compressed.html' ) ;
24
24
htmlTest ( 'html/before-content.html' ) ;
25
- htmlTest ( 'html/before-content.html?shadow' ) ;
25
+ htmlTest ( 'html/before-content.html?wc- shadow' ) ;
26
26
htmlTest ( 'html/before-content.html' ) ;
27
27
htmlTest ( 'html/style-import.html' ) ;
28
28
htmlTest ( 'html/style-import-base-tag.html' ) ;
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ htmlSuite('loader and build', function() {
17
17
htmlSuite ( 'integration' , function ( ) {
18
18
htmlTest ( 'html/web-components.html' ) ;
19
19
htmlTest ( 'html/smoke.html' ) ;
20
- htmlTest ( 'html/smoke.html?shadow' ) ;
20
+ htmlTest ( 'html/smoke.html?wc- shadow' ) ;
21
21
htmlTest ( 'html/ce-import.html' ) ;
22
22
htmlTest ( 'html/ce-upgradedocumenttree.html' ) ;
23
- htmlTest ( 'html/ce-import.html?shadow' ) ;
23
+ htmlTest ( 'html/ce-import.html?wc- shadow' ) ;
24
24
htmlTest ( 'html/ce-upgrade-order.html' ) ;
25
25
} ) ;
26
26
Original file line number Diff line number Diff line change 21
21
var flags = { } ;
22
22
if ( ! flags . noOpts ) {
23
23
// from url
24
- location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( o ) {
25
- o = o . split ( '=' ) ;
26
- o [ 0 ] && ( flags [ o [ 0 ] ] = o [ 1 ] || true ) ;
24
+ location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( option ) {
25
+ var parts = option . split ( '=' ) ;
26
+ var match ;
27
+ if ( parts [ 0 ] && ( match = parts [ 0 ] . match ( / w c - ( .+ ) / ) ) ) {
28
+ flags [ match [ 1 ] ] = parts [ 1 ] || true ;
29
+ }
27
30
} ) ;
28
31
// from script
29
32
if ( script ) {
Original file line number Diff line number Diff line change 21
21
var flags = { } ;
22
22
if ( ! flags . noOpts ) {
23
23
// from url
24
- location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( o ) {
25
- o = o . split ( '=' ) ;
26
- o [ 0 ] && ( flags [ o [ 0 ] ] = o [ 1 ] || true ) ;
24
+ location . search . slice ( 1 ) . split ( '&' ) . forEach ( function ( option ) {
25
+ var parts = option . split ( '=' ) ;
26
+ var match ;
27
+ if ( parts [ 0 ] && ( match = parts [ 0 ] . match ( / w c - ( .+ ) / ) ) ) {
28
+ flags [ match [ 1 ] ] = parts [ 1 ] || true ;
29
+ }
27
30
} ) ;
28
31
// from script
29
32
if ( script ) {
You can’t perform that action at this time.
0 commit comments