@oozcitak/dom
Advanced tools
Comparing version 1.8.1 to 1.9.0
@@ -262,2 +262,6 @@ "use strict"; | ||
const node = nodes[i]; | ||
// set document element node | ||
if (util_1.Guard.isDocumentNode(parent) && util_1.Guard.isElementNode(node)) { | ||
parent._documentElement = node; | ||
} | ||
/** | ||
@@ -412,2 +416,6 @@ * 7.1. If child is null, then append node to parent’s children. | ||
const previousSibling = parent._lastChild; | ||
// set document element node | ||
if (util_1.Guard.isDocumentNode(parent) && util_1.Guard.isElementNode(node)) { | ||
parent._documentElement = node; | ||
} | ||
/** | ||
@@ -836,2 +844,6 @@ * 7. For each node in nodes, in tree order: | ||
const oldNextSibling = node._nextSibling; | ||
// set document element node | ||
if (util_1.Guard.isDocumentNode(parent) && util_1.Guard.isElementNode(node)) { | ||
parent._documentElement = null; | ||
} | ||
/** | ||
@@ -838,0 +850,0 @@ * 9. Remove node from its parent’s children. |
@@ -16,2 +16,3 @@ "use strict"; | ||
n = (c1 - 0xD800) * 0x400 + c2 - 0xDC00 + 0x10000; | ||
i++; | ||
} | ||
@@ -68,2 +69,3 @@ } | ||
n = (c1 - 0xD800) * 0x400 + c2 - 0xDC00 + 0x10000; | ||
i++; | ||
} | ||
@@ -128,2 +130,3 @@ } | ||
n = (c1 - 0xD800) * 0x400 + c2 - 0xDC00 + 0x10000; | ||
i++; | ||
} | ||
@@ -166,19 +169,12 @@ } | ||
for (let i = 0; i < chars.length; i++) { | ||
const c1 = chars.charCodeAt(i); | ||
let n = c1; | ||
if (c1 >= 0xD800 && c1 <= 0xDBFF && i < chars.length - 1) { | ||
const c2 = chars.charCodeAt(i + 1); | ||
if (c2 >= 0xDC00 && c2 <= 0xDFFF) { | ||
n = (c1 - 0xD800) * 0x400 + c2 - 0xDC00 + 0x10000; | ||
} | ||
} | ||
// PubId chars are all in the ASCII range, no need to check surrogates | ||
const n = chars.charCodeAt(i); | ||
// #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] | ||
if ((n >= 97 && n <= 122) || // [a-z] | ||
(n >= 65 && n <= 90) || // [A-Z] | ||
(n >= 48 && n <= 57) || // [0-9] | ||
n === 0x20 || n === 0xD || n === 0xA || | ||
n === 45 || n === 39 || n === 40 || n === 41 || n === 43 || n === 44 || | ||
n === 46 || n === 47 || n === 58 || n === 61 || n === 63 || n === 59 || | ||
n === 33 || n === 42 || n === 35 || n === 64 || n === 36 || n === 95 || | ||
n === 37) { | ||
(n >= 39 && n <= 59) || // ['()*+,-./] | [0-9] | [:;] | ||
n === 0x20 || n === 0xD || n === 0xA || // #x20 | #xD | #xA | ||
(n >= 35 && n <= 37) || // [#$%] | ||
n === 33 || // ! | ||
n === 61 || n === 63 || n === 64 || n === 95) { // [=?@_] | ||
continue; | ||
@@ -185,0 +181,0 @@ } |
@@ -20,2 +20,3 @@ import { DOMImplementation, DocumentType, Element, Text, NodeFilter, NodeType, Node, HTMLCollection, DocumentFragment, NodeList, WhatToShow, Attr, ProcessingInstruction, Comment, CDATASection, NodeIterator, TreeWalker, FilterResult, Range, Event, EventTarget, Origin, Document } from "./interfaces"; | ||
protected _implementation?: DOMImplementation; | ||
_documentElement: Element | null; | ||
_nodeDocumentOverwrite: Document | null; | ||
@@ -22,0 +23,0 @@ get _nodeDocument(): Document; |
@@ -43,2 +43,3 @@ "use strict"; | ||
this._mode = "no-quirks"; | ||
this._documentElement = null; | ||
this._nodeDocumentOverwrite = null; | ||
@@ -116,7 +117,3 @@ } | ||
*/ | ||
for (const child of this._children) { | ||
if (util_1.Guard.isElementNode(child)) | ||
return child; | ||
} | ||
return null; | ||
return this._documentElement; | ||
} | ||
@@ -123,0 +120,0 @@ /** @inheritdoc */ |
{ | ||
"name": "@oozcitak/dom", | ||
"version": "1.8.1", | ||
"version": "1.9.0", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "dom", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1086825
21512