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

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

Issue 13454026: Update all float attributes in HTMLMediaElement and related objects to double (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 8 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 19 matching lines...) Expand all
30 #include "config.h" 30 #include "config.h"
31 31
32 #if ENABLE(VIDEO) 32 #if ENABLE(VIDEO)
33 #include "MediaControlElements.h" 33 #include "MediaControlElements.h"
34 34
35 #include "CaptionUserPreferences.h" 35 #include "CaptionUserPreferences.h"
36 #include "DOMTokenList.h" 36 #include "DOMTokenList.h"
37 #include "EventNames.h" 37 #include "EventNames.h"
38 #include "EventTarget.h" 38 #include "EventTarget.h"
39 #include "ExceptionCodePlaceholder.h" 39 #include "ExceptionCodePlaceholder.h"
40 #include "FloatConversion.h"
41 #include "Frame.h" 40 #include "Frame.h"
42 #include "GraphicsContext.h" 41 #include "GraphicsContext.h"
43 #include "HTMLVideoElement.h" 42 #include "HTMLVideoElement.h"
44 #include "Language.h" 43 #include "Language.h"
45 #include "LocalizedStrings.h" 44 #include "LocalizedStrings.h"
46 #include "MediaControls.h" 45 #include "MediaControls.h"
47 #include "MouseEvent.h" 46 #include "MouseEvent.h"
48 #include "Page.h" 47 #include "Page.h"
49 #include "PageGroup.h" 48 #include "PageGroup.h"
50 #include "RenderLayer.h" 49 #include "RenderLayer.h"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 mediaController()->beginScrubbing(); 714 mediaController()->beginScrubbing();
716 715
717 if (event->type() == eventNames().mouseupEvent) 716 if (event->type() == eventNames().mouseupEvent)
718 mediaController()->endScrubbing(); 717 mediaController()->endScrubbing();
719 718
720 MediaControlInputElement::defaultEventHandler(event); 719 MediaControlInputElement::defaultEventHandler(event);
721 720
722 if (event->type() == eventNames().mouseoverEvent || event->type() == eventNa mes().mouseoutEvent || event->type() == eventNames().mousemoveEvent) 721 if (event->type() == eventNames().mouseoverEvent || event->type() == eventNa mes().mouseoutEvent || event->type() == eventNames().mousemoveEvent)
723 return; 722 return;
724 723
725 float time = narrowPrecisionToFloat(value().toDouble()); 724 double time = value().toDouble();
726 if (event->type() == eventNames().inputEvent && time != mediaController()->c urrentTime()) 725 if (event->type() == eventNames().inputEvent && time != mediaController()->c urrentTime())
727 mediaController()->setCurrentTime(time, IGNORE_EXCEPTION); 726 mediaController()->setCurrentTime(time, IGNORE_EXCEPTION);
728 727
729 RenderSlider* slider = toRenderSlider(renderer()); 728 RenderSlider* slider = toRenderSlider(renderer());
730 if (slider && slider->inDragMode()) 729 if (slider && slider->inDragMode())
731 m_controls->updateCurrentTimeDisplay(); 730 m_controls->updateCurrentTimeDisplay();
732 } 731 }
733 732
734 bool MediaControlTimelineElement::willRespondToMouseClickEvents() 733 bool MediaControlTimelineElement::willRespondToMouseClickEvents()
735 { 734 {
736 if (!attached()) 735 if (!attached())
737 return false; 736 return false;
738 737
739 return true; 738 return true;
740 } 739 }
741 740
742 void MediaControlTimelineElement::setPosition(float currentTime) 741 void MediaControlTimelineElement::setPosition(double currentTime)
743 { 742 {
744 setValue(String::number(currentTime)); 743 setValue(String::number(currentTime));
745 } 744 }
746 745
747 void MediaControlTimelineElement::setDuration(float duration) 746 void MediaControlTimelineElement::setDuration(double duration)
748 { 747 {
749 setAttribute(maxAttr, String::number(std::isfinite(duration) ? duration : 0) ); 748 setAttribute(maxAttr, String::number(std::isfinite(duration) ? duration : 0) );
750 } 749 }
751 750
752 751
753 const AtomicString& MediaControlTimelineElement::shadowPseudoId() const 752 const AtomicString& MediaControlTimelineElement::shadowPseudoId() const
754 { 753 {
755 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-timeline", At omicString::ConstructFromLiteral)); 754 DEFINE_STATIC_LOCAL(AtomicString, id, ("-webkit-media-controls-timeline", At omicString::ConstructFromLiteral));
756 return id; 755 return id;
757 } 756 }
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 { 1077 {
1079 updateSizes(); 1078 updateSizes();
1080 } 1079 }
1081 #endif // ENABLE(VIDEO_TRACK) 1080 #endif // ENABLE(VIDEO_TRACK)
1082 1081
1083 // ---------------------------- 1082 // ----------------------------
1084 1083
1085 } // namespace WebCore 1084 } // namespace WebCore
1086 1085
1087 #endif // ENABLE(VIDEO) 1086 #endif // ENABLE(VIDEO)
OLDNEW
« no previous file with comments | « Source/WebCore/html/shadow/MediaControlElements.h ('k') | Source/WebCore/html/shadow/MediaControls.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698