File size: 464 Bytes
bc20498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function NullRenderer( options ){
  this.options = options;
  this.notifications = 0; // for testing
}

let noop = function(){};

let throwImgErr = function(){
  throw new Error('A headless instance can not render images');
};

NullRenderer.prototype = {
  recalculateRenderedStyle: noop,
  notify: function(){ this.notifications++; },
  init: noop,
  isHeadless: function(){ return true; },
  png: throwImgErr,
  jpg: throwImgErr
};

export default NullRenderer;