refactor(template loading): add support for base URLs, css rewriting
fixes #654
This commit is contained in:
@@ -11,9 +11,11 @@ export 'dart:html' show
|
||||
Element,
|
||||
location,
|
||||
Node,
|
||||
ShadowRoot,
|
||||
StyleElement,
|
||||
TemplateElement,
|
||||
InputElement,
|
||||
AnchorElement,
|
||||
Text,
|
||||
window;
|
||||
|
||||
@@ -127,6 +129,8 @@ class DOM {
|
||||
el.text = css;
|
||||
return el;
|
||||
}
|
||||
static ShadowRoot createShadowRoot(Element el) => el.createShadowRoot();
|
||||
static ShadowRoot getShadowRoot(Element el) => el.shadowRoot;
|
||||
static clone(Node node) => node.clone(true);
|
||||
static bool hasProperty(Element element, String name) =>
|
||||
new JsObject.fromBrowserObject(element).hasProperty(name);
|
||||
|
||||
@@ -6,8 +6,10 @@ export var Node = window.Node;
|
||||
export var NodeList = window.NodeList;
|
||||
export var Text = window.Text;
|
||||
export var Element = window.HTMLElement;
|
||||
export var AnchorElement = window.HTMLAnchorElement;
|
||||
export var TemplateElement = window.HTMLTemplateElement;
|
||||
export var StyleElement = window.HTMLStyleElement;
|
||||
export var ShadowRoot = window.ShadowRoot;
|
||||
export var document = window.document;
|
||||
export var location = window.location;
|
||||
export var gc = window.gc ? () => window.gc() : () => null;
|
||||
@@ -144,6 +146,12 @@ export class DOM {
|
||||
style.innerText = css;
|
||||
return style;
|
||||
}
|
||||
static createShadowRoot(el: Element): ShadowRoot {
|
||||
return el.createShadowRoot();
|
||||
}
|
||||
static getShadowRoot(el: Element): ShadowRoot {
|
||||
return el.shadowRoot;
|
||||
}
|
||||
static clone(node:Node) {
|
||||
return node.cloneNode(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user