From e8f1709adfd79bd8a9dd1e99b240edd39fd91d11 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 26 Oct 2020 16:09:07 +0200 Subject: [PATCH] Drop Legacy Edge support. This allows us to move forward without being held back. Microsoft already replaces the Legacy Edge with the new one on supported Windows versions. --- .browserslistrc | 4 +- js/src/dom/event-handler.js | 7 --- js/src/dom/polyfill.js | 17 +------ js/tests/browsers.js | 7 --- scss/_reboot.scss | 16 +------ scss/forms/_floating-labels.scss | 22 --------- scss/forms/_form-range.scss | 45 ------------------- scss/forms/_form-select.scss | 10 ----- site/assets/scss/_component-examples.scss | 1 - .../content/docs/5.0/forms/floating-labels.md | 2 - .../5.0/getting-started/browsers-devices.md | 2 +- site/content/docs/5.0/migration.md | 4 ++ site/layouts/_default/examples.html | 1 - 13 files changed, 11 insertions(+), 127 deletions(-) diff --git a/.browserslistrc b/.browserslistrc index c17ce9049c..122986c8eb 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -5,7 +5,9 @@ last 1 major version not dead Chrome >= 60 Firefox >= 60 -Edge >= 16 +# needed since Legacy Edge still has usage; 79 was the first Chromium Edge version +# should be removed in the future when its usage drops or when it's moved to dead browsers +not Edge < 79 iOS >= 10 Safari >= 10 Android >= 6 diff --git a/js/src/dom/event-handler.js b/js/src/dom/event-handler.js index 1d109c57ec..c228e21ba1 100644 --- a/js/src/dom/event-handler.js +++ b/js/src/dom/event-handler.js @@ -6,7 +6,6 @@ */ import { getjQuery } from '../util/index' -import { defaultPreventedPreservedOnDispatch } from './polyfill' /** * ------------------------------------------------------------------------ @@ -314,12 +313,6 @@ const EventHandler = { if (defaultPrevented) { evt.preventDefault() - - if (!defaultPreventedPreservedOnDispatch) { - Object.defineProperty(evt, 'defaultPrevented', { - get: () => true - }) - } } if (nativeDispatch) { diff --git a/js/src/dom/polyfill.js b/js/src/dom/polyfill.js index ed982587b6..c5318a1300 100644 --- a/js/src/dom/polyfill.js +++ b/js/src/dom/polyfill.js @@ -10,20 +10,6 @@ import { getUID } from '../util/index' let find = Element.prototype.querySelectorAll let findOne = Element.prototype.querySelector -// MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached -const defaultPreventedPreservedOnDispatch = (() => { - const e = new CustomEvent('Bootstrap', { - cancelable: true - }) - - const element = document.createElement('div') - element.addEventListener('Bootstrap', () => null) - - e.preventDefault() - element.dispatchEvent(e) - return e.defaultPrevented -})() - const scopeSelectorRegex = /:scope\b/ const supportsScopeQuery = (() => { const element = document.createElement('div') @@ -75,6 +61,5 @@ if (!supportsScopeQuery) { export { find, - findOne, - defaultPreventedPreservedOnDispatch + findOne } diff --git a/js/tests/browsers.js b/js/tests/browsers.js index 68c26a19e9..828edfe079 100644 --- a/js/tests/browsers.js +++ b/js/tests/browsers.js @@ -23,13 +23,6 @@ const browsers = { browser: 'Firefox', browser_version: 'latest' }, - edgeWin10: { - base: 'BrowserStack', - os: 'Windows', - os_version: '10', - browser: 'Edge', - browser_version: '16' - }, chromeWin10: { base: 'BrowserStack', os: 'Windows', diff --git a/scss/_reboot.scss b/scss/_reboot.scss index 35d5bbd992..2d70e533a4 100644 --- a/scss/_reboot.scss +++ b/scss/_reboot.scss @@ -295,8 +295,6 @@ samp { // 1. Remove browser default top margin // 2. Reset browser default of `1em` to use `rem`s // 3. Don't allow content to break outside -// 4. Disable auto-hiding scrollbar in legacy Edge to avoid overlap, -// making it impossible to interact with the content pre { display: block; @@ -305,7 +303,6 @@ pre { overflow: auto; // 3 @include font-size($code-font-size); color: $pre-color; - -ms-overflow-style: scrollbar; // 4 // Account for some code outputs that place code tags in pre tags code { @@ -434,13 +431,6 @@ textarea { line-height: inherit; } -// Show the overflow in Edge - -button, -input { - overflow: visible; -} - // Remove the inheritance of text transform in Firefox button, @@ -516,8 +506,7 @@ fieldset { // 1. By using `float: left`, the legend will behave like a block element. // This way the border of a fieldset wraps around the legend if present. -// 2. Correct the text wrapping in Edge. -// 3. Fix wrapping bug. +// 2. Fix wrapping bug. // See https://github.com/twbs/bootstrap/issues/29712 legend { @@ -528,10 +517,9 @@ legend { @include font-size($legend-font-size); font-weight: $legend-font-weight; line-height: inherit; - white-space: normal; // 2 + * { - clear: left; // 3 + clear: left; // 2 } } diff --git a/scss/forms/_floating-labels.scss b/scss/forms/_floating-labels.scss index b35f1c3bdc..42e56f27b3 100644 --- a/scss/forms/_floating-labels.scss +++ b/scss/forms/_floating-labels.scss @@ -61,25 +61,3 @@ } // stylelint-enable no-duplicate-selectors } - - -// -// Fallback for classic Edge -// - -@supports (-ms-ime-align: auto) { - .form-floating { - display: flex; - flex-direction: column-reverse; - } - .form-floating > label { - position: static; - padding: 0; - margin-bottom: calc(#{$form-floating-padding-y} / 2); // stylelint-disable-line function-disallowed-list - border: 0; - @include transition(none); - } - .form-floating > .form-control::-ms-input-placeholder { - color: $input-placeholder-color; - } -} diff --git a/scss/forms/_form-range.scss b/scss/forms/_form-range.scss index 6cf90138d3..b603a7bc35 100644 --- a/scss/forms/_form-range.scss +++ b/scss/forms/_form-range.scss @@ -18,7 +18,6 @@ // No box-shadow() mixin for focus accessibility. &::-webkit-slider-thumb { box-shadow: $form-range-thumb-focus-box-shadow; } &::-moz-range-thumb { box-shadow: $form-range-thumb-focus-box-shadow; } - &::-ms-thumb { box-shadow: $form-range-thumb-focus-box-shadow; } } &::-moz-focus-outer { @@ -78,46 +77,6 @@ @include box-shadow($form-range-track-box-shadow); } - &::-ms-thumb { - width: $form-range-thumb-width; - height: $form-range-thumb-height; - margin-top: 0; // Edge specific - margin-right: $form-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden. - margin-left: $form-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden. - @include gradient-bg($form-range-thumb-bg); - border: $form-range-thumb-border; - @include border-radius($form-range-thumb-border-radius); - @include box-shadow($form-range-thumb-box-shadow); - @include transition($form-range-thumb-transition); - appearance: none; - - &:active { - @include gradient-bg($form-range-thumb-active-bg); - } - } - - &::-ms-track { - width: $form-range-track-width; - height: $form-range-track-height; - color: transparent; - cursor: $form-range-track-cursor; - background-color: transparent; - border-color: transparent; - border-width: $form-range-thumb-height / 2; - @include box-shadow($form-range-track-box-shadow); - } - - &::-ms-fill-lower { - background-color: $form-range-track-bg; - @include border-radius($form-range-track-border-radius); - } - - &::-ms-fill-upper { - margin-right: 15px; // arbitrary? - background-color: $form-range-track-bg; - @include border-radius($form-range-track-border-radius); - } - &:disabled { pointer-events: none; @@ -128,9 +87,5 @@ &::-moz-range-thumb { background-color: $form-range-thumb-disabled-bg; } - - &::-ms-thumb { - background-color: $form-range-thumb-disabled-bg; - } } } diff --git a/scss/forms/_form-select.scss b/scss/forms/_form-select.scss index 6ebe33e102..1866da9647 100644 --- a/scss/forms/_form-select.scss +++ b/scss/forms/_form-select.scss @@ -32,16 +32,6 @@ // Avoid using mixin so we can pass custom focus shadow properly box-shadow: $form-select-focus-box-shadow; } - - &::-ms-value { - // For visual consistency with other platforms/browsers, - // suppress the default white text on blue background highlight given to - // the selected option text when the (still closed) ` and `