fix(transformer): Throw unimplemented errors in HtmlAdapter.
closes #2624 closes #2627
This commit is contained in:
parent
b8ef20e353
commit
f9d72bd85b
|
@ -126,12 +126,15 @@ class Html5LibDomAdapter implements DomAdapter {
|
||||||
clearNodes(el) {
|
clearNodes(el) {
|
||||||
throw 'not implemented';
|
throw 'not implemented';
|
||||||
}
|
}
|
||||||
appendChild(el, node) => null;
|
appendChild(el, node) => el.append(node.remove());
|
||||||
removeChild(el, node) {
|
removeChild(el, node) {
|
||||||
throw 'not implemented';
|
throw 'not implemented';
|
||||||
}
|
}
|
||||||
remove(el) => null;
|
remove(el) => el.remove();
|
||||||
insertBefore(el, node) => null;
|
insertBefore(el, node) {
|
||||||
|
if (el.parent == null) throw '$el must have a parent';
|
||||||
|
el.parent.insertBefore(node, el);
|
||||||
|
}
|
||||||
insertAllBefore(el, nodes) {
|
insertAllBefore(el, nodes) {
|
||||||
throw 'not implemented';
|
throw 'not implemented';
|
||||||
}
|
}
|
||||||
|
@ -229,9 +232,11 @@ class Html5LibDomAdapter implements DomAdapter {
|
||||||
getAttribute(element, String attribute) {
|
getAttribute(element, String attribute) {
|
||||||
throw 'not implemented';
|
throw 'not implemented';
|
||||||
}
|
}
|
||||||
setAttribute(element, String name, String value) => null;
|
setAttribute(element, String name, String value) {
|
||||||
|
element.attributes[name] = value;
|
||||||
|
}
|
||||||
removeAttribute(element, String attribute) {
|
removeAttribute(element, String attribute) {
|
||||||
throw 'not implemented';
|
element.attributes.remove(attribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
templateAwareRoot(el) => el;
|
templateAwareRoot(el) => el;
|
||||||
|
|
Loading…
Reference in New Issue