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

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

Issue 2725893002: Media Controls timeline: immediately update current time display (Closed)
Patch Set: Mark media/controls-drag-timebar-rendering.html failing, see crbug.com/699096 Created 3 years, 9 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
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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 // attribute to be rounded to a value slightly higher than the duration. If 800 // attribute to be rounded to a value slightly higher than the duration. If
801 // this happens and scrubber is dragged near the max, seek to duration. 801 // this happens and scrubber is dragged near the max, seek to duration.
802 if (time > duration) 802 if (time > duration)
803 time = duration; 803 time = duration;
804 804
805 // FIXME: This will need to take the timeline offset into consideration 805 // FIXME: This will need to take the timeline offset into consideration
806 // once that concept is supported, see https://crbug.com/312699 806 // once that concept is supported, see https://crbug.com/312699
807 if (mediaElement().seekable()->contain(time)) 807 if (mediaElement().seekable()->contain(time))
808 mediaElement().setCurrentTime(time); 808 mediaElement().setCurrentTime(time);
809 809
810 LayoutSliderItem slider = LayoutSliderItem(toLayoutSlider(layoutObject())); 810 // Provide immediate feedback (without waiting for media to seek) to make it
811 if (!slider.isNull() && slider.inDragMode()) 811 // easier for user to seek to a precise time.
812 mediaControls().updateCurrentTimeDisplay(); 812 mediaControls().updateCurrentTimeDisplay();
813 } 813 }
814 814
815 bool MediaControlTimelineElement::willRespondToMouseClickEvents() { 815 bool MediaControlTimelineElement::willRespondToMouseClickEvents() {
816 return isConnected() && document().isActive(); 816 return isConnected() && document().isActive();
817 } 817 }
818 818
819 void MediaControlTimelineElement::setPosition(double currentTime) { 819 void MediaControlTimelineElement::setPosition(double currentTime) {
820 setValue(String::number(currentTime)); 820 setValue(String::number(currentTime));
821 821
822 if (LayoutObject* layoutObject = this->layoutObject()) 822 if (LayoutObject* layoutObject = this->layoutObject())
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 MediaControlCurrentTimeDisplayElement* 1078 MediaControlCurrentTimeDisplayElement*
1079 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) { 1079 MediaControlCurrentTimeDisplayElement::create(MediaControls& mediaControls) {
1080 MediaControlCurrentTimeDisplayElement* element = 1080 MediaControlCurrentTimeDisplayElement* element =
1081 new MediaControlCurrentTimeDisplayElement(mediaControls); 1081 new MediaControlCurrentTimeDisplayElement(mediaControls);
1082 element->setShadowPseudoId( 1082 element->setShadowPseudoId(
1083 AtomicString("-webkit-media-controls-current-time-display")); 1083 AtomicString("-webkit-media-controls-current-time-display"));
1084 return element; 1084 return element;
1085 } 1085 }
1086 1086
1087 } // namespace blink 1087 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698