Fix overflow in LayoutUnit::ceil and floor for SATURATED_LAYOUT_ARITHMETIC
https://bugs.webkit.org/show_bug.cgi?id=105961

Source/WebCore:

Reviewed by Levi Weintraub.

The LayoutUnit::ceil and floor methods overflows if given the
intMaxForLayoutUnit and intMinForLayoutUnit values respectively.
Check for the max/min value to avoid this.

Test: TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp

* platform/LayoutUnit.h:
(WebCore::LayoutUnit::ceil):
(WebCore::LayoutUnit::floor):
Check for the max/min value and return early to avoid overflow.
Use the UNLIKELY macro to avoid the cost of branch misprediction
for the common case.

Tools:

Reviewed by Levi Weintraub.

Add tests for LayoutUnit::ceil and floor.

* TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp:
(TestWebKitAPI::TEST):
(TestWebKitAPI):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138736 268f45cc-cd09-0410-ab3c-d52691b4dbfc