chore: convert dom module to typescript
This commit is contained in:
parent
555dd93ed9
commit
f302f70330
|
@ -1,397 +0,0 @@
|
|||
import {List, MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {isBlank, isPresent} from 'angular2/src/facade/lang';
|
||||
import {setRootDomAdapter} from './dom_adapter';
|
||||
import {GenericBrowserDomAdapter} from './generic_browser_adapter';
|
||||
|
||||
var _attrToPropMap = {
|
||||
'innerHtml': 'innerHTML',
|
||||
'readonly': 'readOnly',
|
||||
'tabindex': 'tabIndex'
|
||||
};
|
||||
|
||||
const DOM_KEY_LOCATION_NUMPAD = 3;
|
||||
|
||||
// Map to convert some key or keyIdentifier values to what will be returned by getEventKey
|
||||
var _keyMap = {
|
||||
// The following values are here for cross-browser compatibility and to match the W3C standard
|
||||
// cf http://www.w3.org/TR/DOM-Level-3-Events-key/
|
||||
'\b': 'Backspace',
|
||||
'\t': 'Tab',
|
||||
'\x7F': 'Delete',
|
||||
'\x1B': 'Escape',
|
||||
'Del': 'Delete',
|
||||
'Esc': 'Escape',
|
||||
'Left': 'ArrowLeft',
|
||||
'Right': 'ArrowRight',
|
||||
'Up': 'ArrowUp',
|
||||
'Down':'ArrowDown',
|
||||
'Menu': 'ContextMenu',
|
||||
'Scroll' : 'ScrollLock',
|
||||
'Win': 'OS'
|
||||
};
|
||||
|
||||
// There is a bug in Chrome for numeric keypad keys:
|
||||
// https://code.google.com/p/chromium/issues/detail?id=155654
|
||||
// 1, 2, 3 ... are reported as A, B, C ...
|
||||
var _chromeNumKeyPadMap = {
|
||||
'A': '1',
|
||||
'B': '2',
|
||||
'C': '3',
|
||||
'D': '4',
|
||||
'E': '5',
|
||||
'F': '6',
|
||||
'G': '7',
|
||||
'H': '8',
|
||||
'I': '9',
|
||||
'J': '*',
|
||||
'K': '+',
|
||||
'M': '-',
|
||||
'N': '.',
|
||||
'O': '/',
|
||||
'\x60': '0',
|
||||
'\x90': 'NumLock'
|
||||
};
|
||||
|
||||
export class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||
static makeCurrent() {
|
||||
setRootDomAdapter(new BrowserDomAdapter());
|
||||
}
|
||||
|
||||
logError(error) {
|
||||
window.console.error(error);
|
||||
}
|
||||
|
||||
get attrToPropMap() {
|
||||
return _attrToPropMap;
|
||||
}
|
||||
|
||||
query(selector:string) {
|
||||
return document.querySelector(selector);
|
||||
}
|
||||
querySelector(el, selector:string):Node {
|
||||
return el.querySelector(selector);
|
||||
}
|
||||
querySelectorAll(el, selector:string):NodeList {
|
||||
return el.querySelectorAll(selector);
|
||||
}
|
||||
on(el, evt, listener) {
|
||||
el.addEventListener(evt, listener, false);
|
||||
}
|
||||
onAndCancel(el, evt, listener): Function {
|
||||
el.addEventListener(evt, listener, false);
|
||||
//Needed to follow Dart's subscription semantic, until fix of
|
||||
//https://code.google.com/p/dart/issues/detail?id=17406
|
||||
return () => {el.removeEventListener(evt, listener, false);};
|
||||
}
|
||||
dispatchEvent(el, evt) {
|
||||
el.dispatchEvent(evt);
|
||||
}
|
||||
createMouseEvent(eventType) {
|
||||
var evt = new MouseEvent(eventType);
|
||||
evt.initEvent(eventType, true, true);
|
||||
return evt;
|
||||
}
|
||||
createEvent(eventType) {
|
||||
return new Event(eventType, true);
|
||||
}
|
||||
getInnerHTML(el) {
|
||||
return el.innerHTML;
|
||||
}
|
||||
getOuterHTML(el) {
|
||||
return el.outerHTML;
|
||||
}
|
||||
nodeName(node:Node):string {
|
||||
return node.nodeName;
|
||||
}
|
||||
nodeValue(node:Node):string {
|
||||
return node.nodeValue;
|
||||
}
|
||||
type(node:Node) {
|
||||
return node.type;
|
||||
}
|
||||
content(node:HTMLElement):Node {
|
||||
if (this.hasProperty(node, "content")) {
|
||||
return node.content;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
firstChild(el):Node {
|
||||
return el.firstChild;
|
||||
}
|
||||
nextSibling(el):Node {
|
||||
return el.nextSibling;
|
||||
}
|
||||
parentElement(el) {
|
||||
return el.parentElement;
|
||||
}
|
||||
childNodes(el):NodeList {
|
||||
return el.childNodes;
|
||||
}
|
||||
childNodesAsList(el):List {
|
||||
var childNodes = el.childNodes;
|
||||
var res = ListWrapper.createFixedSize(childNodes.length);
|
||||
for (var i=0; i<childNodes.length; i++) {
|
||||
res[i] = childNodes[i];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
clearNodes(el) {
|
||||
for (var i = 0; i < el.childNodes.length; i++) {
|
||||
this.remove(el.childNodes[i]);
|
||||
}
|
||||
}
|
||||
appendChild(el, node) {
|
||||
el.appendChild(node);
|
||||
}
|
||||
removeChild(el, node) {
|
||||
el.removeChild(node);
|
||||
}
|
||||
replaceChild(el: Node, newChild, oldChild) {
|
||||
el.replaceChild(newChild, oldChild);
|
||||
}
|
||||
remove(el) {
|
||||
var parent = el.parentNode;
|
||||
parent.removeChild(el);
|
||||
return el;
|
||||
}
|
||||
insertBefore(el, node) {
|
||||
el.parentNode.insertBefore(node, el);
|
||||
}
|
||||
insertAllBefore(el, nodes) {
|
||||
ListWrapper.forEach(nodes, (n) => {
|
||||
el.parentNode.insertBefore(n, el);
|
||||
});
|
||||
}
|
||||
insertAfter(el, node) {
|
||||
el.parentNode.insertBefore(node, el.nextSibling);
|
||||
}
|
||||
setInnerHTML(el, value) {
|
||||
el.innerHTML = value;
|
||||
}
|
||||
getText(el) {
|
||||
return el.textContent;
|
||||
}
|
||||
// TODO(vicb): removed Element type because it does not support StyleElement
|
||||
setText(el, value:string) {
|
||||
el.textContent = value;
|
||||
}
|
||||
getValue(el) {
|
||||
return el.value;
|
||||
}
|
||||
setValue(el, value:string) {
|
||||
el.value = value;
|
||||
}
|
||||
getChecked(el) {
|
||||
return el.checked;
|
||||
}
|
||||
setChecked(el, value:boolean) {
|
||||
el.checked = value;
|
||||
}
|
||||
createTemplate(html) {
|
||||
var t = document.createElement('template');
|
||||
t.innerHTML = html;
|
||||
return t;
|
||||
}
|
||||
createElement(tagName, doc=document) {
|
||||
return doc.createElement(tagName);
|
||||
}
|
||||
createTextNode(text: string, doc=document) {
|
||||
return doc.createTextNode(text);
|
||||
}
|
||||
createScriptTag(attrName:string, attrValue:string, doc=document) {
|
||||
var el = doc.createElement('SCRIPT');
|
||||
el.setAttribute(attrName, attrValue);
|
||||
return el;
|
||||
}
|
||||
createStyleElement(css:string, doc=document):HTMLStyleElement {
|
||||
var style = doc.createElement('STYLE');
|
||||
style.innerText = css;
|
||||
return style;
|
||||
}
|
||||
createShadowRoot(el:HTMLElement): ShadowRoot {
|
||||
return el.createShadowRoot();
|
||||
}
|
||||
getShadowRoot(el:HTMLElement): ShadowRoot {
|
||||
return el.shadowRoot;
|
||||
}
|
||||
getHost(el:HTMLElement): HTMLElement {
|
||||
return el.host;
|
||||
}
|
||||
clone(node:Node) {
|
||||
return node.cloneNode(true);
|
||||
}
|
||||
hasProperty(element, name:string) {
|
||||
return name in element;
|
||||
}
|
||||
getElementsByClassName(element, name:string) {
|
||||
return element.getElementsByClassName(name);
|
||||
}
|
||||
getElementsByTagName(element, name:string) {
|
||||
return element.getElementsByTagName(name);
|
||||
}
|
||||
classList(element):List {
|
||||
return Array.prototype.slice.call(element.classList, 0);
|
||||
}
|
||||
addClass(element, classname:string) {
|
||||
element.classList.add(classname);
|
||||
}
|
||||
removeClass(element, classname:string) {
|
||||
element.classList.remove(classname);
|
||||
}
|
||||
hasClass(element, classname:string) {
|
||||
return element.classList.contains(classname);
|
||||
}
|
||||
setStyle(element, stylename:string, stylevalue:string) {
|
||||
element.style[stylename] = stylevalue;
|
||||
}
|
||||
removeStyle(element, stylename:string) {
|
||||
element.style[stylename] = null;
|
||||
}
|
||||
getStyle(element, stylename:string) {
|
||||
return element.style[stylename];
|
||||
}
|
||||
tagName(element):string {
|
||||
return element.tagName;
|
||||
}
|
||||
attributeMap(element) {
|
||||
var res = MapWrapper.create();
|
||||
var elAttrs = element.attributes;
|
||||
for (var i = 0; i < elAttrs.length; i++) {
|
||||
var attrib = elAttrs[i];
|
||||
MapWrapper.set(res, attrib.name, attrib.value);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
hasAttribute(element, attribute:string) {
|
||||
return element.hasAttribute(attribute);
|
||||
}
|
||||
getAttribute(element, attribute:string) {
|
||||
return element.getAttribute(attribute);
|
||||
}
|
||||
setAttribute(element, name:string, value:string) {
|
||||
element.setAttribute(name, value);
|
||||
}
|
||||
removeAttribute(element, attribute:string) {
|
||||
return element.removeAttribute(attribute);
|
||||
}
|
||||
templateAwareRoot(el) {
|
||||
return this.isTemplateElement(el) ? this.content(el) : el;
|
||||
}
|
||||
createHtmlDocument() {
|
||||
return document.implementation.createHTMLDocument('fakeTitle');
|
||||
}
|
||||
defaultDoc() {
|
||||
return document;
|
||||
}
|
||||
getBoundingClientRect(el) {
|
||||
return el.getBoundingClientRect();
|
||||
}
|
||||
getTitle() {
|
||||
return document.title;
|
||||
}
|
||||
setTitle(newTitle:string) {
|
||||
document.title = newTitle;
|
||||
}
|
||||
elementMatches(n, selector:string):boolean {
|
||||
return n instanceof HTMLElement && n.matches(selector);
|
||||
}
|
||||
isTemplateElement(el:any):boolean {
|
||||
return el instanceof HTMLElement && el.nodeName == "TEMPLATE";
|
||||
}
|
||||
isTextNode(node:Node):boolean {
|
||||
return node.nodeType === Node.TEXT_NODE;
|
||||
}
|
||||
isCommentNode(node:Node):boolean {
|
||||
return node.nodeType === Node.COMMENT_NODE;
|
||||
}
|
||||
isElementNode(node:Node):boolean {
|
||||
return node.nodeType === Node.ELEMENT_NODE;
|
||||
}
|
||||
hasShadowRoot(node):boolean {
|
||||
return node instanceof HTMLElement && isPresent(node.shadowRoot);
|
||||
}
|
||||
isShadowRoot(node):boolean {
|
||||
return node instanceof ShadowRoot;
|
||||
}
|
||||
importIntoDoc(node:Node) {
|
||||
var result = document.importNode(node, true);
|
||||
// Workaround WebKit https://bugs.webkit.org/show_bug.cgi?id=137619
|
||||
if (this.isTemplateElement(result) &&
|
||||
!this.content(result).childNodes.length && this.content(node).childNodes.length) {
|
||||
var childNodes = this.content(node).childNodes;
|
||||
for (var i = 0; i < childNodes.length; ++i) {
|
||||
this.content(result).appendChild(
|
||||
this.importIntoDoc(childNodes[i]));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
isPageRule(rule): boolean {
|
||||
return rule.type === CSSRule.PAGE_RULE;
|
||||
}
|
||||
isStyleRule(rule): boolean {
|
||||
return rule.type === CSSRule.STYLE_RULE;
|
||||
}
|
||||
isMediaRule(rule): boolean {
|
||||
return rule.type === CSSRule.MEDIA_RULE;
|
||||
}
|
||||
isKeyframesRule(rule): boolean {
|
||||
return rule.type === CSSRule.KEYFRAMES_RULE;
|
||||
}
|
||||
getHref(el:Element): string {
|
||||
return el.href;
|
||||
}
|
||||
getEventKey(event): string {
|
||||
var key = event.key;
|
||||
if (isBlank(key)) {
|
||||
key = event.keyIdentifier;
|
||||
// keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and Safari
|
||||
// cf http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces
|
||||
if (isBlank(key)) {
|
||||
return 'Unidentified';
|
||||
}
|
||||
if (key.startsWith('U+')) {
|
||||
key = String.fromCharCode(parseInt(key.substring(2), 16));
|
||||
if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {
|
||||
// There is a bug in Chrome for numeric keypad keys:
|
||||
// https://code.google.com/p/chromium/issues/detail?id=155654
|
||||
// 1, 2, 3 ... are reported as A, B, C ...
|
||||
key = _chromeNumKeyPadMap[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_keyMap.hasOwnProperty(key)) {
|
||||
key = _keyMap[key];
|
||||
}
|
||||
return key;
|
||||
}
|
||||
getGlobalEventTarget(target:string) {
|
||||
if (target == "window") {
|
||||
return window;
|
||||
} else if (target == "document") {
|
||||
return document;
|
||||
} else if (target == "body") {
|
||||
return document.body;
|
||||
}
|
||||
}
|
||||
getHistory() {
|
||||
return window.history;
|
||||
}
|
||||
getLocation() {
|
||||
return window.location;
|
||||
}
|
||||
getBaseHref() {
|
||||
return relativePath(document.baseURI);
|
||||
}
|
||||
}
|
||||
|
||||
// based on urlUtils.js in AngularJS 1
|
||||
var urlParsingNode = null;
|
||||
function relativePath(url) {
|
||||
if (isBlank(urlParsingNode)) {
|
||||
urlParsingNode = document.createElement("a");
|
||||
}
|
||||
urlParsingNode.setAttribute('href', url);
|
||||
return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname;
|
||||
}
|
|
@ -0,0 +1,385 @@
|
|||
import {List, MapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {isBlank, isPresent} from 'angular2/src/facade/lang';
|
||||
import {setRootDomAdapter} from './dom_adapter';
|
||||
import {GenericBrowserDomAdapter} from './generic_browser_adapter';
|
||||
|
||||
// HACK: workaround for Traceur behavior.
|
||||
// It expects all transpiled modules to contain this marker.
|
||||
// TODO: remove this when we no longer use traceur
|
||||
export var __esModule = true;
|
||||
|
||||
var _attrToPropMap = {'innerHtml': 'innerHTML', 'readonly': 'readOnly', 'tabindex': 'tabIndex'};
|
||||
|
||||
const DOM_KEY_LOCATION_NUMPAD = 3;
|
||||
|
||||
// Map to convert some key or keyIdentifier values to what will be returned by getEventKey
|
||||
var _keyMap = {
|
||||
// The following values are here for cross-browser compatibility and to match the W3C standard
|
||||
// cf http://www.w3.org/TR/DOM-Level-3-Events-key/
|
||||
'\b': 'Backspace',
|
||||
'\t': 'Tab',
|
||||
'\x7F': 'Delete',
|
||||
'\x1B': 'Escape',
|
||||
'Del': 'Delete',
|
||||
'Esc': 'Escape',
|
||||
'Left': 'ArrowLeft',
|
||||
'Right': 'ArrowRight',
|
||||
'Up': 'ArrowUp',
|
||||
'Down': 'ArrowDown',
|
||||
'Menu': 'ContextMenu',
|
||||
'Scroll': 'ScrollLock',
|
||||
'Win': 'OS'
|
||||
};
|
||||
|
||||
// There is a bug in Chrome for numeric keypad keys:
|
||||
// https://code.google.com/p/chromium/issues/detail?id=155654
|
||||
// 1, 2, 3 ... are reported as A, B, C ...
|
||||
var _chromeNumKeyPadMap = {
|
||||
'A': '1',
|
||||
'B': '2',
|
||||
'C': '3',
|
||||
'D': '4',
|
||||
'E': '5',
|
||||
'F': '6',
|
||||
'G': '7',
|
||||
'H': '8',
|
||||
'I': '9',
|
||||
'J': '*',
|
||||
'K': '+',
|
||||
'M': '-',
|
||||
'N': '.',
|
||||
'O': '/',
|
||||
'\x60': '0',
|
||||
'\x90': 'NumLock'
|
||||
};
|
||||
|
||||
export class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||
static makeCurrent() { setRootDomAdapter(new BrowserDomAdapter()); }
|
||||
|
||||
logError(error) { window.console.error(error); }
|
||||
|
||||
get attrToPropMap(): any { return _attrToPropMap; }
|
||||
|
||||
query(selector: string): any { return document.querySelector(selector); }
|
||||
querySelector(el, selector: string): Node { return el.querySelector(selector); }
|
||||
querySelectorAll(el, selector: string): List<any> { return el.querySelectorAll(selector); }
|
||||
on(el, evt, listener) { el.addEventListener(evt, listener, false); }
|
||||
onAndCancel(el, evt, listener): Function {
|
||||
el.addEventListener(evt, listener, false);
|
||||
// Needed to follow Dart's subscription semantic, until fix of
|
||||
// https://code.google.com/p/dart/issues/detail?id=17406
|
||||
return () => { el.removeEventListener(evt, listener, false);
|
||||
};
|
||||
}
|
||||
dispatchEvent(el, evt) {
|
||||
el.dispatchEvent(evt);
|
||||
}
|
||||
createMouseEvent(eventType: string): MouseEvent {
|
||||
var evt: MouseEvent = new MouseEvent(eventType);
|
||||
evt.initEvent(eventType, true, true);
|
||||
return evt;
|
||||
}
|
||||
createEvent(eventType): Event {
|
||||
return new Event(eventType, true);
|
||||
}
|
||||
getInnerHTML(el) {
|
||||
return el.innerHTML;
|
||||
}
|
||||
getOuterHTML(el) {
|
||||
return el.outerHTML;
|
||||
}
|
||||
nodeName(node: Node): string {
|
||||
return node.nodeName;
|
||||
}
|
||||
nodeValue(node: Node): string {
|
||||
return node.nodeValue;
|
||||
}
|
||||
type(node: HTMLInputElement): string {
|
||||
return node.type;
|
||||
}
|
||||
content(node: Node): Node {
|
||||
if (this.hasProperty(node, "content")) {
|
||||
return (<any>node).content;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
firstChild(el): Node {
|
||||
return el.firstChild;
|
||||
}
|
||||
nextSibling(el): Node {
|
||||
return el.nextSibling;
|
||||
}
|
||||
parentElement(el) {
|
||||
return el.parentElement;
|
||||
}
|
||||
childNodes(el): List<Node> {
|
||||
return el.childNodes;
|
||||
}
|
||||
childNodesAsList(el): List<any> {
|
||||
var childNodes = el.childNodes;
|
||||
var res = ListWrapper.createFixedSize(childNodes.length);
|
||||
for (var i = 0; i < childNodes.length; i++) {
|
||||
res[i] = childNodes[i];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
clearNodes(el) {
|
||||
for (var i = 0; i < el.childNodes.length; i++) {
|
||||
this.remove(el.childNodes[i]);
|
||||
}
|
||||
}
|
||||
appendChild(el, node) {
|
||||
el.appendChild(node);
|
||||
}
|
||||
removeChild(el, node) {
|
||||
el.removeChild(node);
|
||||
}
|
||||
replaceChild(el: Node, newChild, oldChild) {
|
||||
el.replaceChild(newChild, oldChild);
|
||||
}
|
||||
remove(el) {
|
||||
var parent = el.parentNode;
|
||||
parent.removeChild(el);
|
||||
return el;
|
||||
}
|
||||
insertBefore(el, node) {
|
||||
el.parentNode.insertBefore(node, el);
|
||||
}
|
||||
insertAllBefore(el, nodes) {
|
||||
ListWrapper.forEach(nodes, (n) => { el.parentNode.insertBefore(n, el); });
|
||||
}
|
||||
insertAfter(el, node) {
|
||||
el.parentNode.insertBefore(node, el.nextSibling);
|
||||
}
|
||||
setInnerHTML(el, value) {
|
||||
el.innerHTML = value;
|
||||
}
|
||||
getText(el) {
|
||||
return el.textContent;
|
||||
}
|
||||
// TODO(vicb): removed Element type because it does not support StyleElement
|
||||
setText(el, value: string) {
|
||||
el.textContent = value;
|
||||
}
|
||||
getValue(el) {
|
||||
return el.value;
|
||||
}
|
||||
setValue(el, value: string) {
|
||||
el.value = value;
|
||||
}
|
||||
getChecked(el) {
|
||||
return el.checked;
|
||||
}
|
||||
setChecked(el, value: boolean) {
|
||||
el.checked = value;
|
||||
}
|
||||
createTemplate(html): HTMLElement {
|
||||
var t = document.createElement('template');
|
||||
t.innerHTML = html;
|
||||
return t;
|
||||
}
|
||||
createElement(tagName, doc = document): HTMLElement {
|
||||
return doc.createElement(tagName);
|
||||
}
|
||||
createTextNode(text: string, doc = document): Text {
|
||||
return doc.createTextNode(text);
|
||||
}
|
||||
createScriptTag(attrName: string, attrValue: string, doc = document): HTMLScriptElement {
|
||||
var el = <HTMLScriptElement>doc.createElement('SCRIPT');
|
||||
el.setAttribute(attrName, attrValue);
|
||||
return el;
|
||||
}
|
||||
createStyleElement(css: string, doc = document): HTMLStyleElement {
|
||||
var style = <HTMLStyleElement>doc.createElement('STYLE');
|
||||
style.innerText = css;
|
||||
return style;
|
||||
}
|
||||
createShadowRoot(el: HTMLElement): DocumentFragment {
|
||||
return (<any>el).createShadowRoot();
|
||||
}
|
||||
getShadowRoot(el: HTMLElement): DocumentFragment {
|
||||
return (<any>el).shadowRoot;
|
||||
}
|
||||
getHost(el: HTMLElement): HTMLElement {
|
||||
return (<any>el).host;
|
||||
}
|
||||
clone(node: Node) {
|
||||
return node.cloneNode(true);
|
||||
}
|
||||
hasProperty(element, name: string) {
|
||||
return name in element;
|
||||
}
|
||||
getElementsByClassName(element, name: string) {
|
||||
return element.getElementsByClassName(name);
|
||||
}
|
||||
getElementsByTagName(element, name: string) {
|
||||
return element.getElementsByTagName(name);
|
||||
}
|
||||
classList(element): List<any> {
|
||||
return <List<any>>Array.prototype.slice.call(element.classList, 0);
|
||||
}
|
||||
addClass(element, classname: string) {
|
||||
element.classList.add(classname);
|
||||
}
|
||||
removeClass(element, classname: string) {
|
||||
element.classList.remove(classname);
|
||||
}
|
||||
hasClass(element, classname: string) {
|
||||
return element.classList.contains(classname);
|
||||
}
|
||||
setStyle(element, stylename: string, stylevalue: string) {
|
||||
element.style[stylename] = stylevalue;
|
||||
}
|
||||
removeStyle(element, stylename: string) {
|
||||
element.style[stylename] = null;
|
||||
}
|
||||
getStyle(element, stylename: string) {
|
||||
return element.style[stylename];
|
||||
}
|
||||
tagName(element): string {
|
||||
return element.tagName;
|
||||
}
|
||||
attributeMap(element) {
|
||||
var res = MapWrapper.create();
|
||||
var elAttrs = element.attributes;
|
||||
for (var i = 0; i < elAttrs.length; i++) {
|
||||
var attrib = elAttrs[i];
|
||||
MapWrapper.set(res, attrib.name, attrib.value);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
hasAttribute(element, attribute: string) {
|
||||
return element.hasAttribute(attribute);
|
||||
}
|
||||
getAttribute(element, attribute: string) {
|
||||
return element.getAttribute(attribute);
|
||||
}
|
||||
setAttribute(element, name: string, value: string) {
|
||||
element.setAttribute(name, value);
|
||||
}
|
||||
removeAttribute(element, attribute: string) {
|
||||
return element.removeAttribute(attribute);
|
||||
}
|
||||
templateAwareRoot(el) {
|
||||
return this.isTemplateElement(el) ? this.content(el) : el;
|
||||
}
|
||||
createHtmlDocument() {
|
||||
return document.implementation.createHTMLDocument('fakeTitle');
|
||||
}
|
||||
defaultDoc() {
|
||||
return document;
|
||||
}
|
||||
getBoundingClientRect(el) {
|
||||
return el.getBoundingClientRect();
|
||||
}
|
||||
getTitle() {
|
||||
return document.title;
|
||||
}
|
||||
setTitle(newTitle: string) {
|
||||
document.title = newTitle;
|
||||
}
|
||||
elementMatches(n, selector: string): boolean {
|
||||
return n instanceof HTMLElement && n.matches(selector);
|
||||
}
|
||||
isTemplateElement(el: any): boolean {
|
||||
return el instanceof HTMLElement && el.nodeName == "TEMPLATE";
|
||||
}
|
||||
isTextNode(node: Node): boolean {
|
||||
return node.nodeType === Node.TEXT_NODE;
|
||||
}
|
||||
isCommentNode(node: Node): boolean {
|
||||
return node.nodeType === Node.COMMENT_NODE;
|
||||
}
|
||||
isElementNode(node: Node): boolean {
|
||||
return node.nodeType === Node.ELEMENT_NODE;
|
||||
}
|
||||
hasShadowRoot(node): boolean {
|
||||
return node instanceof HTMLElement && isPresent(node.shadowRoot);
|
||||
}
|
||||
isShadowRoot(node): boolean {
|
||||
return node instanceof DocumentFragment;
|
||||
}
|
||||
importIntoDoc(node: Node) {
|
||||
var result = document.importNode(node, true);
|
||||
// Workaround WebKit https://bugs.webkit.org/show_bug.cgi?id=137619
|
||||
if (this.isTemplateElement(result) && !this.content(result).childNodes.length &&
|
||||
this.content(node).childNodes.length) {
|
||||
var childNodes = this.content(node).childNodes;
|
||||
for (var i = 0; i < childNodes.length; ++i) {
|
||||
this.content(result).appendChild(this.importIntoDoc(childNodes[i]));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
isPageRule(rule): boolean {
|
||||
return rule.type === CSSRule.PAGE_RULE;
|
||||
}
|
||||
isStyleRule(rule): boolean {
|
||||
return rule.type === CSSRule.STYLE_RULE;
|
||||
}
|
||||
isMediaRule(rule): boolean {
|
||||
return rule.type === CSSRule.MEDIA_RULE;
|
||||
}
|
||||
isKeyframesRule(rule): boolean {
|
||||
return rule.type === CSSRule.KEYFRAMES_RULE;
|
||||
}
|
||||
getHref(el: Element): string {
|
||||
return (<any>el).href;
|
||||
}
|
||||
getEventKey(event): string {
|
||||
var key = event.key;
|
||||
if (isBlank(key)) {
|
||||
key = event.keyIdentifier;
|
||||
// keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and
|
||||
// Safari
|
||||
// cf
|
||||
// http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces
|
||||
if (isBlank(key)) {
|
||||
return 'Unidentified';
|
||||
}
|
||||
if (key.startsWith('U+')) {
|
||||
key = String.fromCharCode(parseInt(key.substring(2), 16));
|
||||
if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {
|
||||
// There is a bug in Chrome for numeric keypad keys:
|
||||
// https://code.google.com/p/chromium/issues/detail?id=155654
|
||||
// 1, 2, 3 ... are reported as A, B, C ...
|
||||
key = _chromeNumKeyPadMap[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_keyMap.hasOwnProperty(key)) {
|
||||
key = _keyMap[key];
|
||||
}
|
||||
return key;
|
||||
}
|
||||
getGlobalEventTarget(target: string): EventTarget {
|
||||
if (target == "window") {
|
||||
return window;
|
||||
} else if (target == "document") {
|
||||
return document;
|
||||
} else if (target == "body") {
|
||||
return document.body;
|
||||
}
|
||||
}
|
||||
getHistory() {
|
||||
return window.history;
|
||||
}
|
||||
getLocation() {
|
||||
return window.location;
|
||||
}
|
||||
getBaseHref() {
|
||||
return relativePath(document.baseURI);
|
||||
}
|
||||
}
|
||||
|
||||
// based on urlUtils.js in AngularJS 1
|
||||
var urlParsingNode = null;
|
||||
function relativePath(url) {
|
||||
if (isBlank(urlParsingNode)) {
|
||||
urlParsingNode = document.createElement("a");
|
||||
}
|
||||
urlParsingNode.setAttribute('href', url);
|
||||
return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :
|
||||
'/' + urlParsingNode.pathname;
|
||||
}
|
|
@ -1,298 +0,0 @@
|
|||
import {ABSTRACT, BaseException} from 'angular2/src/facade/lang';
|
||||
|
||||
export var DOM:DomAdapter;
|
||||
|
||||
export function setRootDomAdapter(adapter:DomAdapter) {
|
||||
DOM = adapter;
|
||||
}
|
||||
|
||||
function _abstract() {
|
||||
return new BaseException('This method is abstract');
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides DOM operations in an environment-agnostic way.
|
||||
*/
|
||||
@ABSTRACT()
|
||||
export class DomAdapter {
|
||||
|
||||
logError(error) {
|
||||
throw _abstract();
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps attribute names to their corresponding property names for cases
|
||||
* where attribute name doesn't match property name.
|
||||
*/
|
||||
get attrToPropMap() {
|
||||
throw _abstract();
|
||||
}
|
||||
|
||||
parse(templateHtml:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
query(selector:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
querySelector(el, selector:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
querySelectorAll(el, selector:string):List {
|
||||
throw _abstract();
|
||||
}
|
||||
on(el, evt, listener) {
|
||||
throw _abstract();
|
||||
}
|
||||
onAndCancel(el, evt, listener): Function {
|
||||
throw _abstract();
|
||||
}
|
||||
dispatchEvent(el, evt) {
|
||||
throw _abstract();
|
||||
}
|
||||
createMouseEvent(eventType) {
|
||||
throw _abstract();
|
||||
}
|
||||
createEvent(eventType:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
getInnerHTML(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
getOuterHTML(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
nodeName(node):string {
|
||||
throw _abstract();
|
||||
}
|
||||
nodeValue(node):string {
|
||||
throw _abstract();
|
||||
}
|
||||
type(node):string {
|
||||
throw _abstract();
|
||||
}
|
||||
content(node) {
|
||||
throw _abstract();
|
||||
}
|
||||
firstChild(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
nextSibling(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
parentElement(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
childNodes(el):List {
|
||||
throw _abstract();
|
||||
}
|
||||
childNodesAsList(el):List {
|
||||
throw _abstract();
|
||||
}
|
||||
clearNodes(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
appendChild(el, node) {
|
||||
throw _abstract();
|
||||
}
|
||||
removeChild(el, node) {
|
||||
throw _abstract();
|
||||
}
|
||||
replaceChild(el, newNode, oldNode) {
|
||||
throw _abstract();
|
||||
}
|
||||
remove(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
insertBefore(el, node) {
|
||||
throw _abstract();
|
||||
}
|
||||
insertAllBefore(el, nodes) {
|
||||
throw _abstract();
|
||||
}
|
||||
insertAfter(el, node) {
|
||||
throw _abstract();
|
||||
}
|
||||
setInnerHTML(el, value) {
|
||||
throw _abstract();
|
||||
}
|
||||
getText(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
setText(el, value:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
getValue(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
setValue(el, value:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
getChecked(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
setChecked(el, value:boolean) {
|
||||
throw _abstract();
|
||||
}
|
||||
createTemplate(html) {
|
||||
throw _abstract();
|
||||
}
|
||||
createElement(tagName, doc = null) {
|
||||
throw _abstract();
|
||||
}
|
||||
createTextNode(text: string, doc = null) {
|
||||
throw _abstract();
|
||||
}
|
||||
createScriptTag(attrName:string, attrValue:string, doc = null) {
|
||||
throw _abstract();
|
||||
}
|
||||
createStyleElement(css:string, doc = null) {
|
||||
throw _abstract();
|
||||
}
|
||||
createShadowRoot(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
getShadowRoot(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
getHost(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
getDistributedNodes(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
clone(node) {
|
||||
throw _abstract();
|
||||
}
|
||||
hasProperty(element, name:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
getElementsByClassName(element, name:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
getElementsByTagName(element, name:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
classList(element):List {
|
||||
throw _abstract();
|
||||
}
|
||||
addClass(element, classname:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
removeClass(element, classname:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
hasClass(element, classname:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
setStyle(element, stylename:string, stylevalue:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
removeStyle(element, stylename:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
getStyle(element, stylename:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
tagName(element):string {
|
||||
throw _abstract();
|
||||
}
|
||||
attributeMap(element) {
|
||||
throw _abstract();
|
||||
}
|
||||
hasAttribute(element, attribute:string):boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
getAttribute(element, attribute:string):string {
|
||||
throw _abstract();
|
||||
}
|
||||
setAttribute(element, name:string, value:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
removeAttribute(element, attribute:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
templateAwareRoot(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
createHtmlDocument() {
|
||||
throw _abstract();
|
||||
}
|
||||
defaultDoc() {
|
||||
throw _abstract();
|
||||
}
|
||||
getBoundingClientRect(el) {
|
||||
throw _abstract();
|
||||
}
|
||||
getTitle() {
|
||||
throw _abstract();
|
||||
}
|
||||
setTitle(newTitle:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
elementMatches(n, selector:string):boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
isTemplateElement(el:any):boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
isTextNode(node):boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
isCommentNode(node):boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
isElementNode(node):boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
hasShadowRoot(node):boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
isShadowRoot(node):boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
importIntoDoc(node) {
|
||||
throw _abstract();
|
||||
}
|
||||
isPageRule(rule): boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
isStyleRule(rule): boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
isMediaRule(rule): boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
isKeyframesRule(rule): boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
getHref(element): string {
|
||||
throw _abstract();
|
||||
}
|
||||
getEventKey(event): string {
|
||||
throw _abstract();
|
||||
}
|
||||
resolveAndSetHref(element, baseUrl:string, href:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
cssToRules(css:string): List {
|
||||
throw _abstract();
|
||||
}
|
||||
supportsDOMEvents(): boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
supportsNativeShadowDOM(): boolean {
|
||||
throw _abstract();
|
||||
}
|
||||
getGlobalEventTarget(target:string) {
|
||||
throw _abstract();
|
||||
}
|
||||
getHistory() {
|
||||
throw _abstract();
|
||||
}
|
||||
getLocation() {
|
||||
throw _abstract();
|
||||
}
|
||||
getBaseHref() {
|
||||
throw _abstract();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
import {BaseException} from 'angular2/src/facade/lang';
|
||||
|
||||
// TODO: remove this when we no longer use traceur
|
||||
export var __esModule = true;
|
||||
|
||||
export var DOM: DomAdapter;
|
||||
|
||||
export function setRootDomAdapter(adapter: DomAdapter) {
|
||||
DOM = adapter;
|
||||
}
|
||||
|
||||
function _abstract() {
|
||||
return new BaseException('This method is abstract');
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides DOM operations in an environment-agnostic way.
|
||||
*/
|
||||
export class DomAdapter {
|
||||
logError(error) { throw _abstract(); }
|
||||
|
||||
/**
|
||||
* Maps attribute names to their corresponding property names for cases
|
||||
* where attribute name doesn't match property name.
|
||||
*/
|
||||
get attrToPropMap(): any { throw _abstract(); }
|
||||
|
||||
parse(templateHtml: string) { throw _abstract(); }
|
||||
query(selector: string): any { throw _abstract(); }
|
||||
querySelector(el, selector: string) { throw _abstract(); }
|
||||
querySelectorAll(el, selector: string): List<any> { throw _abstract(); }
|
||||
on(el, evt, listener) { throw _abstract(); }
|
||||
onAndCancel(el, evt, listener): Function { throw _abstract(); }
|
||||
dispatchEvent(el, evt) { throw _abstract(); }
|
||||
createMouseEvent(eventType): any { throw _abstract(); }
|
||||
createEvent(eventType: string): any { throw _abstract(); }
|
||||
getInnerHTML(el): string { throw _abstract(); }
|
||||
getOuterHTML(el): string { throw _abstract(); }
|
||||
nodeName(node): string { throw _abstract(); }
|
||||
nodeValue(node): string { throw _abstract(); }
|
||||
type(node): string { throw _abstract(); }
|
||||
content(node): any { throw _abstract(); }
|
||||
firstChild(el): any { throw _abstract(); }
|
||||
nextSibling(el): any { throw _abstract(); }
|
||||
parentElement(el): any { throw _abstract(); }
|
||||
childNodes(el): List<any> { throw _abstract(); }
|
||||
childNodesAsList(el): List<any> { throw _abstract(); }
|
||||
clearNodes(el) { throw _abstract(); }
|
||||
appendChild(el, node) { throw _abstract(); }
|
||||
removeChild(el, node) { throw _abstract(); }
|
||||
replaceChild(el, newNode, oldNode) { throw _abstract(); }
|
||||
remove(el) { throw _abstract(); }
|
||||
insertBefore(el, node) { throw _abstract(); }
|
||||
insertAllBefore(el, nodes) { throw _abstract(); }
|
||||
insertAfter(el, node) { throw _abstract(); }
|
||||
setInnerHTML(el, value) { throw _abstract(); }
|
||||
getText(el): any { throw _abstract(); }
|
||||
setText(el, value: string) { throw _abstract(); }
|
||||
getValue(el): any { throw _abstract(); }
|
||||
setValue(el, value: string) { throw _abstract(); }
|
||||
getChecked(el): any { throw _abstract(); }
|
||||
setChecked(el, value: boolean) { throw _abstract(); }
|
||||
createTemplate(html): any { throw _abstract(); }
|
||||
createElement(tagName, doc = null): any { throw _abstract(); }
|
||||
createTextNode(text: string, doc = null): any { throw _abstract(); }
|
||||
createScriptTag(attrName: string, attrValue: string, doc = null): any { throw _abstract(); }
|
||||
createStyleElement(css: string, doc = null): any { throw _abstract(); }
|
||||
createShadowRoot(el): any { throw _abstract(); }
|
||||
getShadowRoot(el): any { throw _abstract(); }
|
||||
getHost(el): any { throw _abstract(); }
|
||||
getDistributedNodes(el): List<any> { throw _abstract(); }
|
||||
clone(node): any { throw _abstract(); }
|
||||
hasProperty(element, name: string): boolean { throw _abstract(); }
|
||||
getElementsByClassName(element, name: string): List<any> { throw _abstract(); }
|
||||
getElementsByTagName(element, name: string): List<any> { throw _abstract(); }
|
||||
classList(element): List<any> { throw _abstract(); }
|
||||
addClass(element, classname: string) { throw _abstract(); }
|
||||
removeClass(element, classname: string) { throw _abstract(); }
|
||||
hasClass(element, classname: string) { throw _abstract(); }
|
||||
setStyle(element, stylename: string, stylevalue: string) { throw _abstract(); }
|
||||
removeStyle(element, stylename: string) { throw _abstract(); }
|
||||
getStyle(element, stylename: string) { throw _abstract(); }
|
||||
tagName(element): string { throw _abstract(); }
|
||||
attributeMap(element) { throw _abstract(); }
|
||||
hasAttribute(element, attribute: string): boolean { throw _abstract(); }
|
||||
getAttribute(element, attribute: string): string { throw _abstract(); }
|
||||
setAttribute(element, name: string, value: string) { throw _abstract(); }
|
||||
removeAttribute(element, attribute: string) { throw _abstract(); }
|
||||
templateAwareRoot(el) { throw _abstract(); }
|
||||
createHtmlDocument() { throw _abstract(); }
|
||||
defaultDoc(): any { throw _abstract(); }
|
||||
getBoundingClientRect(el) { throw _abstract(); }
|
||||
getTitle() { throw _abstract(); }
|
||||
setTitle(newTitle: string) { throw _abstract(); }
|
||||
elementMatches(n, selector: string): boolean { throw _abstract(); }
|
||||
isTemplateElement(el: any): boolean { throw _abstract(); }
|
||||
isTextNode(node): boolean { throw _abstract(); }
|
||||
isCommentNode(node): boolean { throw _abstract(); }
|
||||
isElementNode(node): boolean { throw _abstract(); }
|
||||
hasShadowRoot(node): boolean { throw _abstract(); }
|
||||
isShadowRoot(node): boolean { throw _abstract(); }
|
||||
importIntoDoc(node) { throw _abstract(); }
|
||||
isPageRule(rule): boolean { throw _abstract(); }
|
||||
isStyleRule(rule): boolean { throw _abstract(); }
|
||||
isMediaRule(rule): boolean { throw _abstract(); }
|
||||
isKeyframesRule(rule): boolean { throw _abstract(); }
|
||||
getHref(element): string { throw _abstract(); }
|
||||
getEventKey(event): string { throw _abstract(); }
|
||||
resolveAndSetHref(element, baseUrl: string, href: string) { throw _abstract(); }
|
||||
cssToRules(css: string): List<any> { throw _abstract(); }
|
||||
supportsDOMEvents(): boolean { throw _abstract(); }
|
||||
supportsNativeShadowDOM(): boolean { throw _abstract(); }
|
||||
getGlobalEventTarget(target: string) { throw _abstract(); }
|
||||
getHistory() { throw _abstract(); }
|
||||
getLocation() { throw _abstract(); }
|
||||
getBaseHref() { throw _abstract(); }
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
import {ABSTRACT} from 'angular2/src/facade/lang';
|
||||
import {List, ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {isPresent, isFunction} from 'angular2/src/facade/lang';
|
||||
import {DomAdapter} from './dom_adapter';
|
||||
|
@ -6,15 +5,12 @@ import {DomAdapter} from './dom_adapter';
|
|||
/**
|
||||
* Provides DOM operations in any browser environment.
|
||||
*/
|
||||
@ABSTRACT()
|
||||
export class GenericBrowserDomAdapter extends DomAdapter {
|
||||
getDistributedNodes(el) {
|
||||
return el.getDistributedNodes();
|
||||
}
|
||||
resolveAndSetHref(el, baseUrl:string, href:string) {
|
||||
getDistributedNodes(el) { return el.getDistributedNodes(); }
|
||||
resolveAndSetHref(el, baseUrl: string, href: string) {
|
||||
el.href = href == null ? baseUrl : baseUrl + '/../' + href;
|
||||
}
|
||||
cssToRules(css:string): List {
|
||||
cssToRules(css: string): List<any> {
|
||||
var style = this.createStyleElement(css);
|
||||
this.appendChild(this.defaultDoc().head, style);
|
||||
var rules = ListWrapper.create();
|
||||
|
@ -25,10 +21,10 @@ export class GenericBrowserDomAdapter extends DomAdapter {
|
|||
try {
|
||||
var rawRules = style.sheet.cssRules;
|
||||
rules = ListWrapper.createFixedSize(rawRules.length);
|
||||
for (var i=0; i<rawRules.length; i++) {
|
||||
for (var i = 0; i < rawRules.length; i++) {
|
||||
rules[i] = rawRules[i];
|
||||
}
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
} else {
|
||||
|
@ -37,10 +33,6 @@ export class GenericBrowserDomAdapter extends DomAdapter {
|
|||
this.remove(style);
|
||||
return rules;
|
||||
}
|
||||
supportsDOMEvents(): boolean {
|
||||
return true;
|
||||
}
|
||||
supportsNativeShadowDOM(): boolean {
|
||||
return isFunction(this.defaultDoc().body.createShadowRoot);
|
||||
}
|
||||
supportsDOMEvents(): boolean { return true; }
|
||||
supportsNativeShadowDOM(): boolean { return isFunction(this.defaultDoc().body.createShadowRoot); }
|
||||
}
|
Loading…
Reference in New Issue