[Webkit-unassigned] [Bug 52699] Allow Fixed Length values to be floating point

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 9 07:59:12 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=52699


Simon Fraser (smfr) <simon.fraser at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.fraser at apple.com




--- Comment #5 from Simon Fraser (smfr) <simon.fraser at apple.com>  2011-02-09 07:59:12 PST ---
(In reply to comment #4)
> > 
> > In that case the patch needs to include new results for all the affected tests.
> Will do so
> 
> > 
> > This changelog entry needs to mention the changes in Length behavior.
> > 
> > > Source/WebCore/platform/Length.h:33
> > > -const int percentScaleFactor = 128;
> > > -const int intMaxForLength = 0x7ffffff; // max value for a 28-bit int
> > > -const int intMinForLength = (-0x7ffffff - 1); // min value for a 28-bit int
> > > +const int intMaxForLength = 0x7ffff; // max value for a 20-bit int
> > > +const int intMinForLength = (-0x7ffff - 1); // min value for a 20-bit int
> > 
> > I don't think it's acceptable to change the max and min int values that Length can store. That might break websites (which do things like z-index: 999999999).
> 
> That doesn't work today either. Length can store at most 134217472 which is less than 999999999. The class also doesn't do bounds checking, so the larger value will overflow and become garbage.

Bounds checking should happen elsewhere (e.g. in CSSPrimitiveValue methods).

> It seems that making it a full int or float is the correct solution. Is it acceptable that the class takes up 4 more bytes?

I don't know; we pass Lengths by value all over the place.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list