Skip to content

Commit 2128ebe

Browse files
committed
Fix test under shadydom. Slight logic refactor.
1 parent fb741ee commit 2128ebe

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/mixins/element-mixin.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,8 @@
414414
this._importPath = meta.url.slice(0, meta.url.lastIndexOf('/') + 1);
415415
} else {
416416
const module = Polymer.DomModule && Polymer.DomModule.import(/** @type {PolymerElementConstructor} */ (this).is);
417-
if (module) {
418-
this._importPath = module ? module.assetpath : '';
419-
} else {
420-
this._importPath = Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.importPath;
421-
}
417+
this._importPath = (module && module.assetpath) ||
418+
Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.importPath;
422419
}
423420
}
424421
return this._importPath;

test/unit/resolveurl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
var resolvedUrl = new RegExp(`${folder}/foo\\.z`);
5959
var styleHashUrl = /url\('#bar'\)/;
6060
var styleAbsUrl = /url\('\/zot'\)/;
61-
var style = el.shadowRoot.querySelector('style') || document.querySelector('style[scope=p-r]');
61+
var style = el.shadowRoot.querySelector('style') || document.querySelector(`style[scope=${elementName}]`);
6262
assert.match(style.textContent, resolvedUrl, 'url not relative to main document');
6363
assert.match(style.textContent, styleHashUrl, 'hash url incorrectly resolved');
6464
assert.match(style.textContent, styleAbsUrl, 'absolute url incorrectly resolved');

0 commit comments

Comments
 (0)