assetgraph
Version:
An auto discovery dependency graph based optimization framework for web pages and applications
22 lines (16 loc) • 559 B
JavaScript
const HtmlRelation = require('./HtmlRelation');
class HtmlShortcutIcon 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', 'shortcut icon'); // Hmm, how to handle apple-touch-icon?
return super.attach(position, adjacentRelation);
}
}
HtmlShortcutIcon.prototype.targetType = 'Image';
module.exports = HtmlShortcutIcon;