Changeset 207187 in webkit
- Timestamp:
- Oct 11, 2016 9:47:00 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207183 r207187 1 2016-10-11 Chris Dumez <cdumez@apple.com> 2 3 Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event] 4 https://bugs.webkit.org/show_bug.cgi?id=163311 5 6 Reviewed by Ryosuke Niwa. 7 8 Update DeviceProximityEvent to stop using legacy [ConstructorTemplate=Event] 9 and use a regular constructor instead, as in the specification: 10 - https://www.w3.org/TR/2015/WD-proximity-20150903/#deviceproximityevent-interface 11 12 * Modules/proximity/DeviceProximityEvent.cpp: 13 (WebCore::DeviceProximityEvent::DeviceProximityEvent): 14 * Modules/proximity/DeviceProximityEvent.h: 15 (WebCore::DeviceProximityEvent::create): 16 (WebCore::DeviceProximityEventInit::DeviceProximityEventInit): Deleted. 17 * Modules/proximity/DeviceProximityEvent.idl: 18 1 19 2016-10-11 Gyuyoung Kim <gyuyoung.kim@webkit.org> 2 20 -
trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.cpp
r136385 r207187 40 40 } 41 41 42 DeviceProximityEvent::DeviceProximityEvent(const AtomicString& eventType, const DeviceProximityEventInit& initializer)43 : Event(eventType, initializer )44 , m_value(initializer.value )45 , m_min(initializer.min )46 , m_max(initializer.max )42 DeviceProximityEvent::DeviceProximityEvent(const AtomicString& eventType, const Init& initializer, IsTrusted isTrusted) 43 : Event(eventType, initializer, isTrusted) 44 , m_value(initializer.value ? *initializer.value : std::numeric_limits<double>::infinity()) 45 , m_min(initializer.min ? *initializer.min : -std::numeric_limits<double>::infinity()) 46 , m_max(initializer.max ? *initializer.max : std::numeric_limits<double>::infinity()) 47 47 { 48 48 } -
trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.h
r177259 r207187 27 27 namespace WebCore { 28 28 29 struct DeviceProximityEventInit : public EventInit {30 DeviceProximityEventInit()31 : value(std::numeric_limits<double>::infinity())32 , min(-std::numeric_limits<double>::infinity())33 , max(std::numeric_limits<double>::infinity())34 {35 // Default value of bubbles is true by the Proximity Events spec.36 // http://www.w3.org/TR/proximity/#deviceproximityevent-interface37 bubbles = true;38 };39 40 double value;41 double min;42 double max;43 };44 45 29 class DeviceProximityEvent : public Event { 46 30 public: … … 57 41 } 58 42 59 static Ref<DeviceProximityEvent> create(const AtomicString& type, const DeviceProximityEventInit& initializer) 43 struct Init : EventInit { 44 Optional<double> value; 45 Optional<double> min; 46 Optional<double> max; 47 }; 48 49 static Ref<DeviceProximityEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) 60 50 { 61 return adoptRef(*new DeviceProximityEvent(type, initializer ));51 return adoptRef(*new DeviceProximityEvent(type, initializer, isTrusted)); 62 52 } 63 53 … … 71 61 DeviceProximityEvent(); 72 62 DeviceProximityEvent(const AtomicString& eventType, const double value, const double min, const double max); 73 DeviceProximityEvent(const AtomicString& eventType, const DeviceProximityEventInit&);63 DeviceProximityEvent(const AtomicString& eventType, const Init&, IsTrusted); 74 64 75 65 double m_value; -
trunk/Source/WebCore/Modules/proximity/DeviceProximityEvent.idl
r168302 r207187 20 20 [ 21 21 Conditional=PROXIMITY_EVENTS, 22 Constructor Template=Event,22 Constructor(DOMString type, optional DeviceProximityEventInit eventInitDict), 23 23 ] interface DeviceProximityEvent : Event { 24 [InitializedByEventConstructor]readonly attribute unrestricted double value;25 [InitializedByEventConstructor]readonly attribute unrestricted double min;26 [InitializedByEventConstructor]readonly attribute unrestricted double max;24 readonly attribute unrestricted double value; 25 readonly attribute unrestricted double min; 26 readonly attribute unrestricted double max; 27 27 }; 28 28 29 dictionary DeviceProximityEventInit : EventInit { 30 double value; 31 double min; 32 double max; 33 };
Note: See TracChangeset
for help on using the changeset viewer.