Permalink
Browse files

Merge pull request #2628 from etiennesegonzac/afterpaint-cleanup

Adding the MozAfterPaint activation to the gaia profile.
  • Loading branch information...
2 parents 761ad29 + 6b5e038 commit 8b71e8fec038b91d3484c8a023e3ea5e9a8a6956 @vingtetun vingtetun committed Jul 20, 2012
Showing with 8 additions and 40 deletions.
  1. +3 −20 apps/dialer/js/oncall.js
  2. +2 −20 apps/system/js/attention_screen.js
  3. +3 −0 build/preferences.js
View
@@ -316,20 +316,11 @@ var OnCallHandler = {
CallScreen.screen.classList.toggle('prerender');
var displayed = this._displayed;
- // hardening against the unavailability of MozAfterPaint
- var finished = false;
+ this._displayed = !this._displayed;
var self = this;
- var finishTransition = function ch_finishTransition() {
- if (finished)
- return;
-
- if (securityTimeout) {
- clearTimeout(securityTimeout);
- securityTimeout = null;
- }
-
- finished = true;
+ window.addEventListener('MozAfterPaint', function ch_finishAfterPaint() {
+ window.removeEventListener('MozAfterPaint', ch_finishAfterPaint);
window.setTimeout(function cs_transitionNextLoop() {
CallScreen.screen.classList.add('animate');
@@ -345,15 +336,7 @@ var OnCallHandler = {
window.close();
});
});
- };
-
- window.addEventListener('MozAfterPaint', function ch_finishAfterPaint() {
- window.removeEventListener('MozAfterPaint', ch_finishAfterPaint);
- finishTransition();
});
- var securityTimeout = window.setTimeout(finishTransition, 100);
-
- this._displayed = !this._displayed;
},
toggleMute: function ch_toggleMute() {
@@ -95,33 +95,15 @@ var AttentionScreen = {
this.attentionScreen.style.MozTransition = 'none';
this.attentionScreen.classList.remove('status-mode');
- // hardening against the unavailability of MozAfterPaint
- var finished = false;
-
var self = this;
- var finishTransition = function ch_finishTransition() {
- if (finished)
- return;
-
- if (securityTimeout) {
- clearTimeout(securityTimeout);
- securityTimeout = null;
- }
-
- finished = true;
-
+ window.addEventListener('MozAfterPaint', function finishAfterPaint() {
+ window.removeEventListener('MozAfterPaint', finishAfterPaint);
setTimeout(function nextLoop() {
self.attentionScreen.style.MozTransition = '';
self.mainScreen.classList.remove('active-statusbar');
self.dispatchEvent('status-inactive');
});
- };
-
- window.addEventListener('MozAfterPaint', function finishAfterPaint() {
- window.removeEventListener('MozAfterPaint', finishAfterPaint);
- finishTransition();
});
- var securityTimeout = window.setTimeout(finishTransition, 100);
},
hide: function as_hide(evt) {
View
@@ -161,6 +161,9 @@ appSrcDirs.forEach(function parseDirectory(directoryName) {
//XXX: only here while waiting for https://bugzilla.mozilla.org/show_bug.cgi?id=764718 to be fixed
content += "user_pref(\"dom.allow_scripts_to_close_windows\", true);\n\n";
+
+// Probably wont be needed when https://bugzilla.mozilla.org/show_bug.cgi?id=768440 lands
+content += "user_pref(\"dom.send_after_paint_to_content\", true);\n\n";
content += "user_pref(\"b2g.privileged.domains\", \"" + privileges.join(",") + "\");\n\n";
if (LOCAL_DOMAINS) {

0 comments on commit 8b71e8f

Please sign in to comment.