In CSS code we need to range-check doubles before double-to-int conversion in various places. We need versions that allow only positive numbers, and positive and negative.
Created attachment 79774 [details] Patch
Comment on attachment 79774 [details] Patch r+, but have you thought about how these methods will handle NaN? - I'm guessing that the answer is, we don't care for CSS - in which case I'd suggest ASSERT(!isNaN(d)) in each. If you're not going to guard against NaN, I think you should document what expected behaviour is.
Attachment 79774 [details] did not build on win: Build output: http://queues.webkit.org/results/7515282
Gah, windows: 14>C:\cygwin\home\buildbot\Webkit\WebKitBuild\Debug\include\private\JavaScriptCore/MathExtras.h(213) : error C2220: warning treated as error - no 'object' file generated 14>C:\cygwin\home\buildbot\Webkit\WebKitBuild\Debug\include\private\JavaScriptCore/MathExtras.h(213) : warning C4003: not enough actual parameters for macro 'max' 14>C:\cygwin\home\buildbot\Webkit\WebKitBuild\Debug\include\private\JavaScriptCore/MathExtras.h(213) : error C2589: '(' : illegal token on right side of '::'
Test
Created attachment 80531 [details] Need this change too.
http://trac.webkit.org/changeset/77045