Bug 93572

Summary: Append the unit in place when generating the text value of a CSSPrimitiveValue
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: WebCore JavaScriptAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, macpherson, menard, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kling: review+

Description Benjamin Poulain 2012-08-08 19:59:11 PDT
Append the unit in place when generating the text value of a CSSPrimitiveValue
Comment 1 Benjamin Poulain 2012-08-08 20:33:41 PDT
Created attachment 157379 [details]
Patch
Comment 2 Andreas Kling 2012-08-09 05:02:52 PDT
Comment on attachment 157379 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=157379&action=review

r=me, great idea.

> Source/WebCore/css/CSSPrimitiveValue.cpp:835
> -    StringBuffer<UChar> buffer(decimal.bufferLengthForStringDecimal());
> +    StringBuffer<UChar> buffer(decimal.bufferLengthForStringDecimal() + suffixLength);

Could this also be made to use LChar/8-bit strings?
Comment 3 Benjamin Poulain 2012-08-09 10:46:50 PDT
> > Source/WebCore/css/CSSPrimitiveValue.cpp:835
> > -    StringBuffer<UChar> buffer(decimal.bufferLengthForStringDecimal());
> > +    StringBuffer<UChar> buffer(decimal.bufferLengthForStringDecimal() + suffixLength);
> 
> Could this also be made to use LChar/8-bit strings?

Yep, I had been thinking the exact same thing when writing that :)
Comment 4 Benjamin Poulain 2012-08-09 16:50:12 PDT
Committed r125221: <http://trac.webkit.org/changeset/125221>