backout 3e9a4e14f6c6 - bustage fix

This commit is contained in:
Wes Johnston 2011-06-10 10:28:18 -07:00
parent 1a8c41e26f
commit b18d1b9713
5 changed files with 8 additions and 18 deletions

View File

@ -162,7 +162,7 @@ let Util = {
},
isTablet: function isTablet() {
let dpi = this.displayDPI;
let dpi = Util.getWindowUtils(window).displayDPI;
if (dpi <= 96)
return (window.innerWidth > 1024);
@ -188,12 +188,6 @@ let Util = {
return ViewableAreaObserver.isKeyboardOpened;
return (sendSyncMessage("Content:IsKeyboardOpened", {}))[0];
},
// because this uses the global window, will only work in the parent process
get displayDPI() function() {
delete this.displayDPI;
return this.displayDPI = this.getWindowUtils(window).displayDPI;
}
};

View File

@ -364,7 +364,7 @@ var BrowserUI = {
return true;
case -1: {
let threshold = Services.prefs.getIntPref("widget.ime.android.fullscreen_threshold");
let dpi = Util.displayDPI;
let dpi = Util.getWindowUtils(window).displayDPI;
return (window.innerHeight * 100 < threshold * dpi);
}
}

View File

@ -1112,7 +1112,7 @@ var Browser = {
if (prefValue > 0)
return prefValue / 100;
let dpi = Utils.displayDPI;
let dpi = this.windowUtils.displayDPI;
if (dpi < 200) // Includes desktop displays, and LDPI and MDPI Android devices
return 1;
else if (dpi < 300) // Includes Nokia N900, and HDPI Android devices
@ -1809,7 +1809,7 @@ const ContentTouchHandler = {
panningPrevented: false,
updateCanCancel: function(aX, aY) {
let dpi = Utils.displayDPI;
let dpi = Browser.windowUtils.displayDPI;
const kSafetyX = Services.prefs.getIntPref("dom.w3c_touch_events.safetyX") / 240 * dpi;
const kSafetyY = Services.prefs.getIntPref("dom.w3c_touch_events.safetyY") / 240 * dpi;

View File

@ -68,11 +68,7 @@ const ElementTouchHelper = {
/* Retrieve the closest element to a point by looking at borders position */
getClosest: function getClosest(aWindowUtils, aX, aY) {
// cached for the child process, since Utils.displayDPI is only available in the parent
if (!this.dpiRatio)
this.dpiRatio = aWindowUtils.displayDPI / kReferenceDpi;
let dpiRatio = this.dpiRatio;
let dpiRatio = aWindowUtils.displayDPI / kReferenceDpi;
let target = aWindowUtils.elementFromPoint(aX, aY,
true, /* ignore root scroll frame*/

View File

@ -118,7 +118,7 @@ function MouseModule() {
this._mouseOverTimeout = new Util.Timeout(this._doMouseOver.bind(this));
this._longClickTimeout = new Util.Timeout(this._doLongClick.bind(this));
this._doubleClickRadius = Util.displayDPI * kDoubleClickRadius;
this._doubleClickRadius = Util.getWindowUtils(window).displayDPI * kDoubleClickRadius;
window.addEventListener("mousedown", this, true);
window.addEventListener("mouseup", this, true);
@ -570,7 +570,7 @@ MouseModule.prototype = {
var ScrollUtils = {
// threshold in pixels for sensing a tap as opposed to a pan
get tapRadius() {
let dpi = Util.displayDPI;
let dpi = Util.getWindowUtils(window).displayDPI;
delete this.tapRadius;
return this.tapRadius = Services.prefs.getIntPref("ui.dragThresholdX") / 240 * dpi;
@ -686,7 +686,7 @@ var ScrollUtils = {
*/
function DragData() {
this._domUtils = Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
this._lockRevertThreshold = Util.displayDPI * kAxisLockRevertThreshold;
this._lockRevertThreshold = Util.getWindowUtils(window).displayDPI * kAxisLockRevertThreshold;
this.reset();
};