   transform = new WebKitCSSMatrix window.getComputedStyle(o).transform
   o.offsetLeft + transform.m41
 
+devicePixelRatio = window.devicePixelRatio || 1
+
 sleep = (duration) ->
   t = new Date
   waitsFor -> new Date - t > duration

        nextAnimationFrame()

      it 'adjusts the width of the minimap canvas', ->
        expect(minimapElement.canvas.width).toEqual(4)

      it 'offsets the minimap by the difference', ->
        expect(realOffsetLeft(minimapElement)).toBeCloseTo(editorElement.clientWidth - 4, -1)

          expect(minimapElement.offsetWidth).toBeCloseTo(editorElement.offsetWidth / 11, 0)
          expect(minimapElement.offsetHeight).toEqual(editorElement.offsetHeight)

          expect(canvas.offsetWidth / devicePixelRatio).toEqual(minimapElement.offsetWidth)
          expect(canvas.offsetHeight / devicePixelRatio).toEqual(minimapElement.offsetHeight + minimap.getLineHeight())

      describe 'when the editor visible content is changed', ->
        beforeEach ->
