Take into account the entire run length to get a proper selection.
[WebKit-https.git] / WebCore / platform / Font.cpp
index 62878d3ef789ed666bfbc0b315fb51246c3a202c..ad047907626d75cbaecb75d4c26e3d2902e78443 100644 (file)
@@ -101,7 +101,7 @@ WidthIterator::WidthIterator(const Font* font, const TextRun& run, const TextSty
         m_padPerSpace = 0;
     else {
         float numSpaces = 0;
-        for (int i = run.from(); i < m_end; i++)
+        for (int i = 0; i < run.length(); i++)
             if (Font::treatAsSpace(m_run[i]))
                 numSpaces++;