File tree 3 files changed +42
-3
lines changed
3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change 9
9
-->
10
10
< script >
11
11
( function ( ) {
12
-
12
+
13
13
// Ensure that the `unresolved` attribute added by the WebComponents polyfills
14
14
// is removed. This is done as a convenience so users don't have to remember
15
15
// to do so themselves. This attribute provides FOUC prevention when
22
22
if ( window . WebComponents ) {
23
23
addEventListener ( 'WebComponentsReady' , resolve ) ;
24
24
} else {
25
- resolve ( ) ;
25
+ if ( document . readyState === 'interactive' || document . readyState === 'complete' ) {
26
+ resolve ( ) ;
27
+ } else {
28
+ addEventListener ( 'DOMContentLoaded' , resolve ) ;
29
+ }
26
30
}
27
31
28
32
} ) ( ) ;
Original file line number Diff line number Diff line change 48
48
'unit/dynamic-import.html' ,
49
49
'unit/dom-repeat.html' ,
50
50
'unit/dom-if.html' ,
51
- 'unit/dom-bind.html'
51
+ 'unit/dom-bind.html' ,
52
+ 'unit/script-after-import-in-head.html'
52
53
] ) ;
53
54
</ script >
54
55
</ body >
Original file line number Diff line number Diff line change
1
+ <!doctype html>
2
+ <!--
3
+ @license
4
+ Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
5
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
+ Code distributed by Google as part of the polymer project is also
9
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10
+ -->
11
+ < html lang ="en ">
12
+ < head >
13
+ < meta charset ="UTF-8 ">
14
+ < script src ="../../../web-component-tester/browser.js "> </ script >
15
+ < script >
16
+ var shouldRun = 'import' in document . createElement ( 'link' ) ;
17
+ </ script >
18
+ < link rel ="import " href ="../../polymer.html ">
19
+ < script > var SCRIPT_AFTER_IMPORT_IN_HEAD = true ; </ script >
20
+ </ head >
21
+ < body >
22
+
23
+ < script >
24
+ suite ( 'head scripts' , function ( ) {
25
+ var t = shouldRun ? test : test . skip ;
26
+ t ( 'script after import in head works' , function ( ) {
27
+ assert ( SCRIPT_AFTER_IMPORT_IN_HEAD ) ;
28
+ assert . equal ( document . body . getAttribute ( 'unresolved' ) , null ) ;
29
+ } ) ;
30
+ } ) ;
31
+ </ script >
32
+
33
+ </ body >
34
+ </ html >
You can’t perform that action at this time.
0 commit comments