Unrelated to this patch, but I feel like the readability of this could be improved by adding some positional functions such as ``startsBefore(specA, specB)``, ``intersects(specA, specB)`` etc. 

The above logic would then become:
``if (startsBefore(removeTextSpec, setStyleSpec) && intersects(removeTextSpec, setStyleSpec)) { ... }``