Skip to content

Commit

Permalink
[biexport] fallback to shadow host id or class
Browse files Browse the repository at this point in the history
  • Loading branch information
campersau committed Feb 1, 2024
1 parent 9d68198 commit 4df9f02
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions biexport.js
Original file line number Diff line number Diff line change
Expand Up @@ -1630,10 +1630,10 @@
}
// this somehow crashes the browser by deloitte
if (includeStyles && view._oScrollableTable) { // make sure tables are rendered
view._oScrollableTable.setDisplaySize(Number.MAX_VALUE, Number.MAX_VALUE);
view._oScrollableTable.setTopLeftCell({ row: 0, col: 0 });
view._oScrollableTable.redrawTable();
includeStyles = false;
view._oScrollableTable.setDisplaySize(Number.MAX_VALUE, Number.MAX_VALUE);
view._oScrollableTable.setTopLeftCell({ row: 0, col: 0 });
view._oScrollableTable.redrawTable();
includeStyles = false;
}

grid.finishPartialProcessing && grid.finishPartialProcessing(); // create all cells
Expand Down Expand Up @@ -2223,9 +2223,13 @@
promises.push(getCssText(rule.styleSheet || Object.defineProperty({ href: rule.href && toAbsoluteUrl(baseUrl, rule.href) }, "cssRules", { get: () => { throw new Error() } }), baseUrl, urlCache, shadowHost).then(c => css[index] = c));
} else if (rule.type == CSSRule.STYLE_RULE) {
if (shadowHost) { // prefix with shadow host name...
css.push(shadowHost.localName);
var hostSelector = shadowHost.localName.includes("-") ? shadowHost.localName :
shadowHost.id ? "#" + shadowHost.id :
shadowHost.classList.length > 0 ? "." + Array.from(shadowHost.classList).join(".") :
shadowHost.localName;
css.push(hostSelector);
css.push(" ");
css.push(rule.selectorText.split(",").join("," + shadowHost.localName));
css.push(rule.selectorText.replace(/:host/g, "").split(",").join("," + hostSelector));
} else {
css.push(rule.selectorText);
}
Expand Down

0 comments on commit 4df9f02

Please sign in to comment.