Clean up interface to Font::expansionOpportunityCount()
[WebKit-https.git] / Source / WebCore / rendering / RenderBlockLineLayout.cpp
index a47811ed3ea6a9707b33875ba816861baae6ef44..6127882f01fbf025e08b39a78a11748034900e0c 100644 (file)
@@ -682,11 +682,7 @@ BidiRun* RenderBlockFlow::computeInlineDirectionPositionsForSegment(RootInlineBo
             if (textAlign == JUSTIFY && r != trailingSpaceRun) {
                 if (!isAfterExpansion)
                     toInlineTextBox(r->box())->setCanHaveLeadingExpansion(true);
-                unsigned opportunitiesInRun;
-                if (rt.is8Bit())
-                    opportunitiesInRun = Font::expansionOpportunityCount(rt.characters8() + r->m_start, r->m_stop - r->m_start, r->box()->direction(), isAfterExpansion);
-                else
-                    opportunitiesInRun = Font::expansionOpportunityCount(rt.characters16() + r->m_start, r->m_stop - r->m_start, r->box()->direction(), isAfterExpansion);
+                unsigned opportunitiesInRun = Font::expansionOpportunityCount(rt.stringView(r->m_start, r->m_stop), r->box()->direction(), isAfterExpansion);
                 expansionOpportunities.append(opportunitiesInRun);
                 expansionOpportunityCount += opportunitiesInRun;
             }