Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit b0092ad

Browse files
author
ije
committed
refactor(dom): remove rootElement
1 parent ba300a3 commit b0092ad

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

vendor/deno-dom/document.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { Comment, Node, NodeType, Text } from "./node.ts";
55
import { DOM as NWAPI } from "./nwsapi-types.ts";
66

77
export function createHTMLDocument(titleStr?: string): Document {
8-
titleStr += "";
9-
108
// TODO: Figure out a way to make `setLock` invocations less redundant
119
setLock(false);
1210
const doc = new Document();
@@ -22,10 +20,9 @@ export function createHTMLDocument(titleStr?: string): Document {
2220
const body = new Element("body", html, []);
2321

2422
const title = new Element("title", head, []);
25-
const titleText = new Text(titleStr);
23+
const titleText = new Text(titleStr || '');
2624
title.appendChild(titleText);
2725

28-
doc.rootElement = html;
2926
doc.head = head;
3027
doc.body = body;
3128

@@ -75,13 +72,10 @@ export type VisibilityState = "visible" | "hidden" | "prerender";
7572
export type NamespaceURI = "http://www.w3.org/1999/xhtml" | "http://www.w3.org/2000/svg" | "http://www.w3.org/1998/Math/MathML";
7673

7774
export class Document extends Node {
78-
public rootElement: Element = <Element><unknown>null;
7975
public head: Element = <Element><unknown>null;
8076
public body: Element = <Element><unknown>null;
8177

82-
#lockState = false;
8378
#documentURI = "about:blank"; // TODO
84-
#title = "";
8579
#nwapi = NWAPI(this);
8680

8781
constructor() {

0 commit comments

Comments
 (0)