Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp |
| diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp |
| index 567a7a7586c5d42f09d9217ab8a3fbba13960162..eac75ab2c736f1d7cb4132ffec13f6190a2adcc9 100644 |
| --- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp |
| +++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp |
| @@ -770,6 +770,14 @@ void MediaControlTimelineElement::defaultEventHandler(Event* event) { |
| double time = value().toDouble(); |
| + double duration = mediaElement().duration(); |
| + double maxAttribute = getFloatingPointAttribute(maxAttr); |
| + // Workaround for floating point error - it's possible for this element's max |
| + // attribute to be rounded to a value slightly higher than the duration. If |
| + // this happens and scrubber is dragged near the max, seek to duration. |
| + if (duration < time && time <= maxAttribute && maxAttribute <= duration + 0.5) |
| + time = duration; |
|
mlamouri (slow - plz ping)
2017/02/27 17:48:12
I do not understand why this isn't:
```
if (durati
johnme
2017/02/28 18:02:55
Done.
I was guarding against the case where media
|
| + |
| // FIXME: This will need to take the timeline offset into consideration |
| // once that concept is supported, see https://crbug.com/312699 |
| if (mediaElement().seekable()->contain(time)) |