Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: Source/core/html/shadow/MediaControlElements.cpp

Issue 614263002: Drop all timeline seeks outside of the seekable range. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@seek
Patch Set: Rebase. Test. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 19 matching lines...) Expand all
30 #include "config.h" 30 #include "config.h"
31 #include "core/html/shadow/MediaControlElements.h" 31 #include "core/html/shadow/MediaControlElements.h"
32 32
33 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 33 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
34 #include "core/dom/DOMTokenList.h" 34 #include "core/dom/DOMTokenList.h"
35 #include "core/dom/shadow/ShadowRoot.h" 35 #include "core/dom/shadow/ShadowRoot.h"
36 #include "core/events/MouseEvent.h" 36 #include "core/events/MouseEvent.h"
37 #include "core/frame/LocalFrame.h" 37 #include "core/frame/LocalFrame.h"
38 #include "core/html/HTMLVideoElement.h" 38 #include "core/html/HTMLVideoElement.h"
39 #include "core/html/MediaController.h" 39 #include "core/html/MediaController.h"
40 #include "core/html/TimeRanges.h"
40 #include "core/html/shadow/MediaControls.h" 41 #include "core/html/shadow/MediaControls.h"
41 #include "core/html/track/TextTrack.h" 42 #include "core/html/track/TextTrack.h"
42 #include "core/html/track/vtt/VTTRegionList.h" 43 #include "core/html/track/vtt/VTTRegionList.h"
43 #include "core/page/EventHandler.h" 44 #include "core/page/EventHandler.h"
44 #include "core/rendering/RenderMediaControlElements.h" 45 #include "core/rendering/RenderMediaControlElements.h"
45 #include "core/rendering/RenderSlider.h" 46 #include "core/rendering/RenderSlider.h"
46 #include "core/rendering/RenderTheme.h" 47 #include "core/rendering/RenderTheme.h"
47 #include "core/rendering/RenderVideo.h" 48 #include "core/rendering/RenderVideo.h"
48 #include "platform/RuntimeEnabledFeatures.h" 49 #include "platform/RuntimeEnabledFeatures.h"
49 50
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 412
412 MediaControlInputElement::defaultEventHandler(event); 413 MediaControlInputElement::defaultEventHandler(event);
413 414
414 if (event->type() == EventTypeNames::mouseover || event->type() == EventType Names::mouseout || event->type() == EventTypeNames::mousemove) 415 if (event->type() == EventTypeNames::mouseover || event->type() == EventType Names::mouseout || event->type() == EventTypeNames::mousemove)
415 return; 416 return;
416 417
417 double time = value().toDouble(); 418 double time = value().toDouble();
418 if (event->type() == EventTypeNames::input) { 419 if (event->type() == EventTypeNames::input) {
419 // FIXME: This will need to take the timeline offset into consideration 420 // FIXME: This will need to take the timeline offset into consideration
420 // once that concept is supported, see https://crbug.com/312699 421 // once that concept is supported, see https://crbug.com/312699
421 if (mediaElement().controller()) 422 if (mediaElement().controller()) {
422 mediaElement().controller()->setCurrentTime(time); 423 if (mediaElement().controller()->seekable()->contain(time))
423 else 424 mediaElement().controller()->setCurrentTime(time);
425 } else if (mediaElement().seekable()->contain(time)) {
424 mediaElement().setCurrentTime(time, IGNORE_EXCEPTION); 426 mediaElement().setCurrentTime(time, IGNORE_EXCEPTION);
427 }
425 } 428 }
426 429
427 RenderSlider* slider = toRenderSlider(renderer()); 430 RenderSlider* slider = toRenderSlider(renderer());
428 if (slider && slider->inDragMode()) 431 if (slider && slider->inDragMode())
429 mediaControls().updateCurrentTimeDisplay(); 432 mediaControls().updateCurrentTimeDisplay();
430 } 433 }
431 434
432 bool MediaControlTimelineElement::willRespondToMouseClickEvents() 435 bool MediaControlTimelineElement::willRespondToMouseClickEvents()
433 { 436 {
434 return inDocument() && document().isActive(); 437 return inDocument() && document().isActive();
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 float fontSize = smallestDimension * 0.05f; 773 float fontSize = smallestDimension * 0.05f;
771 if (fontSize != m_fontSize) { 774 if (fontSize != m_fontSize) {
772 m_fontSize = fontSize; 775 m_fontSize = fontSize;
773 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue: :CSS_PX); 776 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue: :CSS_PX);
774 } 777 }
775 } 778 }
776 779
777 // ---------------------------- 780 // ----------------------------
778 781
779 } // namespace blink 782 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/media/audio-timeline-seek-outside-seekable.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698