Changeset 141318 in webkit
- Timestamp:
- Jan 30, 2013 2:43:57 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r141317 r141318 1 2013-01-30 Kentaro Hara <haraken@chromium.org> 2 3 Implement WheelEvent constructor 4 https://bugs.webkit.org/show_bug.cgi?id=108303 5 6 Reviewed by Adam Barth. 7 8 Editor's draft: https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm 9 10 This patch implements UIEvent constructor under a DOM4_EVENTS_CONSTRUCTOR flag, 11 which is enabled on Chromium and Safari. 12 13 Test: fast/events/constructors/wheel-event-constructor.html 14 15 * fast/events/constructors/wheel-event-constructor-expected.txt: Added. 16 * fast/events/constructors/wheel-event-constructor.html: Added. 17 * platform/efl/TestExpectations: 18 * platform/gtk/TestExpectations: 19 * platform/qt/TestExpectations: 20 * platform/win/TestExpectations: 21 * platform/wincairo/TestExpectations: 22 1 23 2013-01-30 Julien Chaffraix <jchaffraix@webkit.org> 2 24 -
trunk/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt
r141028 r141318 66 66 PASS (new inner.WebKitTransitionEvent()).isInner is true 67 67 PASS (new inner.WebKitTransitionEvent()).constructor.isInner is true 68 PASS (new inner.WheelEvent()).isInner is true 69 PASS (new inner.WheelEvent()).constructor.isInner is true 68 70 PASS (new inner.Worker('foo')).isInner is true 69 71 PASS (new inner.Worker('foo')).constructor.isInner is true -
trunk/LayoutTests/fast/dom/dom-constructors-expected.txt
r140657 r141318 108 108 PASS TryAllocate('StyleSheetList') is 'exception' 109 109 PASS TryAllocate('TextEvent') is 'exception' 110 PASS TryAllocate('WheelEvent') is 'exception'111 110 PASS TryAllocate('XPathResult') is 'exception' 112 111 FAIL TryAllocate('BarInfo') should be exception. Was no constructor. -
trunk/LayoutTests/fast/dom/dom-constructors.html
r140657 r141318 47 47 'NodeFilter', 'NodeList', 'Plugin', 48 48 'PluginArray', 'Range', 'Rect', 'StyleSheet', 'StyleSheetList', 49 'TextEvent', ' WheelEvent', 'XPathResult', 'BarInfo',49 'TextEvent', 'XPathResult', 'BarInfo', 50 50 'CanvasGradient', 'CanvasPattern', 'Console', 'Selection', 51 51 'Window', 'History', 'HTMLOptionsCollection', 'Location', -
trunk/LayoutTests/platform/efl/TestExpectations
r141271 r141318 1232 1232 webkit.org/b/107428 fast/events/constructors/ui-event-constructor.html [ Skip ] 1233 1233 webkit.org/b/107428 fast/events/constructors/mouse-event-constructor.html [ Skip ] 1234 webkit.org/b/107428 fast/events/constructors/wheel-event-constructor.html [ Skip ] 1234 1235 1235 1236 # Requires support for Web notifications -
trunk/LayoutTests/platform/gtk/TestExpectations
r141299 r141318 392 392 webkit.org/b/107428 fast/events/constructors/ui-event-constructor.html [ Skip ] 393 393 webkit.org/b/107428 fast/events/constructors/mouse-event-constructor.html [ Skip ] 394 webkit.org/b/107428 fast/events/constructors/wheel-event-constructor.html [ Skip ] 394 395 395 396 # No CORS support for media elements is implemented yet. -
trunk/LayoutTests/platform/qt/TestExpectations
r141264 r141318 109 109 fast/events/constructors/mouse-event-constructor.html 110 110 fast/events/constructors/composition-event-constructor.html 111 fast/events/constructors/wheel-event-constructor.html 111 112 112 113 # ENABLE(INDEXED_DATABASE) is disabled. -
trunk/LayoutTests/platform/win/TestExpectations
r141251 r141318 1215 1215 fast/events/constructors/mouse-event-constructor.html 1216 1216 fast/events/constructors/composition-event-constructor.html 1217 fast/events/constructors/wheel-event-constructor.html 1217 1218 1218 1219 # Disable until the windows WebKit API supports injecting in the top frame only. -
trunk/LayoutTests/platform/wincairo/TestExpectations
r141028 r141318 1742 1742 fast/events/constructors/mouse-event-constructor.html 1743 1743 fast/events/constructors/composition-event-constructor.html 1744 fast/events/constructors/wheel-event-constructor.html 1744 1745 1745 1746 # Disable until the windows WebKit API supports injecting in the top frame only. -
trunk/Source/WebCore/ChangeLog
r141317 r141318 1 2013-01-30 Kentaro Hara <haraken@chromium.org> 2 3 Implement WheelEvent constructor 4 https://bugs.webkit.org/show_bug.cgi?id=108303 5 6 Reviewed by Adam Barth. 7 8 Editor's draft: https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm 9 10 This patch implements UIEvent constructor under a DOM4_EVENTS_CONSTRUCTOR flag, 11 which is enabled on Chromium and Safari. 12 13 Test: fast/events/constructors/wheel-event-constructor.html 14 15 * dom/WheelEvent.cpp: 16 (WebCore::WheelEventInit::WheelEventInit): 17 (WebCore): 18 (WebCore::WheelEvent::WheelEvent): 19 (WebCore::WheelEvent::initWheelEvent): 20 * dom/WheelEvent.h: 21 (WheelEventInit): 22 (WebCore): 23 (WheelEvent): 24 (WebCore::WheelEvent::create): 25 (WebCore::WheelEvent::wheelDelta): 26 (WebCore::WheelEvent::wheelDeltaX): 27 (WebCore::WheelEvent::wheelDeltaY): 28 (WebCore::WheelEvent::rawDeltaX): 29 (WebCore::WheelEvent::rawDeltaY): 30 (WebCore::WheelEvent::granularity): 31 (WebCore::WheelEvent::webkitDirectionInvertedFromDevice): 32 (WebCore::WheelEvent::isHorizontal): 33 * dom/WheelEvent.idl: 34 1 35 2013-01-30 Julien Chaffraix <jchaffraix@webkit.org> 2 36 -
trunk/Source/WebCore/dom/WheelEvent.cpp
r131826 r141318 32 32 namespace WebCore { 33 33 34 WheelEventInit::WheelEventInit() 35 : wheelDeltaX(0) 36 , wheelDeltaY(0) 37 { 38 } 39 34 40 WheelEvent::WheelEvent() 35 41 : m_granularity(Pixel) 36 42 , m_directionInvertedFromDevice(false) 43 { 44 } 45 46 WheelEvent::WheelEvent(const AtomicString& type, const WheelEventInit& initializer) 47 : MouseEvent(type, initializer) 48 , m_wheelDelta(IntPoint(initializer.wheelDeltaX, initializer.wheelDeltaY)) 37 49 { 38 50 } … … 50 62 #endif 51 63 ctrlKey, altKey, shiftKey, metaKey, 0, 0, 0, false) 52 , m_wheelDelta(IntPoint(static_cast<int>(wheelTicks.x() * tickMultiplier), static_cast<int>(wheelTicks.y() * tickMultiplier)))64 , m_wheelDelta(IntPoint(static_cast<int>(wheelTicks.x() * TickMultiplier), static_cast<int>(wheelTicks.y() * TickMultiplier))) 53 65 , m_rawDelta(roundedIntPoint(rawDelta)) 54 66 , m_granularity(granularity) … … 73 85 74 86 // Normalize to the Windows 120 multiple 75 m_wheelDelta = IntPoint(rawDeltaX * tickMultiplier, rawDeltaY * tickMultiplier);87 m_wheelDelta = IntPoint(rawDeltaX * TickMultiplier, rawDeltaY * TickMultiplier); 76 88 77 89 m_rawDelta = IntPoint(rawDeltaX, rawDeltaY); -
trunk/Source/WebCore/dom/WheelEvent.h
r138674 r141318 31 31 namespace WebCore { 32 32 33 // extension: mouse wheel event 34 class WheelEvent : public MouseEvent { 35 public: 36 enum { tickMultiplier = 120 }; 33 struct WheelEventInit : public MouseEventInit { 34 WheelEventInit(); 37 35 38 enum Granularity { Pixel, Line, Page }; 36 int wheelDeltaX; 37 int wheelDeltaY; 38 }; 39 39 40 static PassRefPtr<WheelEvent> create() 41 { 42 return adoptRef(new WheelEvent); 43 } 44 static PassRefPtr<WheelEvent> create(const FloatPoint& wheelTicks, 45 const FloatPoint& rawDelta, Granularity granularity, PassRefPtr<AbstractView> view, 46 const IntPoint& screenLocation, const IntPoint& pageLocation, 47 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice) 48 { 49 return adoptRef(new WheelEvent(wheelTicks, rawDelta, granularity, view, 50 screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey, directionInvertedFromDevice)); 51 } 40 class WheelEvent : public MouseEvent { 41 public: 42 enum { TickMultiplier = 120 }; 52 43 53 void initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>, 54 int screenX, int screenY, int pageX, int pageY, 55 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); 44 enum Granularity { Pixel, Line, Page }; 56 45 57 void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>, 58 int screenX, int screenY, int pageX, int pageY, 59 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); 46 static PassRefPtr<WheelEvent> create() 47 { 48 return adoptRef(new WheelEvent); 49 } 60 50 61 int wheelDelta() const { return m_wheelDelta.y() ? m_wheelDelta.y() : m_wheelDelta.x(); } 62 int wheelDeltaX() const { return m_wheelDelta.x(); } 63 int wheelDeltaY() const { return m_wheelDelta.y(); } 64 int rawDeltaX() const { return m_rawDelta.x(); } 65 int rawDeltaY() const { return m_rawDelta.y(); } 66 Granularity granularity() const { return m_granularity; } 51 static PassRefPtr<WheelEvent> create(const AtomicString& type, const WheelEventInit& initializer) 52 { 53 return adoptRef(new WheelEvent(type, initializer)); 54 } 67 55 68 bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; } 69 // Needed for Objective-C legacy support 70 bool isHorizontal() const { return m_wheelDelta.x(); } 56 static PassRefPtr<WheelEvent> create(const FloatPoint& wheelTicks, 57 const FloatPoint& rawDelta, Granularity granularity, PassRefPtr<AbstractView> view, 58 const IntPoint& screenLocation, const IntPoint& pageLocation, 59 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice) 60 { 61 return adoptRef(new WheelEvent(wheelTicks, rawDelta, granularity, view, 62 screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey, directionInvertedFromDevice)); 63 } 71 64 72 virtual const AtomicString& interfaceName() const; 73 virtual bool isMouseEvent() const; 65 void initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>, 66 int screenX, int screenY, int pageX, int pageY, 67 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); 74 68 75 private: 76 WheelEvent(); 77 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, 78 Granularity, PassRefPtr<AbstractView>, 79 const IntPoint& screenLocation, const IntPoint& pageLocation, 80 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice); 69 void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>, 70 int screenX, int screenY, int pageX, int pageY, 71 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); 81 72 82 IntPoint m_wheelDelta; 83 IntPoint m_rawDelta; 84 Granularity m_granularity; 85 bool m_directionInvertedFromDevice; 86 }; 73 int wheelDelta() const { return m_wheelDelta.y() ? m_wheelDelta.y() : m_wheelDelta.x(); } 74 int wheelDeltaX() const { return m_wheelDelta.x(); } 75 int wheelDeltaY() const { return m_wheelDelta.y(); } 76 int rawDeltaX() const { return m_rawDelta.x(); } 77 int rawDeltaY() const { return m_rawDelta.y(); } 78 Granularity granularity() const { return m_granularity; } 79 80 bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; } 81 // Needed for Objective-C legacy support 82 bool isHorizontal() const { return m_wheelDelta.x(); } 83 84 virtual const AtomicString& interfaceName() const; 85 virtual bool isMouseEvent() const; 86 87 private: 88 WheelEvent(); 89 WheelEvent(const AtomicString&, const WheelEventInit&); 90 WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, 91 Granularity, PassRefPtr<AbstractView>, 92 const IntPoint& screenLocation, const IntPoint& pageLocation, 93 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice); 94 95 IntPoint m_wheelDelta; 96 IntPoint m_rawDelta; 97 Granularity m_granularity; 98 bool m_directionInvertedFromDevice; 99 }; 87 100 88 101 class WheelEventDispatchMediator : public EventDispatchMediator { -
trunk/Source/WebCore/dom/WheelEvent.idl
r131145 r141318 19 19 */ 20 20 21 // Based off http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-wheelevents 22 interface WheelEvent : MouseEvent 23 { 24 readonly attribute long wheelDelta; 25 readonly attribute long wheelDeltaX; 26 readonly attribute long wheelDeltaY; 21 [ 22 ConstructorConditional=DOM4_EVENTS_CONSTRUCTOR, 23 ConstructorTemplate=Event 24 ] interface WheelEvent : MouseEvent { 25 [InitializedByEventConstructor] readonly attribute long wheelDeltaX; 26 [InitializedByEventConstructor] readonly attribute long wheelDeltaY; 27 28 readonly attribute long wheelDelta; 27 29 28 30 // WebKit Extension -
trunk/Source/WebKit/chromium/ChangeLog
r141302 r141318 1 2013-01-30 Kentaro Hara <haraken@chromium.org> 2 3 Implement WheelEvent constructor 4 https://bugs.webkit.org/show_bug.cgi?id=108303 5 6 Reviewed by Adam Barth. 7 8 This patch just renames an enum value to avoid style check error. 9 10 * src/WebViewImpl.cpp: 11 (WebKit::WebViewImpl::scrollBy): 12 1 13 2013-01-30 Dana Jansens <danakj@chromium.org> 2 14 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r141302 r141318 660 660 if (m_flingSourceDevice == WebGestureEvent::Touchpad) { 661 661 WebMouseWheelEvent syntheticWheel; 662 const float tickDivisor = WebCore::WheelEvent:: tickMultiplier;662 const float tickDivisor = WebCore::WheelEvent::TickMultiplier; 663 663 664 664 syntheticWheel.deltaX = delta.x;
Note: See TracChangeset
for help on using the changeset viewer.