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

Unified Diff: tools/dom/templates/html/impl/impl_WheelEvent.darttemplate

Issue 13567002: Revert "Flipping the direction of WheelEvent.deltaX/Y to follow standards" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate b/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
index 3676dd896e03d9b0f50692d3ebe7f101cd06cf0d..93da12737b89fb857bb4f42dff7ce764a8122475 100644
--- a/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
@@ -22,13 +22,6 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
}
final event = document.$dom_createEvent(eventType);
$if DART2JS
- // If polyfilling, then flip these because we'll flip them back to match
- // the W3C standard:
- // http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY
- if (JS('bool', '#.deltaY === undefined', event)) {
- deltaX = -deltaX;
- deltaY = -deltaY;
- }
if (event._hasInitWheelEvent) {
var modifiers = [];
if (ctrlKey) {
@@ -83,14 +76,6 @@ $endif
$!MEMBERS
$if DART2JS
- /**
- * The amount that is expected to scroll vertically, in units determined by
- * [deltaMode].
- *
- * See also:
- *
- * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
- */
@DomName('WheelEvent.deltaY')
num get deltaY {
if (JS('bool', '#.deltaY !== undefined', this)) {
@@ -98,7 +83,7 @@ $if DART2JS
return this._deltaY;
} else if (JS('bool', '#.wheelDelta !== undefined', this)) {
// Chrome and IE
- return -this._wheelDelta;
+ return this._wheelDelta;
} else if (JS('bool', '#.detail !== undefined', this)) {
// Firefox
@@ -109,9 +94,9 @@ $if DART2JS
// Firefox is normally the number of lines to scale (normally 3)
// so multiply it by 40 to get pixels to move, matching IE & WebKit.
if (detail < 100) {
- return -detail * 40;
+ return detail * 40;
}
- return -detail;
+ return detail;
}
return 0;
}
@@ -119,14 +104,6 @@ $if DART2JS
'deltaY is not supported');
}
- /**
- * The amount that is expected to scroll horizontally, in units determined by
- * [deltaMode].
- *
- * See also:
- *
- * * [WheelEvent.deltaX](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaX) from the W3C.
- */
@DomName('WheelEvent.deltaX')
num get deltaX {
if (JS('bool', '#.deltaX !== undefined', this)) {
@@ -134,7 +111,7 @@ $if DART2JS
return this._deltaX;
} else if (JS('bool', '#.wheelDeltaX !== undefined', this)) {
// Chrome
- return -this._wheelDeltaX;
+ return this._wheelDeltaX;
} else if (JS('bool', '#.detail !== undefined', this)) {
// Firefox and IE.
// IE will have detail set but will not set axis.
@@ -147,9 +124,9 @@ $if DART2JS
// Firefox is normally the number of lines to scale (normally 3)
// so multiply it by 40 to get pixels to move, matching IE & WebKit.
if (detail < 100) {
- return -detail * 40;
+ return detail * 40;
}
- return -detail;
+ return detail;
}
return 0;
}
@@ -216,26 +193,9 @@ $if DART2JS
int deltaMode) native;
$else
- /**
- * The amount that is expected to scroll horizontally, in units determined by
- * [deltaMode].
- *
- * See also:
- *
- * * [WheelEvent.deltaX](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaX) from the W3C.
- */
@DomName('WheelEvent.deltaX')
- num get deltaX => -$dom_wheelDeltaX;
-
- /**
- * The amount that is expected to scroll vertically, in units determined by
- * [deltaMode].
- *
- * See also:
- *
- * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
- */
+ num get deltaX => $dom_wheelDeltaX;
@DomName('WheelEvent.deltaY')
- num get deltaY => -$dom_wheelDeltaY;
+ num get deltaY => $dom_wheelDeltaY;
$endif
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698