⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 89950 in webkit


Ignore:
Timestamp:
Jun 28, 2011, 12:37:07 PM (15 years ago)
Author:
inferno@chromium.org
Message:

2011-06-28 Abhishek Arya <inferno@chromium.org>

Reviewed by Anders Carlsson.

Split the string creation into a local (while creating text runs)
so that it is not destroyed prematurely.
https://bugs.webkit.org/show_bug.cgi?id=63543

Run fast/forms/text-control-intrinsic-widths.html under valgrind/ASAN.

  • rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::computePreferredLogicalWidths): this one is just done for caution, in case, we don't do the same mistake when adding legacy rounding hacks option.
  • rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::getAvgCharWidth):
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89948 r89950  
     12011-06-28  Abhishek Arya  <inferno@chromium.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Split the string creation into a local (while creating text runs)
     6        so that it is not destroyed prematurely.
     7        https://bugs.webkit.org/show_bug.cgi?id=63543
     8
     9        Run fast/forms/text-control-intrinsic-widths.html under valgrind/ASAN.       
     10        * rendering/RenderFileUploadControl.cpp:
     11        (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
     12        this one is just done for caution, in case, we don't do the same
     13        mistake when adding legacy rounding hacks option.
     14        * rendering/RenderTextControl.cpp:
     15        (WebCore::RenderTextControl::getAvgCharWidth):
     16
    1172011-06-28  Greg Simon  <gregsimon@chromium.org>
    218
  • trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp

    r89777 r89950  
    160160        // (using "0" as the nominal character).
    161161        const UChar ch = '0';
    162         float charWidth = font.width(constructTextRun(this, font, String(&ch, 1), style, TextRun::AllowTrailingExpansion));
     162        const String str = String(&ch, 1);
     163        float charWidth = font.width(constructTextRun(this, font, str, style, TextRun::AllowTrailingExpansion));
    163164        m_maxPreferredLogicalWidth = (int)ceilf(charWidth * defaultWidthNumChars);
    164165    }
  • trunk/Source/WebCore/rendering/RenderTextControl.cpp

    r89913 r89950  
    523523
    524524    const UChar ch = '0';
     525    const String str = String(&ch, 1);
    525526    const Font& font = style()->font();
    526     TextRun textRun = constructTextRun(this, font, String(&ch, 1), style(), TextRun::AllowTrailingExpansion);
     527    TextRun textRun = constructTextRun(this, font, str, style(), TextRun::AllowTrailingExpansion);
    527528    textRun.disableRoundingHacks();
    528529    return font.width(textRun);
Note: See TracChangeset for help on using the changeset viewer.