Bug 85214 - Add absoluteValue method for LayoutUnits to allow overloading abs()
Summary: Add absoluteValue method for LayoutUnits to allow overloading abs()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Levi Weintraub
URL:
Keywords:
Depends on:
Blocks: 60318
  Show dependency treegraph
 
Reported: 2012-04-30 11:16 PDT by Levi Weintraub
Modified: 2012-05-02 12:24 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.83 KB, patch)
2012-04-30 11:23 PDT, Levi Weintraub
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.