File tree 2 files changed +20
-2
lines changed
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 408
408
var module = Polymer . DomModule . import ( this . constructor . is ) ;
409
409
var root = '' ;
410
410
if ( module ) {
411
- var assetPath = module . getAttribute ( 'assetpath' ) || '' ;
412
411
root = Polymer . ResolveUrl . resolveUrl (
413
- assetPath , module . ownerDocument . baseURI ) ;
412
+ module . assetpath , module . ownerDocument . baseURI ) ;
414
413
}
415
414
return Polymer . ResolveUrl . resolveUrl ( url , root ) ;
416
415
}
Original file line number Diff line number Diff line change 40
40
}
41
41
}
42
42
43
+ get assetpath ( ) {
44
+ let assetpath = this . __assetpath || this . getAttribute ( 'assetpath' ) ;
45
+ // Don't override existing assetpath.
46
+ if ( assetpath ) { }
47
+ // Polyfilled import.
48
+ else if ( window . HTMLImports && ! HTMLImports . useNative &&
49
+ HTMLImports . importForElement ) {
50
+ const imp = HTMLImports . importForElement ( this ) ;
51
+ assetpath = imp ? imp . href : '' ;
52
+ }
53
+ // Native import.
54
+ else if ( this . ownerDocument !== document && this . baseURI ) {
55
+ assetpath = this . baseURI ;
56
+ }
57
+ // Memoize.
58
+ this . __assetpath = assetpath ;
59
+ return assetpath ;
60
+ }
61
+
43
62
/**
44
63
* Registers the dom-module at a given id. This method should only be called
45
64
* when a dom-module is imperatively created. For
You can’t perform that action at this time.
0 commit comments