Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #969 SynEvent used pageYOffset and pageXOffset on all version of IE. #969

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions src/aria/jsunit/TemplateTestCase.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ Aria.classDefinition({
$destructor : function () { $destructor : function () {
// Free also some memory cleaning the environment // Free also some memory cleaning the environment
this.__cleanEnv(true); this.__cleanEnv(true);
if (this.testDiv) { this.__removeTestDiv();
this.testDiv.parentNode.removeChild(this.testDiv);
this.testDiv = null;
}
if (this.testIframe) { if (this.testIframe) {
this.testIframe.parentNode.removeChild(this.testIframe); this.testIframe.parentNode.removeChild(this.testIframe);
this.testIframe = null; this.testIframe = null;
Expand Down Expand Up @@ -369,10 +366,7 @@ Aria.classDefinition({
this._disposeTestTemplate(); this._disposeTestTemplate();


try { try {
if (this.testDiv) { this.__removeTestDiv();
// null for iframe tests with errors
this.testDiv.style.display = "none";
}
if (this.testIframe) { if (this.testIframe) {
this.testIframe.style.display = "none"; this.testIframe.style.display = "none";
} }
Expand Down Expand Up @@ -923,6 +917,17 @@ Aria.classDefinition({
// Template tests are always asynchronous, but we need to call notifyTemplateTestEnd // Template tests are always asynchronous, but we need to call notifyTemplateTestEnd
this.$logError(this.EXCEPTION_IN_METHOD, methodName, ex); this.$logError(this.EXCEPTION_IN_METHOD, methodName, ex);
this.notifyTemplateTestEnd(); this.notifyTemplateTestEnd();
},

/**
* Remove the testDiv dom element
* @private
*/
__removeTestDiv : function() {
if (this.testDiv) {
this.testDiv.parentNode.removeChild(this.testDiv);
this.testDiv = null;
}
} }
} }
}); });
11 changes: 9 additions & 2 deletions src/aria/utils/SynEvents.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2477,9 +2477,16 @@
if (typeof el.getBoundingClientRect !== "undefined") { if (typeof el.getBoundingClientRect !== "undefined") {
box = el.getBoundingClientRect(); box = el.getBoundingClientRect();
} }
var $window = Aria.$window;
var $document = $window.document;
var o = { var o = {
top: box.top + Aria.$window.pageYOffset - docElem.clientTop, top: box.top +
left: box.left + Aria.$window.pageXOffset - docElem.clientLeft (($window.pageYOffset !== undefined) ? $window.pageYOffset : ($document.documentElement || $document.body.parentNode || $document.body).scrollTop) -
docElem.clientTop,
left:
box.left +
(($window.pageXOffset !== undefined) ? $window.pageXOffset : ($document.documentElement || $document.body.parentNode || $document.body).scrollLeft) -
docElem.clientLeft
}; };
return { return {
pageX: o.left + (el.offsetWidth / 2), pageX: o.left + (el.offsetWidth / 2),
Expand Down