File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -126,12 +126,15 @@ class Html5LibDomAdapter implements DomAdapter {
126126 clearNodes (el) {
127127 throw 'not implemented' ;
128128 }
129- appendChild (el, node) => null ;
129+ appendChild (el, node) => el. append (node. remove ()) ;
130130 removeChild (el, node) {
131131 throw 'not implemented' ;
132132 }
133- remove (el) => null ;
134- insertBefore (el, node) => null ;
133+ remove (el) => el.remove ();
134+ insertBefore (el, node) {
135+ if (el.parent == null ) throw '$el must have a parent' ;
136+ el.parent.insertBefore (node, el);
137+ }
135138 insertAllBefore (el, nodes) {
136139 throw 'not implemented' ;
137140 }
@@ -229,9 +232,11 @@ class Html5LibDomAdapter implements DomAdapter {
229232 getAttribute (element, String attribute) {
230233 throw 'not implemented' ;
231234 }
232- setAttribute (element, String name, String value) => null ;
235+ setAttribute (element, String name, String value) {
236+ element.attributes[name] = value;
237+ }
233238 removeAttribute (element, String attribute) {
234- throw 'not implemented' ;
239+ element.attributes. remove (attribute) ;
235240 }
236241
237242 templateAwareRoot (el) => el;
You can’t perform that action at this time.
0 commit comments