Factor LegacyInlineFlowBox painting into a class