[LFC][IFC] Compute isFirstBox/isLastBox for text content