Title: [89950] trunk/Source/WebCore
Revision
89950
Author
[email protected]
Date
2011-06-28 12:37:07 -0700 (Tue, 28 Jun 2011)

Log Message

2011-06-28  Abhishek Arya  <[email protected]>

        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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89949 => 89950)


--- trunk/Source/WebCore/ChangeLog	2011-06-28 19:33:27 UTC (rev 89949)
+++ trunk/Source/WebCore/ChangeLog	2011-06-28 19:37:07 UTC (rev 89950)
@@ -1,3 +1,19 @@
+2011-06-28  Abhishek Arya  <[email protected]>
+
+        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):
+
 2011-06-28  Greg Simon  <[email protected]>
 
         Reviewed by Dimitri Glazkov.

Modified: trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp (89949 => 89950)


--- trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2011-06-28 19:33:27 UTC (rev 89949)
+++ trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2011-06-28 19:37:07 UTC (rev 89950)
@@ -159,7 +159,8 @@
         // Figure out how big the filename space needs to be for a given number of characters
         // (using "0" as the nominal character).
         const UChar ch = '0';
-        float charWidth = font.width(constructTextRun(this, font, String(&ch, 1), style, TextRun::AllowTrailingExpansion));
+        const String str = String(&ch, 1);
+        float charWidth = font.width(constructTextRun(this, font, str, style, TextRun::AllowTrailingExpansion));
         m_maxPreferredLogicalWidth = (int)ceilf(charWidth * defaultWidthNumChars);
     }
 

Modified: trunk/Source/WebCore/rendering/RenderTextControl.cpp (89949 => 89950)


--- trunk/Source/WebCore/rendering/RenderTextControl.cpp	2011-06-28 19:33:27 UTC (rev 89949)
+++ trunk/Source/WebCore/rendering/RenderTextControl.cpp	2011-06-28 19:37:07 UTC (rev 89950)
@@ -522,8 +522,9 @@
         return roundf(style()->font().primaryFont()->avgCharWidth());
 
     const UChar ch = '0';
+    const String str = String(&ch, 1);
     const Font& font = style()->font();
-    TextRun textRun = constructTextRun(this, font, String(&ch, 1), style(), TextRun::AllowTrailingExpansion);
+    TextRun textRun = constructTextRun(this, font, str, style(), TextRun::AllowTrailingExpansion);
     textRun.disableRoundingHacks();
     return font.width(textRun);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to