chore: cleanup

pull/18058/head
paoloricciuti 5 months ago
parent 38dc4aee42
commit 1886dc9aab

@ -12,17 +12,14 @@ export function append_styles(anchor, css) {
effect(() => {
var root = anchor.getRootNode();
// TODO: DOM access
var target = /** @type {ShadowRoot} */ (root).host
? /** @type {ShadowRoot} */ (root)
: // TODO: DOM access
/** @type {Document} */ (root).head ?? /** @type {Document} */ (root.ownerDocument).head;
: /** @type {Document} */ (root).head ?? /** @type {Document} */ (root.ownerDocument).head;
// Always querying the DOM is roughly the same perf as additionally checking for presence in a map first assuming
// that you'll get cache hits half of the time, so we just always query the dom for simplicity and code savings.
if (!(/** @type {Element} */ (target).querySelector('#' + css.hash))) {
const style = create_element('style');
// TODO: DOM access
style.id = css.hash;
set_text_content(style, css.code);

@ -45,7 +45,6 @@ export function add_form_reset_listener() {
// elements have not updated to their reset values yet
Promise.resolve().then(() => {
if (!evt.defaultPrevented) {
// TODO: DOM access
for (const e of /**@type {HTMLFormElement} */ (evt.target).elements) {
// @ts-expect-error
e.__on_r?.();

Loading…
Cancel
Save