Hang when calling setCurrentTime on SVG with cyclic animation dependency chain
https://bugs.webkit.org/show_bug.cgi?id=113485

Patch by David Vest <davve@opera.com> on 2013-04-02
Reviewed by Stephen Chenney.

Source/WebCore:

If no exact match can be found, approximateBinarySearch may return
either adjacent value to the key. Selecting the lesser value when
there is a greater one may cause interval creation to fail in a
way that causes infinite loops during seeking. Detect and amend
this condition by selecting the greater value when possible.

Test: svg/animations/animation-dependency-hang.html

* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::findInstanceTime):

LayoutTests:

* svg/animations/animation-dependency-hang-expected.txt: Added.
* svg/animations/animation-dependency-hang.html: Added.

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