Bug 53836 - Webkit is ignoring fractional point values when using units in CSS
Summary: Webkit is ignoring fractional point values when using units in CSS
Status: RESOLVED DUPLICATE of bug 52699
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-04 19:39 PST by Rik Cabanier
Modified: 2011-02-08 09:07 PST (History)
0 users

See Also:


Attachments
zip with HTML sample (18.58 KB, application/octet-stream)
2011-02-04 19:41 PST, Rik Cabanier
no flags Details
correct zip with html. Please ignore the first one (18.57 KB, application/octet-stream)
2011-02-04 20:24 PST, Rik Cabanier
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rik Cabanier 2011-02-04 19:39:58 PST
The webkit parser casts units to integer instead of keeping them as double or float.
This causes imprecise placing of objects if they use webkit-transforms with transform(px, px) notation.

In order to fix this, I think we need to fix CSSStyleSelector.cpp line 3051-3052 
from:
        } else if (CSSPrimitiveValue::isUnitTypeLength(type))
            l = Length(primitiveValue->computeLengthIntForLength(style, rootStyle, multiplier), Fixed);
to:
        } else if (CSSPrimitiveValue::isUnitTypeLength(type))
            l = Length(primitiveValue->computeLengthFloat(style, rootStyle, multiplier, false), Fixed);

Attached is a iip file that contains a page that uses transforms with px notation.
Comment 1 Rik Cabanier 2011-02-04 19:41:15 PST
Created attachment 81339 [details]
zip with HTML sample
Comment 2 Rik Cabanier 2011-02-04 20:24:31 PST
Created attachment 81343 [details]
correct zip with html. Please ignore the first one
Comment 3 Rik Cabanier 2011-02-04 20:25:29 PST
(In reply to comment #0)
> The webkit parser casts units to integer instead of keeping them as double or float.
> This causes imprecise placing of objects if they use webkit-transforms with transform(px, px) notation.
> 
> In order to fix this, I think we need to fix CSSStyleSelector.cpp line 3051-3052 
> from:
>         } else if (CSSPrimitiveValue::isUnitTypeLength(type))
>             l = Length(primitiveValue->computeLengthIntForLength(style, rootStyle, multiplier), Fixed);
> to:
>         } else if (CSSPrimitiveValue::isUnitTypeLength(type))
>             l = Length(primitiveValue->computeLengthFloat(style, rootStyle, multiplier, false), Fixed);
> 
> Attached is a iip file that contains a page that uses transforms with px notation.

My proposal doesn't work because length always wants to be an integer.
It seems that it needs to be expanded to accept a float...
Comment 4 Rik Cabanier 2011-02-08 09:07:14 PST

*** This bug has been marked as a duplicate of bug 52699 ***