Skip to content

Commit

Permalink
Change dom imports
Browse files Browse the repository at this point in the history
  • Loading branch information
stephband committed Sep 23, 2024
1 parent 28a7549 commit d610817
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/renderer/renderer-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ that DOM after the text node.

import Signal from 'fn/signal.js';
import Data from 'fn/data.js';
import { isCommentNode, isElementNode, isFragmentNode, isTextNode } from 'dom/node.js';
import isComment from 'dom/is-comment.js';
import isElement from 'dom/is-element.js';
import isFragment from 'dom/is-fragment.js';
import isTextNode from 'dom/is-text-node.js';

import include from '../include.js';
import deleteRange from '../dom/delete-range.js';
import Literal from '../template.js';
Expand Down Expand Up @@ -99,7 +103,7 @@ function objectToContents(state, object, i) {
}

// Object is a fragment
if (isFragmentNode(object)) {
if (isFragment(object)) {
let node;
while(node = object.firstChild) {
contents[++i].before(object.firstChild);
Expand All @@ -110,7 +114,7 @@ function objectToContents(state, object, i) {
}

// Object is a DOM node
if (isTextNode(object) || isElementNode(object) || isCommentNode(object)) {
if (isTextNode(object) || isElement(object) || isComment(object)) {
// Splice node into contents and the DOM
contents[++i].before(object);
if (window.DEBUG) ++stats.add;
Expand Down

0 comments on commit d610817

Please sign in to comment.