happy-dom
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -27,3 +27,3 @@ "use strict"; | ||
var tagName = element.tagName.toLowerCase(); | ||
var rawAttributes = element.getRawAttributes(); | ||
var rawAttributes = element._getRawAttributes(); | ||
var isUnClosed = META_REGEXP.test(tagName); | ||
@@ -30,0 +30,0 @@ var isSelfClosed = SELF_CLOSED_REGEXP.test(tagName); |
@@ -36,3 +36,3 @@ "use strict"; | ||
while ((match = attributeRegexp.exec(part))) { | ||
if (element.attributesMap[match[1]] !== match[2].replace(/"/g, '')) { | ||
if (element._attributesMap[match[1]] !== match[2].replace(/"/g, '')) { | ||
return false; | ||
@@ -39,0 +39,0 @@ } |
@@ -48,3 +48,3 @@ "use strict"; | ||
var newElement = document.createElement(tagName); | ||
newElement.setRawAttributes(match[3]); | ||
newElement._setRawAttributes(match[3]); | ||
if (!SELF_CLOSING_ELEMENTS[tagName]) { | ||
@@ -51,0 +51,0 @@ currentParent = currentParent.appendChild(newElement); |
@@ -40,3 +40,3 @@ "use strict"; | ||
this.listener.callback = this.callback.bind(this); | ||
target.observe(this.listener); | ||
target._observe(this.listener); | ||
}; | ||
@@ -47,3 +47,3 @@ /** | ||
MutationObserverTest.prototype.disconnect = function () { | ||
this.target.unobserve(this.listener); | ||
this.target._unobserve(this.listener); | ||
}; | ||
@@ -50,0 +50,0 @@ /** |
@@ -71,4 +71,4 @@ "use strict"; | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { | ||
if (this._observers.length > 0) { | ||
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) { | ||
var observer = _a[_i]; | ||
@@ -75,0 +75,0 @@ if (observer.options.characterData) { |
@@ -18,3 +18,3 @@ import Node from './Node'; | ||
scrollLeft: number; | ||
readonly attributesMap: { | ||
_attributesMap: { | ||
[k: string]: string; | ||
@@ -143,7 +143,7 @@ }; | ||
*/ | ||
setRawAttributes(rawAttributes: string): void; | ||
_setRawAttributes(rawAttributes: string): void; | ||
/** | ||
* Returns raw attributes. | ||
*/ | ||
getRawAttributes(): string; | ||
_getRawAttributes(): string; | ||
/** | ||
@@ -150,0 +150,0 @@ * Attaches a shadow root. |
@@ -46,3 +46,3 @@ "use strict"; | ||
_this.scrollLeft = 0; | ||
_this.attributesMap = {}; | ||
_this._attributesMap = {}; | ||
return _this; | ||
@@ -195,7 +195,7 @@ } | ||
var attributes = []; | ||
for (var _i = 0, _a = Object.keys(this.attributesMap); _i < _a.length; _i++) { | ||
for (var _i = 0, _a = Object.keys(this._attributesMap); _i < _a.length; _i++) { | ||
var key = _a[_i]; | ||
var attribute = new Attribute_1.default(); | ||
attribute.name = key; | ||
attribute.value = this.attributesMap[key]; | ||
attribute.value = this._attributesMap[key]; | ||
attributes.push(attribute); | ||
@@ -239,3 +239,3 @@ } | ||
Element.prototype.hasAttributes = function () { | ||
return Object.keys(this.attributesMap).length > 0; | ||
return Object.keys(this._attributesMap).length > 0; | ||
}; | ||
@@ -250,4 +250,4 @@ /** | ||
var lowerName = name.toLowerCase(); | ||
var oldValue = this.attributesMap[lowerName] !== undefined ? this.attributesMap[lowerName] : null; | ||
this.attributesMap[lowerName] = String(value); | ||
var oldValue = this._attributesMap[lowerName] !== undefined ? this._attributesMap[lowerName] : null; | ||
this._attributesMap[lowerName] = String(value); | ||
if (this.attributeChangedCallback) { | ||
@@ -257,4 +257,4 @@ this.attributeChangedCallback(name, oldValue, value); | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { | ||
if (this._observers.length > 0) { | ||
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) { | ||
var observer = _a[_i]; | ||
@@ -279,3 +279,3 @@ if (observer.options.attributes && | ||
var lowerName = name.toLowerCase(); | ||
return this.attributesMap[lowerName] !== undefined ? this.attributesMap[lowerName] : null; | ||
return this._attributesMap[lowerName] !== undefined ? this._attributesMap[lowerName] : null; | ||
}; | ||
@@ -289,7 +289,7 @@ /** | ||
var lowerName = name.toLowerCase(); | ||
var oldValue = this.attributesMap[lowerName] !== undefined ? this.attributesMap[lowerName] : null; | ||
delete this.attributesMap[lowerName]; | ||
var oldValue = this._attributesMap[lowerName] !== undefined ? this._attributesMap[lowerName] : null; | ||
delete this._attributesMap[lowerName]; | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { | ||
if (this._observers.length > 0) { | ||
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) { | ||
var observer = _a[_i]; | ||
@@ -312,3 +312,3 @@ if (observer.options.attributes && | ||
*/ | ||
Element.prototype.setRawAttributes = function (rawAttributes) { | ||
Element.prototype._setRawAttributes = function (rawAttributes) { | ||
rawAttributes = rawAttributes.trim(); | ||
@@ -319,5 +319,5 @@ if (rawAttributes) { | ||
while ((match = attributeRegexp.exec(rawAttributes))) { | ||
var name_1 = match[1].toLowerCase(); | ||
var name = match[1].toLowerCase(); | ||
var value = he_1.decode(match[2] || match[3] || match[4] || ''); | ||
this.attributesMap[name_1] = value; | ||
this._attributesMap[name] = value; | ||
} | ||
@@ -329,7 +329,7 @@ } | ||
*/ | ||
Element.prototype.getRawAttributes = function () { | ||
Element.prototype._getRawAttributes = function () { | ||
var _this = this; | ||
return Object.keys(this.attributesMap) | ||
return Object.keys(this._attributesMap) | ||
.map(function (key) { | ||
return key + '="' + he_1.encode(_this.attributesMap[key]) + '"'; | ||
return key + '="' + he_1.encode(_this._attributesMap[key]) + '"'; | ||
}) | ||
@@ -336,0 +336,0 @@ .join(' '); |
@@ -52,7 +52,7 @@ import Element from './Element'; | ||
*/ | ||
setRawAttributes(rawAttributes: string): void; | ||
_setRawAttributes(rawAttributes: string): void; | ||
/** | ||
* Defines initial properties. | ||
*/ | ||
private defineInitialProperties; | ||
private _defineInitialProperties; | ||
} |
@@ -79,3 +79,3 @@ "use strict"; | ||
var observedAttributes = Object.keys(observedPropertyAttributes); | ||
if (observedAttributes.includes(lowerName)) { | ||
if (value !== null && value !== undefined && observedAttributes.includes(lowerName)) { | ||
var property = observedPropertyAttributes[lowerName]; | ||
@@ -91,6 +91,6 @@ this[property] = typeof this[property] === 'boolean' ? value !== null : String(value); | ||
*/ | ||
HTMLElement.prototype.setRawAttributes = function (rawAttributes) { | ||
_super.prototype.setRawAttributes.call(this, rawAttributes); | ||
HTMLElement.prototype._setRawAttributes = function (rawAttributes) { | ||
_super.prototype._setRawAttributes.call(this, rawAttributes); | ||
if (rawAttributes.trim()) { | ||
this.defineInitialProperties(); | ||
this._defineInitialProperties(); | ||
} | ||
@@ -101,9 +101,9 @@ }; | ||
*/ | ||
HTMLElement.prototype.defineInitialProperties = function () { | ||
HTMLElement.prototype._defineInitialProperties = function () { | ||
var observedPropertyAttributes = this.constructor._observedPropertyAttributes; | ||
for (var _i = 0, _a = Object.keys(observedPropertyAttributes); _i < _a.length; _i++) { | ||
var name_1 = _a[_i]; | ||
var attribute = this.attributesMap[name_1]; | ||
if (attribute !== null) { | ||
var property = observedPropertyAttributes[name_1]; | ||
var name = _a[_i]; | ||
var attribute = this._attributesMap[name]; | ||
if (attribute !== null && attribute !== undefined) { | ||
var property = observedPropertyAttributes[name]; | ||
switch (typeof this[property]) { | ||
@@ -110,0 +110,0 @@ case 'boolean': |
@@ -15,3 +15,3 @@ import NodeType from './NodeType'; | ||
protected _isConnected: boolean; | ||
protected observers: MutationObserverListener[]; | ||
protected _observers: MutationObserverListener[]; | ||
/** | ||
@@ -83,8 +83,2 @@ * Constructor. | ||
/** | ||
* Returns a unique ID. | ||
* | ||
* @return {string} ID. | ||
*/ | ||
getUniqueID(): string; | ||
/** | ||
* Clones a node. | ||
@@ -131,3 +125,3 @@ * | ||
*/ | ||
observe(listener: MutationObserverListener): void; | ||
_observe(listener: MutationObserverListener): void; | ||
/** | ||
@@ -139,3 +133,3 @@ * Stops observing the node. | ||
*/ | ||
unobserve(listener: MutationObserverListener): void; | ||
_unobserve(listener: MutationObserverListener): void; | ||
} |
@@ -24,3 +24,2 @@ "use strict"; | ||
var MutationType_1 = __importDefault(require("../../mutation-observer/MutationType")); | ||
var ASCII = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); | ||
/** | ||
@@ -42,3 +41,3 @@ * Node | ||
// Custom Properties (not part of HTML standard) | ||
_this.observers = []; | ||
_this._observers = []; | ||
_this.ownerDocument = _this.constructor.ownerDocument; | ||
@@ -183,15 +182,2 @@ return _this; | ||
/** | ||
* Returns a unique ID. | ||
* | ||
* @return {string} ID. | ||
*/ | ||
Node.prototype.getUniqueID = function () { | ||
if (this.parentNode) { | ||
var childNodeIndex = this.parentNode.childNodes.indexOf(this); | ||
var id = ASCII[childNodeIndex] !== undefined ? ASCII[childNodeIndex] : childNodeIndex !== -1 ? childNodeIndex : ''; | ||
return this.parentNode.getUniqueID() + id; | ||
} | ||
return 'a'; | ||
}; | ||
/** | ||
* Clones a node. | ||
@@ -207,3 +193,3 @@ * | ||
var key = _a[_i]; | ||
if (key !== '_isConnected' && key !== 'observers') { | ||
if (key !== '_isConnected' && key !== '_observers') { | ||
if (key === 'childNodes') { | ||
@@ -229,2 +215,5 @@ if (deep) { | ||
} | ||
else if (key === '_attributesMap') { | ||
clone[key] = Object.assign({}, this[key]); | ||
} | ||
else { | ||
@@ -264,10 +253,10 @@ clone[key] = this[key]; | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
if (this._observers.length > 0) { | ||
var record = new MutationRecord_1.default(); | ||
record.type = MutationType_1.default.childList; | ||
record.addedNodes = [node]; | ||
for (var _b = 0, _c = this.observers; _b < _c.length; _b++) { | ||
for (var _b = 0, _c = this._observers; _b < _c.length; _b++) { | ||
var observer = _c[_b]; | ||
if (observer.options.subtree) { | ||
node.observe(observer); | ||
node._observe(observer); | ||
} | ||
@@ -295,9 +284,9 @@ if (observer.options.childList) { | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
if (this._observers.length > 0) { | ||
var record = new MutationRecord_1.default(); | ||
record.type = MutationType_1.default.childList; | ||
record.removedNodes = [node]; | ||
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { | ||
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) { | ||
var observer = _a[_i]; | ||
node.unobserve(observer); | ||
node._unobserve(observer); | ||
if (observer.options.childList) { | ||
@@ -341,10 +330,10 @@ observer.callback([record]); | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
if (this._observers.length > 0) { | ||
var record = new MutationRecord_1.default(); | ||
record.type = MutationType_1.default.childList; | ||
record.addedNodes = [newNode]; | ||
for (var _b = 0, _c = this.observers; _b < _c.length; _b++) { | ||
for (var _b = 0, _c = this._observers; _b < _c.length; _b++) { | ||
var observer = _c[_b]; | ||
if (observer.options.subtree) { | ||
newNode.observe(observer); | ||
newNode._observe(observer); | ||
} | ||
@@ -376,8 +365,8 @@ if (observer.options.childList) { | ||
*/ | ||
Node.prototype.observe = function (listener) { | ||
this.observers.push(listener); | ||
Node.prototype._observe = function (listener) { | ||
this._observers.push(listener); | ||
if (listener.options.subtree) { | ||
for (var _i = 0, _a = this.childNodes; _i < _a.length; _i++) { | ||
var node = _a[_i]; | ||
node.observe(listener); | ||
node._observe(listener); | ||
} | ||
@@ -392,6 +381,6 @@ } | ||
*/ | ||
Node.prototype.unobserve = function (listener) { | ||
var index = this.observers.indexOf(listener); | ||
Node.prototype._unobserve = function (listener) { | ||
var index = this._observers.indexOf(listener); | ||
if (index !== -1) { | ||
this.observers.splice(index, 1); | ||
this._observers.splice(index, 1); | ||
} | ||
@@ -401,3 +390,3 @@ if (listener.options.subtree) { | ||
var node = _a[_i]; | ||
node.unobserve(listener); | ||
node._unobserve(listener); | ||
} | ||
@@ -404,0 +393,0 @@ } |
@@ -71,4 +71,4 @@ "use strict"; | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { | ||
if (this._observers.length > 0) { | ||
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) { | ||
var observer = _a[_i]; | ||
@@ -75,0 +75,0 @@ if (observer.options.characterData) { |
@@ -159,3 +159,3 @@ "use strict"; | ||
get: function () { | ||
return this.type !== 'hidden' && this.type !== 'reset' && this.type !== 'button' && !this.disabled && !this['readOnly']; | ||
return (this.type !== 'hidden' && this.type !== 'reset' && this.type !== 'button' && !this.disabled && !this['readOnly']); | ||
}, | ||
@@ -162,0 +162,0 @@ enumerable: true, |
import HTMLElement from '../basic-types/HTMLElement'; | ||
import Node from '../basic-types/Node'; | ||
import HTMLFormElement from './HTMLFormElement'; | ||
/** | ||
@@ -16,5 +17,3 @@ * HTMLTextAreaElement. | ||
"value": string; | ||
"autocomplete": string; /** | ||
* HTMLTextAreaElement. | ||
*/ | ||
"autocomplete": string; | ||
"minlength": string; | ||
@@ -21,0 +20,0 @@ "maxlength": string; |
@@ -48,11 +48,11 @@ "use strict"; | ||
var child = element.children[i]; | ||
var name_1 = child.getAttribute('slot') || 'default'; | ||
slotChildren[name_1] = slotChildren[name_1] || []; | ||
slotChildren[name_1].push(child); | ||
var name = child.getAttribute('slot') || 'default'; | ||
slotChildren[name] = slotChildren[name] || []; | ||
slotChildren[name].push(child); | ||
} | ||
for (var _i = 0, slots_1 = slots; _i < slots_1.length; _i++) { | ||
var slot = slots_1[_i]; | ||
var name_2 = slot.getAttribute('name') || 'default'; | ||
if (slotChildren[name_2]) { | ||
for (var _a = 0, _b = slotChildren[name_2]; _a < _b.length; _a++) { | ||
var name = slot.getAttribute('name') || 'default'; | ||
if (slotChildren[name]) { | ||
for (var _a = 0, _b = slotChildren[name]; _a < _b.length; _a++) { | ||
var child = _b[_a]; | ||
@@ -59,0 +59,0 @@ slot.parentNode.insertBefore(child, slot); |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import CustomElementRegistry from './html-element/CustomElementRegistry'; | ||
@@ -10,2 +11,5 @@ import Document from './nodes/basic-types/Document'; | ||
import HTMLTemplateElement from './nodes/elements/HTMLTemplateElement'; | ||
import HTMLFormElement from './nodes/elements/HTMLFormElement'; | ||
import HTMLInputElement from './nodes/elements/HTMLInputElement'; | ||
import HTMLTextAreaElement from './nodes/elements/HTMLTextAreaElement'; | ||
import DocumentFragment from './nodes/basic-types/DocumentFragment'; | ||
@@ -29,2 +33,5 @@ import TreeWalker from './tree-walker/TreeWalker'; | ||
HTMLElement: typeof HTMLElement; | ||
HTMLInputElement: typeof HTMLInputElement; | ||
HTMLFormElement: typeof HTMLFormElement; | ||
HTMLTextAreaElement: typeof HTMLTextAreaElement; | ||
HTMLTemplateElement: typeof HTMLTemplateElement; | ||
@@ -31,0 +38,0 @@ Element: typeof Element; |
@@ -29,2 +29,5 @@ "use strict"; | ||
var HTMLTemplateElement_1 = __importDefault(require("./nodes/elements/HTMLTemplateElement")); | ||
var HTMLFormElement_1 = __importDefault(require("./nodes/elements/HTMLFormElement")); | ||
var HTMLInputElement_1 = __importDefault(require("./nodes/elements/HTMLInputElement")); | ||
var HTMLTextAreaElement_1 = __importDefault(require("./nodes/elements/HTMLTextAreaElement")); | ||
var DocumentFragment_1 = __importDefault(require("./nodes/basic-types/DocumentFragment")); | ||
@@ -56,2 +59,5 @@ var TreeWalker_1 = __importDefault(require("./tree-walker/TreeWalker")); | ||
_this.HTMLElement = HTMLElement_1.default; | ||
_this.HTMLInputElement = HTMLInputElement_1.default; | ||
_this.HTMLFormElement = HTMLFormElement_1.default; | ||
_this.HTMLTextAreaElement = HTMLTextAreaElement_1.default; | ||
_this.HTMLTemplateElement = HTMLTemplateElement_1.default; | ||
@@ -58,0 +64,0 @@ _this.Element = Element_1.default; |
{ | ||
"name": "happy-dom", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/capricorn86/happy-dom#readme", |
@@ -197,2 +197,3 @@ # Happy DOM | ||
| ------- | ---------- | ---------------- | | ||
| 0.4.3 | 2019-10-08 | Fixes issue with clones nodes referring to the same attributes. (#5) | | ||
| 0.4.2 | 2019-10-08 | Fixes issue where query selector not returning correct elements. (#2) | | ||
@@ -199,0 +200,0 @@ | 0.4.1 | 2019-10-07 | Fixes issue with self closing elements become parent of next element in HTMLParser. (#1) | |
@@ -26,3 +26,3 @@ import Element from '../nodes/basic-types/Element'; | ||
const tagName = element.tagName.toLowerCase(); | ||
const rawAttributes = element.getRawAttributes(); | ||
const rawAttributes = element._getRawAttributes(); | ||
const isUnClosed = META_REGEXP.test(tagName); | ||
@@ -29,0 +29,0 @@ const isSelfClosed = SELF_CLOSED_REGEXP.test(tagName); |
@@ -48,3 +48,3 @@ import Element from '../nodes/basic-types/Element'; | ||
while ((match = attributeRegexp.exec(part))) { | ||
if (element.attributesMap[match[1]] !== match[2].replace(/"/g, '')) { | ||
if (element._attributesMap[match[1]] !== match[2].replace(/"/g, '')) { | ||
return false; | ||
@@ -51,0 +51,0 @@ } |
@@ -52,3 +52,3 @@ import Node from '../nodes/basic-types/Node'; | ||
const newElement = document.createElement(tagName); | ||
newElement.setRawAttributes(match[3]); | ||
newElement._setRawAttributes(match[3]); | ||
@@ -55,0 +55,0 @@ if (!SELF_CLOSING_ELEMENTS[tagName]) { |
@@ -32,3 +32,3 @@ import Node from '../nodes/basic-types/Node'; | ||
public observe(target: Node, options: IMutationObserverInit): void { | ||
if(!target) { | ||
if (!target) { | ||
throw new Error('Failed to observer. The first parameter "target" should be of type "Node".'); | ||
@@ -44,3 +44,3 @@ } | ||
target.observe(this.listener); | ||
target._observe(this.listener); | ||
} | ||
@@ -52,3 +52,3 @@ | ||
public disconnect(): void { | ||
this.target.unobserve(this.listener); | ||
this.target._unobserve(this.listener); | ||
} | ||
@@ -55,0 +55,0 @@ |
@@ -50,4 +50,4 @@ import Node from './Node'; | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
for (const observer of this.observers) { | ||
if (this._observers.length > 0) { | ||
for (const observer of this._observers) { | ||
if (observer.options.characterData) { | ||
@@ -54,0 +54,0 @@ const record = new MutationRecord(); |
@@ -26,3 +26,3 @@ import Node from './Node'; | ||
public scrollLeft = 0; | ||
public readonly attributesMap: { [k: string]: string } = {}; | ||
public _attributesMap: { [k: string]: string } = {}; | ||
@@ -152,6 +152,6 @@ /** | ||
const attributes = []; | ||
for (const key of Object.keys(this.attributesMap)) { | ||
for (const key of Object.keys(this._attributesMap)) { | ||
const attribute = new Attribute(); | ||
attribute.name = key; | ||
attribute.value = this.attributesMap[key]; | ||
attribute.value = this._attributesMap[key]; | ||
attributes.push(attribute); | ||
@@ -196,3 +196,3 @@ } | ||
public hasAttributes(): boolean { | ||
return Object.keys(this.attributesMap).length > 0; | ||
return Object.keys(this._attributesMap).length > 0; | ||
} | ||
@@ -208,4 +208,4 @@ | ||
const lowerName = name.toLowerCase(); | ||
const oldValue = this.attributesMap[lowerName] !== undefined ? this.attributesMap[lowerName] : null; | ||
this.attributesMap[lowerName] = String(value); | ||
const oldValue = this._attributesMap[lowerName] !== undefined ? this._attributesMap[lowerName] : null; | ||
this._attributesMap[lowerName] = String(value); | ||
@@ -217,4 +217,4 @@ if (this.attributeChangedCallback) { | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
for (const observer of this.observers) { | ||
if (this._observers.length > 0) { | ||
for (const observer of this._observers) { | ||
if ( | ||
@@ -241,3 +241,3 @@ observer.options.attributes && | ||
const lowerName = name.toLowerCase(); | ||
return this.attributesMap[lowerName] !== undefined ? this.attributesMap[lowerName] : null; | ||
return this._attributesMap[lowerName] !== undefined ? this._attributesMap[lowerName] : null; | ||
} | ||
@@ -252,8 +252,8 @@ | ||
const lowerName = name.toLowerCase(); | ||
const oldValue = this.attributesMap[lowerName] !== undefined ? this.attributesMap[lowerName] : null; | ||
delete this.attributesMap[lowerName]; | ||
const oldValue = this._attributesMap[lowerName] !== undefined ? this._attributesMap[lowerName] : null; | ||
delete this._attributesMap[lowerName]; | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
for (const observer of this.observers) { | ||
if (this._observers.length > 0) { | ||
for (const observer of this._observers) { | ||
if ( | ||
@@ -278,3 +278,3 @@ observer.options.attributes && | ||
*/ | ||
public setRawAttributes(rawAttributes: string): void { | ||
public _setRawAttributes(rawAttributes: string): void { | ||
rawAttributes = rawAttributes.trim(); | ||
@@ -287,3 +287,3 @@ if (rawAttributes) { | ||
const value = decode(match[2] || match[3] || match[4] || ''); | ||
this.attributesMap[name] = value; | ||
this._attributesMap[name] = value; | ||
} | ||
@@ -296,6 +296,6 @@ } | ||
*/ | ||
public getRawAttributes(): string { | ||
return Object.keys(this.attributesMap) | ||
public _getRawAttributes(): string { | ||
return Object.keys(this._attributesMap) | ||
.map(key => { | ||
return key + '="' + encode(this.attributesMap[key]) + '"'; | ||
return key + '="' + encode(this._attributesMap[key]) + '"'; | ||
}) | ||
@@ -302,0 +302,0 @@ .join(' '); |
@@ -60,3 +60,3 @@ import Element from './Element'; | ||
const observedAttributes = Object.keys(observedPropertyAttributes); | ||
if (observedAttributes.includes(lowerName)) { | ||
if (value !== null && value !== undefined && observedAttributes.includes(lowerName)) { | ||
const property = observedPropertyAttributes[lowerName]; | ||
@@ -73,6 +73,6 @@ this[property] = typeof this[property] === 'boolean' ? value !== null : String(value); | ||
*/ | ||
public setRawAttributes(rawAttributes: string): void { | ||
super.setRawAttributes(rawAttributes); | ||
public _setRawAttributes(rawAttributes: string): void { | ||
super._setRawAttributes(rawAttributes); | ||
if (rawAttributes.trim()) { | ||
this.defineInitialProperties(); | ||
this._defineInitialProperties(); | ||
} | ||
@@ -84,9 +84,9 @@ } | ||
*/ | ||
private defineInitialProperties(): void { | ||
private _defineInitialProperties(): void { | ||
const observedPropertyAttributes = (<typeof HTMLElement>this.constructor)._observedPropertyAttributes; | ||
for (const name of Object.keys(observedPropertyAttributes)) { | ||
const attribute = this.attributesMap[name]; | ||
const attribute = this._attributesMap[name]; | ||
if (attribute !== null) { | ||
if (attribute !== null && attribute !== undefined) { | ||
const property = observedPropertyAttributes[name]; | ||
@@ -93,0 +93,0 @@ switch (typeof this[property]) { |
@@ -9,4 +9,2 @@ import NodeType from './NodeType'; | ||
const ASCII = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); | ||
/** | ||
@@ -27,3 +25,3 @@ * Node | ||
// Custom Properties (not part of HTML standard) | ||
protected observers: MutationObserverListener[] = []; | ||
protected _observers: MutationObserverListener[] = []; | ||
@@ -166,17 +164,2 @@ /** | ||
/** | ||
* Returns a unique ID. | ||
* | ||
* @return {string} ID. | ||
*/ | ||
public getUniqueID(): string { | ||
if (this.parentNode) { | ||
const childNodeIndex = this.parentNode.childNodes.indexOf(this); | ||
const id = | ||
ASCII[childNodeIndex] !== undefined ? ASCII[childNodeIndex] : childNodeIndex !== -1 ? childNodeIndex : ''; | ||
return this.parentNode.getUniqueID() + id; | ||
} | ||
return 'a'; | ||
} | ||
/** | ||
* Clones a node. | ||
@@ -190,3 +173,3 @@ * | ||
for (const key of Object.keys(this)) { | ||
if(key !== '_isConnected' && key !== 'observers') { | ||
if (key !== '_isConnected' && key !== '_observers') { | ||
if (key === 'childNodes') { | ||
@@ -208,2 +191,4 @@ if (deep) { | ||
clone[key] = new ClassList(<any>clone); | ||
} else if (key === '_attributesMap') { | ||
clone[key] = Object.assign({}, this[key]); | ||
} else { | ||
@@ -248,3 +233,3 @@ clone[key] = this[key]; | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
if (this._observers.length > 0) { | ||
const record = new MutationRecord(); | ||
@@ -254,5 +239,5 @@ record.type = MutationTypeConstant.childList; | ||
for (const observer of this.observers) { | ||
for (const observer of this._observers) { | ||
if (observer.options.subtree) { | ||
node.observe(observer); | ||
node._observe(observer); | ||
} | ||
@@ -283,3 +268,3 @@ if (observer.options.childList) { | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
if (this._observers.length > 0) { | ||
const record = new MutationRecord(); | ||
@@ -289,4 +274,4 @@ record.type = MutationTypeConstant.childList; | ||
for (const observer of this.observers) { | ||
node.unobserve(observer); | ||
for (const observer of this._observers) { | ||
node._unobserve(observer); | ||
if (observer.options.childList) { | ||
@@ -337,3 +322,3 @@ observer.callback([record]); | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
if (this._observers.length > 0) { | ||
const record = new MutationRecord(); | ||
@@ -343,5 +328,5 @@ record.type = MutationTypeConstant.childList; | ||
for (const observer of this.observers) { | ||
for (const observer of this._observers) { | ||
if (observer.options.subtree) { | ||
newNode.observe(observer); | ||
newNode._observe(observer); | ||
} | ||
@@ -377,7 +362,7 @@ if (observer.options.childList) { | ||
*/ | ||
public observe(listener: MutationObserverListener): void { | ||
this.observers.push(listener); | ||
public _observe(listener: MutationObserverListener): void { | ||
this._observers.push(listener); | ||
if (listener.options.subtree) { | ||
for (const node of this.childNodes) { | ||
node.observe(listener); | ||
node._observe(listener); | ||
} | ||
@@ -393,10 +378,10 @@ } | ||
*/ | ||
public unobserve(listener: MutationObserverListener): void { | ||
const index = this.observers.indexOf(listener); | ||
public _unobserve(listener: MutationObserverListener): void { | ||
const index = this._observers.indexOf(listener); | ||
if (index !== -1) { | ||
this.observers.splice(index, 1); | ||
this._observers.splice(index, 1); | ||
} | ||
if (listener.options.subtree) { | ||
for (const node of this.childNodes) { | ||
node.unobserve(listener); | ||
node._unobserve(listener); | ||
} | ||
@@ -403,0 +388,0 @@ } |
@@ -50,4 +50,4 @@ import Node from './Node'; | ||
// MutationObserver | ||
if (this.observers.length > 0) { | ||
for (const observer of this.observers) { | ||
if (this._observers.length > 0) { | ||
for (const observer of this._observers) { | ||
if (observer.options.characterData) { | ||
@@ -54,0 +54,0 @@ const record = new MutationRecord(); |
@@ -9,4 +9,8 @@ import HTMLElement from '../basic-types/HTMLElement'; | ||
export default class HTMLFormElement extends HTMLElement { | ||
protected static _observedPropertyAttributes = Object.assign({}, HTMLElement._observedPropertyAttributes, HTMLFormPropertyAttributes); | ||
protected static _observedPropertyAttributes = Object.assign( | ||
{}, | ||
HTMLElement._observedPropertyAttributes, | ||
HTMLFormPropertyAttributes | ||
); | ||
public name: string = null; | ||
@@ -22,25 +26,25 @@ public method: string = null; | ||
/** | ||
* Returns input elements. | ||
* | ||
* @return {Element[]} Elements. | ||
*/ | ||
public get elements(): Element[] { | ||
return this.querySelectorAll('input,textarea'); | ||
} | ||
/** | ||
* Returns input elements. | ||
* | ||
* @return {Element[]} Elements. | ||
*/ | ||
public get elements(): Element[] { | ||
return this.querySelectorAll('input,textarea'); | ||
} | ||
/** | ||
* Returns number of input elements. | ||
* | ||
* @return {number} Length. | ||
*/ | ||
public get length(): number { | ||
return this.elements.length; | ||
} | ||
/** | ||
* Returns number of input elements. | ||
* | ||
* @return {number} Length. | ||
*/ | ||
public get length(): number { | ||
return this.elements.length; | ||
} | ||
/** | ||
* Submits form. | ||
*/ | ||
public submit(): void {} | ||
/** | ||
@@ -50,3 +54,3 @@ * Resets form. | ||
public reset(): void {} | ||
/** | ||
@@ -53,0 +57,0 @@ * Reports validity. |
@@ -10,142 +10,148 @@ import HTMLElement from '../basic-types/HTMLElement'; | ||
export default class HTMLInputElement extends HTMLElement { | ||
protected static _observedPropertyAttributes = Object.assign({}, HTMLElement._observedPropertyAttributes, HTMLInputPropertyAttributes); | ||
// Related to parent form. | ||
protected static _observedPropertyAttributes = Object.assign( | ||
{}, | ||
HTMLElement._observedPropertyAttributes, | ||
HTMLInputPropertyAttributes | ||
); | ||
// Related to parent form. | ||
public form: HTMLFormElement = null; | ||
public formAction: string = ''; | ||
public formMethod: string = ''; | ||
public formNoValidate: boolean = false; | ||
// Any type of input | ||
public name: string = ''; | ||
public type: string = 'text'; | ||
public disabled: boolean = false; | ||
public autofocus: boolean = false; | ||
public required: boolean = false; | ||
public _value: string = ''; | ||
public formNoValidate: boolean = false; | ||
// Type specific: checkbox/radio | ||
public _checked: boolean = false; | ||
public defaultChecked: boolean = null; | ||
public indeterminate: boolean = false; | ||
// Any type of input | ||
public name: string = ''; | ||
public type: string = 'text'; | ||
public disabled: boolean = false; | ||
public autofocus: boolean = false; | ||
public required: boolean = false; | ||
public _value: string = ''; | ||
// Type specific: image | ||
public alt: string = ''; | ||
public height: number = 0; | ||
public src: string = null; | ||
public width: number = 0; | ||
// Type specific: checkbox/radio | ||
public _checked: boolean = false; | ||
public defaultChecked: boolean = null; | ||
public indeterminate: boolean = false; | ||
// Type specific: file | ||
public accept: string = null; | ||
public allowdirs: string = null; | ||
// Type specific: image | ||
public alt: string = ''; | ||
public height: number = 0; | ||
public src: string = null; | ||
public width: number = 0; | ||
// Type specific: text/number | ||
public autocomplete: string = ''; | ||
public min: string = ''; | ||
public max: string = ''; | ||
public minLength: number = -1; | ||
public maxLength: number = -1; | ||
public pattern: string = ''; | ||
public placeholder: string = ''; | ||
public readOnly: boolean = false; | ||
public size: number = 0; | ||
// Type specific: file | ||
public accept: string = null; | ||
public allowdirs: string = null; | ||
// Type specific: text/password/search/tel/url/week/month | ||
public selectionStart: number = 0; | ||
public selectionEnd: number = 0; | ||
public selectionDirection: string = 'forward'; | ||
// Type specific: text/number | ||
public autocomplete: string = ''; | ||
public min: string = ''; | ||
public max: string = ''; | ||
public minLength: number = -1; | ||
public maxLength: number = -1; | ||
public pattern: string = ''; | ||
public placeholder: string = ''; | ||
public readOnly: boolean = false; | ||
public size: number = 0; | ||
// Not categorized | ||
public defaultValue: string = ''; | ||
public multiple: boolean = false; | ||
public files: [] = []; | ||
public step: string = ''; | ||
public inputmode: string = ''; | ||
// Type specific: text/password/search/tel/url/week/month | ||
public selectionStart: number = 0; | ||
public selectionEnd: number = 0; | ||
public selectionDirection: string = 'forward'; | ||
/** | ||
* Returns value. | ||
* | ||
* @return {string} Value. | ||
*/ | ||
public get value(): string { | ||
return this._value; | ||
} | ||
// Not categorized | ||
public defaultValue: string = ''; | ||
public multiple: boolean = false; | ||
public files: [] = []; | ||
public step: string = ''; | ||
public inputmode: string = ''; | ||
/** | ||
* Sets value. | ||
* | ||
* @param {string} value Value. | ||
*/ | ||
public set value(value: string) { | ||
this._value = value; | ||
if(this.defaultValue === null) { | ||
this.defaultValue = value; | ||
} | ||
} | ||
/** | ||
* Returns value. | ||
* | ||
* @return {string} Value. | ||
*/ | ||
public get value(): string { | ||
return this._value; | ||
} | ||
/** | ||
* Returns checked. | ||
* | ||
* @return {boolean} Checked. | ||
*/ | ||
public get checked(): boolean { | ||
return this._checked; | ||
} | ||
/** | ||
* Sets value. | ||
* | ||
* @param {string} value Value. | ||
*/ | ||
public set value(value: string) { | ||
this._value = value; | ||
if (this.defaultValue === null) { | ||
this.defaultValue = value; | ||
} | ||
} | ||
/** | ||
* Sets checked. | ||
* | ||
* @param {boolean} checked Checked. | ||
*/ | ||
public set checked(checked: boolean) { | ||
this._checked = checked; | ||
if(this.defaultChecked === null) { | ||
this.defaultChecked = checked; | ||
} | ||
} | ||
/** | ||
* Returns checked. | ||
* | ||
* @return {boolean} Checked. | ||
*/ | ||
public get checked(): boolean { | ||
return this._checked; | ||
} | ||
/** | ||
* Returns validity state. | ||
* | ||
* @return {ValidityState} Validity state. | ||
*/ | ||
public get validity(): ValidityState { | ||
return new ValidityState(this); | ||
} | ||
/** | ||
* Sets checked. | ||
* | ||
* @param {boolean} checked Checked. | ||
*/ | ||
public set checked(checked: boolean) { | ||
this._checked = checked; | ||
if (this.defaultChecked === null) { | ||
this.defaultChecked = checked; | ||
} | ||
} | ||
/** | ||
* Returns validity message. | ||
* | ||
* @return {string} Validation message. | ||
*/ | ||
public get validationMessage(): string { | ||
return null; | ||
} | ||
/** | ||
* Returns validity state. | ||
* | ||
* @return {ValidityState} Validity state. | ||
*/ | ||
public get validity(): ValidityState { | ||
return new ValidityState(this); | ||
} | ||
/** | ||
* Returns "true" if it will validate. | ||
* | ||
* @return {boolean} "true" if it will validate. | ||
*/ | ||
public get willValidate(): boolean { | ||
return this.type !== 'hidden' && this.type !== 'reset' && this.type !== 'button' && !this.disabled && !this['readOnly']; | ||
} | ||
/** | ||
* Returns validity message. | ||
* | ||
* @return {string} Validation message. | ||
*/ | ||
public get validationMessage(): string { | ||
return null; | ||
} | ||
/** | ||
* Returns value as Date. | ||
* | ||
* @return {Date} Date. | ||
*/ | ||
public get valueAsDate(): Date { | ||
return this.value ? new Date(this.value) : null; | ||
} | ||
/** | ||
* Returns "true" if it will validate. | ||
* | ||
* @return {boolean} "true" if it will validate. | ||
*/ | ||
public get willValidate(): boolean { | ||
return ( | ||
this.type !== 'hidden' && this.type !== 'reset' && this.type !== 'button' && !this.disabled && !this['readOnly'] | ||
); | ||
} | ||
/** | ||
* Returns value as number. | ||
* | ||
* @return {number} Number. | ||
*/ | ||
public get valueAsNumber(): number { | ||
return this.value ? parseFloat(this.value) : NaN; | ||
} | ||
/** | ||
* Returns value as Date. | ||
* | ||
* @return {Date} Date. | ||
*/ | ||
public get valueAsDate(): Date { | ||
return this.value ? new Date(this.value) : null; | ||
} | ||
/** | ||
* Returns value as number. | ||
* | ||
* @return {number} Number. | ||
*/ | ||
public get valueAsNumber(): number { | ||
return this.value ? parseFloat(this.value) : NaN; | ||
} | ||
} |
import HTMLElement from '../basic-types/HTMLElement'; | ||
import Node from '../basic-types/Node'; | ||
import * as HTMLTextAreaPropertyAttributes from './HTMLTextAreaPropertyAttributes.json'; | ||
import HTMLFormElement from './HTMLFormElement'; | ||
@@ -9,42 +10,46 @@ /** | ||
export default class HTMLTextAreaElement extends HTMLElement { | ||
protected static _observedPropertyAttributes = Object.assign({}, HTMLElement._observedPropertyAttributes, HTMLTextAreaPropertyAttributes); | ||
protected static _observedPropertyAttributes = Object.assign( | ||
{}, | ||
HTMLElement._observedPropertyAttributes, | ||
HTMLTextAreaPropertyAttributes | ||
); | ||
public form: HTMLFormElement = null; | ||
public name: string = ''; | ||
public readonly type: string = 'textarea'; | ||
public disabled: boolean = false; | ||
public autofocus: boolean = false; | ||
public required: boolean = false; | ||
public _value: string = ''; | ||
public autocomplete: string = ''; | ||
public minLength: number = -1; | ||
public maxLength: number = -1; | ||
public placeholder: string = ''; | ||
public readOnly: boolean = false; | ||
public selectionStart: number = 0; | ||
public selectionEnd: number = 0; | ||
public selectionDirection: string = 'forward'; | ||
public defaultValue: string = ''; | ||
public inputmode: string = ''; | ||
public name: string = ''; | ||
public readonly type: string = 'textarea'; | ||
public disabled: boolean = false; | ||
public autofocus: boolean = false; | ||
public required: boolean = false; | ||
public _value: string = ''; | ||
public autocomplete: string = ''; | ||
public minLength: number = -1; | ||
public maxLength: number = -1; | ||
public placeholder: string = ''; | ||
public readOnly: boolean = false; | ||
public selectionStart: number = 0; | ||
public selectionEnd: number = 0; | ||
public selectionDirection: string = 'forward'; | ||
public defaultValue: string = ''; | ||
public inputmode: string = ''; | ||
/** | ||
* Returns value. | ||
* | ||
* @return {string} Value. | ||
*/ | ||
public get value(): string { | ||
return this._value; | ||
} | ||
/** | ||
* Returns value. | ||
* | ||
* @return {string} Value. | ||
*/ | ||
public get value(): string { | ||
return this._value; | ||
} | ||
/** | ||
* Sets value. | ||
* | ||
* @param {string} value Value. | ||
*/ | ||
public set value(value: string) { | ||
this._value = value; | ||
if(this.defaultValue === null) { | ||
this.defaultValue = value; | ||
} | ||
} | ||
/** | ||
* Sets value. | ||
* | ||
* @param {string} value Value. | ||
*/ | ||
public set value(value: string) { | ||
this._value = value; | ||
if (this.defaultValue === null) { | ||
this.defaultValue = value; | ||
} | ||
} | ||
@@ -56,5 +61,5 @@ /** | ||
*/ | ||
get textLength() { | ||
return this.value.length; | ||
} | ||
public get textLength(): number { | ||
return this.value.length; | ||
} | ||
@@ -64,3 +69,3 @@ /** | ||
* | ||
* @override | ||
* @override | ||
* @param {Node} node Node to append. | ||
@@ -70,5 +75,5 @@ * @return {Node} Appended node. | ||
public appendChild(node: Node): Node { | ||
super.appendChild(node); | ||
this.value = this.textContent; | ||
return node; | ||
super.appendChild(node); | ||
this.value = this.textContent; | ||
return node; | ||
} | ||
@@ -82,4 +87,4 @@ | ||
public removeChild(node: Node): void { | ||
super.removeChild(node); | ||
this.value = this.textContent; | ||
super.removeChild(node); | ||
this.value = this.textContent; | ||
} | ||
@@ -95,6 +100,6 @@ | ||
public insertBefore(newNode: Node, referenceNode: Node): Node { | ||
super.insertBefore(newNode, referenceNode); | ||
this.value = this.textContent; | ||
return newNode; | ||
super.insertBefore(newNode, referenceNode); | ||
this.value = this.textContent; | ||
return newNode; | ||
} | ||
} |
@@ -9,19 +9,19 @@ import HTMLElement from '../basic-types/HTMLElement'; | ||
/** | ||
* Returns viewport. | ||
* | ||
* @return {SVGRect} SVG rect. | ||
*/ | ||
public get viewportElement(): HTMLElement { | ||
return null; | ||
} | ||
/** | ||
* Returns viewport. | ||
* | ||
* @return {SVGRect} SVG rect. | ||
*/ | ||
public get viewportElement(): HTMLElement { | ||
return null; | ||
} | ||
/** | ||
* Returns current translate. | ||
* | ||
* @return {HTMLElement} Element. | ||
*/ | ||
public get ownerSVGElement(): HTMLElement { | ||
return null; | ||
} | ||
/** | ||
* Returns current translate. | ||
* | ||
* @return {HTMLElement} Element. | ||
*/ | ||
public get ownerSVGElement(): HTMLElement { | ||
return null; | ||
} | ||
} |
@@ -8,12 +8,12 @@ import SVGElement from './SVGElement'; | ||
export default class SVGGraphicsElement extends SVGElement { | ||
protected static _observedPropertyAttributes = Object.assign({}, SVGElement._observedPropertyAttributes); | ||
protected static _observedPropertyAttributes = Object.assign({}, SVGElement._observedPropertyAttributes); | ||
/** | ||
* Returns DOM rect. | ||
* | ||
* @return {DOMRect} DOM rect. | ||
*/ | ||
public getBBox(): DOMRect { | ||
return new DOMRect(); | ||
} | ||
/** | ||
* Returns DOM rect. | ||
* | ||
* @return {DOMRect} DOM rect. | ||
*/ | ||
public getBBox(): DOMRect { | ||
return new DOMRect(); | ||
} | ||
} |
@@ -16,4 +16,8 @@ import SVGGraphicsElement from './SVGGraphicsElement'; | ||
export default class SVGSVGElement extends SVGGraphicsElement { | ||
protected static _observedPropertyAttributes = Object.assign({}, SVGGraphicsElement._observedPropertyAttributes, SVGSVGElementPropertyAttributes); | ||
protected static _observedPropertyAttributes = Object.assign( | ||
{}, | ||
SVGGraphicsElement._observedPropertyAttributes, | ||
SVGSVGElementPropertyAttributes | ||
); | ||
public preserveAspectRatio: string = 'xMidYMid meet'; | ||
@@ -28,34 +32,34 @@ public width: string = ''; | ||
/** | ||
* Returns viewport. | ||
* | ||
* @return {SVGRect} SVG rect. | ||
*/ | ||
public get viewport(): SVGRect { | ||
return new SVGRect(); | ||
} | ||
/** | ||
* Returns viewport. | ||
* | ||
* @return {SVGRect} SVG rect. | ||
*/ | ||
public get viewport(): SVGRect { | ||
return new SVGRect(); | ||
} | ||
/** | ||
* Returns current translate. | ||
* | ||
* @return {SVGPoint} SVG point. | ||
*/ | ||
public get currentTranslate(): SVGPoint { | ||
return new SVGPoint(); | ||
} | ||
/** | ||
* Returns current translate. | ||
* | ||
* @return {SVGPoint} SVG point. | ||
*/ | ||
public get currentTranslate(): SVGPoint { | ||
return new SVGPoint(); | ||
} | ||
/** | ||
* Returns view box. | ||
* | ||
* @return {SVGAnimatedRect} Viewbox. | ||
*/ | ||
public get viewBox(): SVGAnimatedRect { | ||
return new SVGAnimatedRect(); | ||
} | ||
/** | ||
* Returns view box. | ||
* | ||
* @return {SVGAnimatedRect} Viewbox. | ||
*/ | ||
public get viewBox(): SVGAnimatedRect { | ||
return new SVGAnimatedRect(); | ||
} | ||
/** | ||
* Pauses animation. | ||
*/ | ||
public pauseAnimations(): void {} | ||
/** | ||
@@ -65,6 +69,6 @@ * Unpauses animation. | ||
public unpauseAnimations(): void {} | ||
/** | ||
* Returns "true" if animation is paused. | ||
* | ||
* | ||
* @returns {boolean} "true" if animation is paused. | ||
@@ -75,6 +79,6 @@ */ | ||
} | ||
/** | ||
* Returns the current time in seconds relative to the start time for the current SVG document fragment. | ||
* | ||
* | ||
* @returns {number} Current time. | ||
@@ -85,3 +89,3 @@ */ | ||
} | ||
/** | ||
@@ -91,6 +95,6 @@ * Sets current time. | ||
public setCurrentTime(): void {} | ||
/** | ||
* Returns intersection list. | ||
* | ||
* | ||
* @returns {Node[]} Intersection list. | ||
@@ -101,6 +105,6 @@ */ | ||
} | ||
/** | ||
* Returns enclousure list. | ||
* | ||
* | ||
* @returns {Node[]} Enclousure list. | ||
@@ -111,6 +115,6 @@ */ | ||
} | ||
/** | ||
* Returns true if the rendered content of the given element intersects the supplied rectangle. | ||
* | ||
* | ||
* @returns {boolean} Intersection state. | ||
@@ -121,6 +125,6 @@ */ | ||
} | ||
/** | ||
* Returns true if the rendered content of the given element is entirely contained within the supplied rectangle. | ||
* | ||
* | ||
* @returns {boolean} Enclousure state. | ||
@@ -131,3 +135,3 @@ */ | ||
} | ||
/** | ||
@@ -138,55 +142,55 @@ * Unselects any selected objects, including any selections of text strings and type-in bars. | ||
/** | ||
* Returns a number. | ||
* | ||
* @return {SVGNumber} Number. | ||
*/ | ||
public get createSVGNumber(): SVGNumber { | ||
return new SVGNumber(); | ||
} | ||
/** | ||
* Returns a number. | ||
* | ||
* @return {SVGNumber} Number. | ||
*/ | ||
public get createSVGNumber(): SVGNumber { | ||
return new SVGNumber(); | ||
} | ||
/** | ||
* Returns a length. | ||
* | ||
* @return {SVGLength} Length. | ||
*/ | ||
public get createSVGLength(): SVGLength { | ||
return new SVGLength(); | ||
} | ||
/** | ||
* Returns a length. | ||
* | ||
* @return {SVGLength} Length. | ||
*/ | ||
public get createSVGLength(): SVGLength { | ||
return new SVGLength(); | ||
} | ||
/** | ||
* Returns a angle. | ||
* | ||
* @return {SVGAngle} Angle. | ||
*/ | ||
public get createSVGAngle(): SVGAngle { | ||
return new SVGAngle(); | ||
} | ||
/** | ||
* Returns a angle. | ||
* | ||
* @return {SVGAngle} Angle. | ||
*/ | ||
public get createSVGAngle(): SVGAngle { | ||
return new SVGAngle(); | ||
} | ||
/** | ||
* Returns a point. | ||
* | ||
* @return {SVGPoint} Point. | ||
*/ | ||
public get createSVGPoint(): SVGPoint { | ||
return new SVGPoint(); | ||
} | ||
/** | ||
* Returns a point. | ||
* | ||
* @return {SVGPoint} Point. | ||
*/ | ||
public get createSVGPoint(): SVGPoint { | ||
return new SVGPoint(); | ||
} | ||
/** | ||
* Returns a rect. | ||
* | ||
* @return {SVGRect} Rect. | ||
*/ | ||
public get createSVGRect(): SVGRect { | ||
return new SVGRect(); | ||
} | ||
/** | ||
* Returns a rect. | ||
* | ||
* @return {SVGRect} Rect. | ||
*/ | ||
public get createSVGRect(): SVGRect { | ||
return new SVGRect(); | ||
} | ||
/** | ||
* Returns a transform. | ||
* | ||
* @return {SVGTransform} Transform. | ||
*/ | ||
public get createSVGTransform(): SVGTransform { | ||
return new SVGTransform(); | ||
} | ||
/** | ||
* Returns a transform. | ||
* | ||
* @return {SVGTransform} Transform. | ||
*/ | ||
public get createSVGTransform(): SVGTransform { | ||
return new SVGTransform(); | ||
} | ||
} |
@@ -11,2 +11,5 @@ import CustomElementRegistry from './html-element/CustomElementRegistry'; | ||
import HTMLTemplateElement from './nodes/elements/HTMLTemplateElement'; | ||
import HTMLFormElement from './nodes/elements/HTMLFormElement'; | ||
import HTMLInputElement from './nodes/elements/HTMLInputElement'; | ||
import HTMLTextAreaElement from './nodes/elements/HTMLTextAreaElement'; | ||
import DocumentFragment from './nodes/basic-types/DocumentFragment'; | ||
@@ -33,2 +36,5 @@ import TreeWalker from './tree-walker/TreeWalker'; | ||
public HTMLElement = HTMLElement; | ||
public HTMLInputElement = HTMLInputElement; | ||
public HTMLFormElement = HTMLFormElement; | ||
public HTMLTextAreaElement = HTMLTextAreaElement; | ||
public HTMLTemplateElement = HTMLTemplateElement; | ||
@@ -35,0 +41,0 @@ public Element = Element; |
@@ -29,4 +29,3 @@ { | ||
"es2016", | ||
"es2017", | ||
"dom" | ||
"es2017" | ||
] | ||
@@ -33,0 +32,0 @@ }, |
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 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 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 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 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 not supported yet
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
13927
236
549946