assetgraph
Version:
An auto discovery dependency graph based optimization framework for web pages and applications
21 lines (16 loc) • 515 B
JavaScript
const HtmlRelation = require('./HtmlRelation');
class HtmlSearchLink extends HtmlRelation {
get href() {
return this.node.getAttribute('href');
}
set href(href) {
this.node.setAttribute('href', href);
}
attach(position, adjacentRelation) {
this.node = this.from.parseTree.createElement('link');
this.node.setAttribute('rel', 'search');
this.node.setAttribute('type', this.to.contentType);
return super.attach(position, adjacentRelation);
}
}
module.exports = HtmlSearchLink;