Bug 85214

Summary: Add absoluteValue method for LayoutUnits to allow overloading abs()
Product: WebKit Reporter: Levi Weintraub <leviw>
Component: Layout and RenderingAssignee: Levi Weintraub <leviw>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, eae, eric, jchaffraix
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 60318    
Attachments:
Description Flags
Patch none

Description Levi Weintraub 2012-04-30 11:16:03 PDT
Since we can't overload std::abs() directly, adding an inline absoluteValue method instead.
Comment 1 Levi Weintraub 2012-04-30 11:23:31 PDT
Created attachment 139485 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-04-30 12:03:35 PDT
Comment on attachment 139485 [details]
Patch

Darin Adler is a better reviewer for this than I am.  But this is OK for me.  I'd like you to wait a few hours and see if you can get him to comment as well though.
Comment 3 Eric Seidel (no email) 2012-04-30 12:04:07 PDT
The reason why I suggest Darin, is that he might have a clever suggestion for your std::abs() problem other than this one.
Comment 4 Levi Weintraub 2012-04-30 12:05:24 PDT
(In reply to comment #3)
> The reason why I suggest Darin, is that he might have a clever suggestion for your std::abs() problem other than this one.

Deal! I'll wait till near EOD PST.
Comment 5 Levi Weintraub 2012-04-30 16:37:51 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > The reason why I suggest Darin, is that he might have a clever suggestion for your std::abs() problem other than this one.
> 
> Deal! I'll wait till near EOD PST.

Unless there's argument, I'll move forward on landing this.
Comment 6 Levi Weintraub 2012-04-30 17:05:43 PDT
Committed r115691: <http://trac.webkit.org/changeset/115691>
Comment 7 Levi Weintraub 2012-05-01 11:56:10 PDT
Comment on attachment 139485 [details]
Patch

Clearing flags
Comment 8 Darin Adler 2012-05-02 12:24:08 PDT
Comment on attachment 139485 [details]
Patch

Only thing I might have done differently would have been to overload it for int and FractionalLayoutUnit from the start rather than defining it as a function that takes LayoutUnit.