Skip to content

Commit

Permalink
Remove microagressive language (Modernizr#2579)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferndot authored Jun 29, 2020
1 parent d31f4a0 commit b621ace
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions feature-detects/css/fontface.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
}
!*/
define(['Modernizr', 'testStyles'], function(Modernizr, testStyles) {
var blacklist = (function() {
var unsupportedUserAgent = (function() {
var ua = navigator.userAgent;
var webos = ua.match(/w(eb)?osbrowser/gi);
var wppre8 = ua.match(/windows phone/gi) && ua.match(/iemobile\/([0-9])+/gi) && parseFloat(RegExp.$1) >= 9;
return webos || wppre8;
}());
if (blacklist) {
if (unsupportedUserAgent) {
Modernizr.addTest('fontface', false);
} else {
testStyles('@font-face {font-family:"font";src:url("https://")}', function(node, rule) {
Expand Down
22 changes: 11 additions & 11 deletions feature-detects/css/hyphens.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,33 +136,33 @@ define(['Modernizr', 'prefixes', 'createElement', 'testAllProps', 'addTest'], fu
// testing if in-browser Find functionality will work on hyphenated text
function test_hyphens_find(delimiter) {
try {
/* create a dummy input for resetting selection location, and a div container
/* create a sample input for resetting selection location, and a div container
* these have to be appended to document.body, otherwise some browsers can give false negative
* div container gets the doubled testword, separated by the delimiter
* Note: giving a width to div gives false positive in iOS Safari */
var dummy = createElement('input');
var sampleInput = createElement('input');
var div = createElement('div');
var testword = 'lebowski';
var result = false;
var textrange;
var firstChild = document.body.firstElementChild || document.body.firstChild;

/* Make the elements fixed to prevent that the browser's viewport will jump to the top */
dummy.style.cssText = 'position:fixed;top:0;';
sampleInput.style.cssText = 'position:fixed;top:0;';
div.style.cssText = 'position:fixed;top:0;';

div.innerHTML = testword + delimiter + testword;

document.body.insertBefore(div, firstChild);
document.body.insertBefore(dummy, div);
document.body.insertBefore(sampleInput, div);

/* reset the selection to the dummy input element, i.e. BEFORE the div container
/* reset the selection to the sample input element, i.e. BEFORE the div container
* stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area */
if (dummy.setSelectionRange) {
dummy.focus();
dummy.setSelectionRange(0, 0);
} else if (dummy.createTextRange) {
textrange = dummy.createTextRange();
if (sampleInput.setSelectionRange) {
sampleInput.focus();
sampleInput.setSelectionRange(0, 0);
} else if (sampleInput.createTextRange) {
textrange = sampleInput.createTextRange();
textrange.collapse(true);
textrange.moveEnd('character', 0);
textrange.moveStart('character', 0);
Expand All @@ -182,7 +182,7 @@ define(['Modernizr', 'prefixes', 'createElement', 'testAllProps', 'addTest'], fu
}

document.body.removeChild(div);
document.body.removeChild(dummy);
document.body.removeChild(sampleInput);

return result;
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion feature-detects/css/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
!*/
define(['Modernizr', 'testAllProps'], function(Modernizr, testAllProps) {
Modernizr.addTest('csstransforms', function() {
// Android < 3.0 is buggy, so we sniff and blacklist
// Android < 3.0 is buggy, so we sniff and reject it
// https://github.com/Modernizr/Modernizr/issues/903
return navigator.userAgent.indexOf('Android 2.') === -1 &&
testAllProps('transform', 'scale(1)', true);
Expand Down
2 changes: 1 addition & 1 deletion feature-detects/url/data-uri.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define(['Modernizr'], function(Modernizr) {
Modernizr.addAsyncTest(function() {

// IE7 throw a mixed content warning on HTTPS for this test, so we'll
// just blacklist it (we know it doesn't support data URIs anyway)
// just reject it (we know it doesn't support data URIs anyway)
// https://github.com/Modernizr/Modernizr/issues/362
if (navigator.userAgent.indexOf('MSIE 7.') !== -1) {
// Keep the test async
Expand Down
1 change: 0 additions & 1 deletion src/ModernizrProto.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ define(['tests'], function(tests) {
* @access public
*/
var ModernizrProto = {
// The current version, dummy
_version: '__VERSION__',

// Any settings that don't work as separate modules
Expand Down

0 comments on commit b621ace

Please sign in to comment.