Commit 8f03ce2d authored by rjw's avatar rjw

Fix for 3134543 (and widely reported dupes). Don't use render_text

        widths cache except for whitespace == PRE.  The problem was that additional
        spaces in the RenderText's string were being inappropiately measured.
        An alternate, more complex and risky, fix would account for the whitespace
        properties during scanning of the RenderText width buffer.  Considering
        the scenario for which this optimization was added (3133261), this
        simpler fix is adequate.

        Reviewed by Darin and Don.

        * khtml/rendering/render_text.cpp:
        (RenderText::computeWidths):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 523f0cbf
2002-12-24 Richard Williamson <rjw@apple.com>
Fix for 3134543 (and widely reported dupes). Don't use render_text
widths cache except for whitespace == PRE. The problem was that additional
spaces in the RenderText's string were being inappropiately measured.
An alternate, more complex and risky, fix would account for the whitespace
properties during scanning of the RenderText width buffer. Considering
the scenario for which this optimization was added (3133261), this
simpler fix is adequate.
Reviewed by Darin and Don.
* khtml/rendering/render_text.cpp:
(RenderText::computeWidths):
2002-12-24 Darin Adler <darin@apple.com>
Reviewed by Don.
......
2002-12-24 Richard Williamson <rjw@apple.com>
Fix for 3134543 (and widely reported dupes). Don't use render_text
widths cache except for whitespace == PRE. The problem was that additional
spaces in the RenderText's string were being inappropiately measured.
An alternate, more complex and risky, fix would account for the whitespace
properties during scanning of the RenderText width buffer. Considering
the scenario for which this optimization was added (3133261), this
simpler fix is adequate.
Reviewed by Darin and Don.
* khtml/rendering/render_text.cpp:
(RenderText::computeWidths):
2002-12-24 Darin Adler <darin@apple.com>
Reviewed by Don.
......
......@@ -794,13 +794,16 @@ void RenderText::computeWidths()
m_widths = 0;
}
if (str->l > MIN_STRING_LENGTH_FOR_WIDTH_CACHE){
// Only cache widths array if style()->whiteSpace() == PRE. This prevents
// inappropriate mismeasurement of extra whitespace embedded in the string.
if (str->l >= MIN_STRING_LENGTH_FOR_WIDTH_CACHE && style()->whiteSpace() == PRE){
m_widths = (float *)malloc(str->l * sizeof(float));
f->floatCharacterWidths( str->s, str->l, 0, str->l, 0, m_widths);
}
}
}
inline int RenderText::widthFromBuffer(const Font *f, int start, int len) const
{
float width = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment