   getPositionRangeOfCommonAttributeAtPosition: (attributeName, position) ->
     {index, offset} = @locationFromPosition(position)
     text = @getTextAtIndex(index)
-    [left, right] = text.getExpandedRangeForAttributeAtOffset(attributeName, offset)
-    locationRange = new Trix.LocationRange {index, offset: left}, {index, offset: right}
-    @positionRangeFromLocationRange(locationRange)
+    [startOffset, endOffset] = text.getExpandedRangeForAttributeAtOffset(attributeName, offset)
+
+    start = @positionFromLocation {index, offset: startOffset}
+    end = @positionFromLocation {index, offset: endOffset}
+    new Trix.PositionRange start, end
 
   attributesForBlock = (block) ->
     attributes = {}

    @blockList.eachObject(callback)

  eachBlockAtPositionRange: (positionRange, callback) ->
    locationRange = @locationRangeFromPositionRange(positionRange)
    if locationRange.isInSingleIndex()
      block = @getBlockAtIndex(locationRange.index)
      textRange = [locationRange.start.offset, locationRange.end.offset]
      callback(block, textRange, locationRange.index)
    else
      locationRange.eachIndex (index) =>
        block = @getBlockAtIndex(index)

        textRange = switch index
          when locationRange.start.index
            [locationRange.start.offset, block.text.getLength()]
          when locationRange.end.index
            [0, locationRange.end.offset]
          else
            [0, block.text.getLength()]


  insertBlockBreakAtPositionRange: edit "insertBlockBreakAtPositionRange", (positionRange) ->
    positionRange = Trix.PositionRange.box(positionRange)
    position = positionRange.start
    {offset} = @locationFromPosition(position)

    @removeTextAtPositionRange(positionRange)
    blocks = [new Trix.Block] if offset is 0
    @blockList = @blockList.insertSplittableListAtPosition(new Trix.SplittableList(blocks), position)

  applyBlockAttributeAtPositionRange: edit "applyBlockAttributeAtPositionRange", (attributeName, value, positionRange) ->
