Use node.baseURI for stringifying stylesheet hrefs (#1705)
This commit is contained in:
@@ -118,9 +118,9 @@ export function stringifyStylesheet(s: CSSStyleSheet): string | null {
|
||||
return null;
|
||||
}
|
||||
let sheetHref = s.href;
|
||||
if (!sheetHref && s.ownerNode && s.ownerNode.ownerDocument) {
|
||||
if (!sheetHref && s.ownerNode) {
|
||||
// an inline <style> element
|
||||
sheetHref = s.ownerNode.ownerDocument.location.href;
|
||||
sheetHref = s.ownerNode.baseURI;
|
||||
}
|
||||
const stringifiedRules = Array.from(rules, (rule: CSSRule) =>
|
||||
stringifyRule(rule, sheetHref),
|
||||
|
||||
Reference in New Issue
Block a user