assetgraph
Version:
An auto discovery dependency graph based optimization framework for web pages and applications
18 lines (13 loc) • 449 B
JavaScript
const HtmlRelation = require('./HtmlRelation');
class HtmlIFrameSrcDoc extends HtmlRelation {
inlineHtmlRelation() {
this.node.setAttribute('srcdoc', this.to.text);
this.from.markDirty();
}
attach(position, adjacentRelation) {
this.node = this.from.parseTree.createElement('iframe');
return super.attach(position, adjacentRelation);
}
}
HtmlIFrameSrcDoc.prototype._hrefType = 'inline';
module.exports = HtmlIFrameSrcDoc;