Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Remove references to X11 from closure userAgent
Browse files Browse the repository at this point in the history
RELNOTES[INC]: Remove X11 references from goog.userAgent

PiperOrigin-RevId: 577272544
Change-Id: Ie721bc14089ebdf7040b44301d671406cd0099f6
  • Loading branch information
concavelenz authored and copybara-github committed Oct 27, 2023
1 parent 24037a6 commit b1c4e07
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 45 deletions.
8 changes: 2 additions & 6 deletions closure/goog/positioning/positioning_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,10 @@ let testArea;

/** This is used to round pixel values on FF3 Mac. */
function assertRoundedEquals(a, b, c) {
function round(x) {
return userAgent.GECKO && (userAgent.MAC || userAgent.X11) ? Math.round(x) :
x;
}
if (arguments.length == 3) {
assertRoughlyEquals(a, round(b), round(c), ALLOWED_OFFSET);
assertRoughlyEquals(a, b, c, ALLOWED_OFFSET);
} else {
assertRoughlyEquals(round(a), round(b), ALLOWED_OFFSET);
assertRoughlyEquals(a, b, ALLOWED_OFFSET);
}
}

Expand Down
9 changes: 2 additions & 7 deletions closure/goog/ui/popup_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ const Corner = goog.require('goog.positioning.Corner');
const Popup = goog.require('goog.ui.Popup');
const style = goog.require('goog.style');
const testSuite = goog.require('goog.testing.testSuite');
const userAgent = goog.require('goog.userAgent');

/** This is used to round pixel values on FF3 Mac. */
function assertRoundedEquals(a, b, c) {
function round(x) {
return userAgent.GECKO && (userAgent.MAC || userAgent.X11) ? Math.round(x) :
x;
}
if (arguments.length == 3) {
assertEquals(a, round(b), round(c));
assertEquals(a, b, c);
} else {
assertEquals(round(a), round(b));
assertEquals(a, b);
}
}

Expand Down
33 changes: 2 additions & 31 deletions closure/goog/useragent/useragent.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,6 @@ goog.userAgent.ASSUME_WINDOWS =
goog.userAgent.ASSUME_LINUX = goog.define('goog.userAgent.ASSUME_LINUX', false);


/**
* @define {boolean} Whether the user agent is running on a X11 windowing
* system.
*/
goog.userAgent.ASSUME_X11 = goog.define('goog.userAgent.ASSUME_X11', false);


/**
* @define {boolean} Whether the user agent is running on Android.
*/
Expand Down Expand Up @@ -297,9 +290,8 @@ goog.userAgent.ASSUME_KAIOS = goog.define('goog.userAgent.ASSUME_KAIOS', false);
*/
goog.userAgent.PLATFORM_KNOWN_ = goog.userAgent.ASSUME_MAC ||
goog.userAgent.ASSUME_WINDOWS || goog.userAgent.ASSUME_LINUX ||
goog.userAgent.ASSUME_X11 || goog.userAgent.ASSUME_ANDROID ||
goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD ||
goog.userAgent.ASSUME_IPOD;
goog.userAgent.ASSUME_ANDROID || goog.userAgent.ASSUME_IPHONE ||
goog.userAgent.ASSUME_IPAD || goog.userAgent.ASSUME_IPOD;


/**
Expand Down Expand Up @@ -348,27 +340,6 @@ goog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ?
goog.userAgent.isLegacyLinux_();


/**
* @return {boolean} Whether the user agent is an X11 windowing system.
* @private
*/
goog.userAgent.isX11_ = function() {
'use strict';
var navigator = goog.userAgent.getNavigatorTyped();
return !!navigator &&
goog.string.internal.contains(navigator['appVersion'] || '', 'X11');
};


/**
* Whether the user agent is running on a X11 windowing system.
* @type {boolean}
*/
goog.userAgent.X11 = goog.userAgent.PLATFORM_KNOWN_ ?
goog.userAgent.ASSUME_X11 :
goog.userAgent.isX11_();


/**
* Whether the user agent is running on Android.
* @type {boolean}
Expand Down
1 change: 0 additions & 1 deletion closure/goog/useragent/useragenttestutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ goog.userAgentTestUtil.reinitializeUserAgent = function() {
goog.userAgent.MAC = goog.labs.userAgent.platform.isMacintosh();
goog.userAgent.WINDOWS = goog.labs.userAgent.platform.isWindows();
goog.userAgent.LINUX = goog.userAgent.isLegacyLinux_();
goog.userAgent.X11 = goog.userAgent.isX11_();
goog.userAgent.ANDROID = goog.labs.userAgent.platform.isAndroid();
goog.userAgent.IPAD = goog.labs.userAgent.platform.isIpad();
goog.userAgent.IPHONE = goog.labs.userAgent.platform.isIphone();
Expand Down

0 comments on commit b1c4e07

Please sign in to comment.