Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5: drop Internet Explorer support #30377

Merged
merged 11 commits into from
Mar 18, 2020
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ not dead
Chrome >= 60
Firefox >= 60
Edge >= 16.16299
Explorer 11
iOS >= 10
Safari >= 10
Android >= 6
not Explorer <= 11
not ExplorerMobile <= 11
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Before opening:

Bug reports must include:

- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile)
- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
- Operating system and version (Windows, macOS, Android, iOS)
- Browser and version (Chrome, Firefox, Safari, Microsoft Edge, Opera, Android Browser)
- [Reduced test case](https://css-tricks.com/reduced-test-cases/) and suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Before opening:

Bug reports must include:

- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile)
- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser)
- Operating system and version (Windows, macOS, Android, iOS)
- Browser and version (Chrome, Firefox, Safari, Microsoft Edge, Opera, Android Browser)
- [Reduced test case](https://css-tricks.com/reduced-test-cases/) and suggested fix using [CodePen](https://codepen.io/) or [JS Bin](https://jsbin.com/)
5 changes: 1 addition & 4 deletions build/vnu-jar.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
'The “month” input type is not supported in all browsers.*',
'The “color” input type is not supported in all browsers.*',
'The “datetime-local” input type is not supported in all browsers.*',
'The “time” input type is not supported in all browsers.*',
// IE11 doesn't recognize <main> / give the element an implicit "main" landmark.
// Explicit role="main" is redundant for other modern browsers, but still valid.
'The “main” role is unnecessary for element “main”.'
'The “time” input type is not supported in all browsers.*'
].join('|')

const args = [
Expand Down
4 changes: 2 additions & 2 deletions js/src/dom/event-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { getjQuery } from '../util/index'
import { createCustomEvent, defaultPreventedPreservedOnDispatch } from './polyfill'
import { defaultPreventedPreservedOnDispatch } from './polyfill'

/**
* ------------------------------------------------------------------------
Expand Down Expand Up @@ -307,7 +307,7 @@ const EventHandler = {
evt = document.createEvent('HTMLEvents')
evt.initEvent(typeEvent, bubbles, true)
} else {
evt = createCustomEvent(event, {
evt = new CustomEvent(event, {
bubbles,
cancelable: true
})
Expand Down
68 changes: 1 addition & 67 deletions js/src/dom/polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,12 @@

import { getUID } from '../util/index'

let { matches, closest } = Element.prototype
let find = Element.prototype.querySelectorAll
let findOne = Element.prototype.querySelector
let createCustomEvent = (eventName, params) => {
const cEvent = new CustomEvent(eventName, params)

return cEvent
}

if (typeof window.CustomEvent !== 'function') {
createCustomEvent = (eventName, params) => {
params = params || { bubbles: false, cancelable: false, detail: null }

const evt = document.createEvent('CustomEvent')

evt.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail)
return evt
}
}

const workingDefaultPrevented = (() => {
const e = document.createEvent('CustomEvent')

e.initEvent('Bootstrap', true, true)
e.preventDefault()
return e.defaultPrevented
})()

if (!workingDefaultPrevented) {
const origPreventDefault = Event.prototype.preventDefault

Event.prototype.preventDefault = function () {
if (!this.cancelable) {
return
}

origPreventDefault.call(this)
Object.defineProperty(this, 'defaultPrevented', {
get() {
return true
},
configurable: true
})
}
}

// MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached
const defaultPreventedPreservedOnDispatch = (() => {
const e = createCustomEvent('Bootstrap', {
const e = new CustomEvent('Bootstrap', {
cancelable: true
})

Expand All @@ -69,26 +26,6 @@ const defaultPreventedPreservedOnDispatch = (() => {
return e.defaultPrevented
})()

if (!matches) {
matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector
}

if (!closest) {
closest = function (selector) {
let element = this

do {
if (matches.call(element, selector)) {
return element
}

element = element.parentElement || element.parentNode
} while (element !== null && element.nodeType === 1)

return null
}
}

const scopeSelectorRegex = /:scope\b/
const supportScopeQuery = (() => {
const element = document.createElement('div')
Expand Down Expand Up @@ -143,10 +80,7 @@ if (!supportScopeQuery) {
}

export {
createCustomEvent,
find,
findOne,
matches,
closest,
defaultPreventedPreservedOnDispatch
}
6 changes: 3 additions & 3 deletions js/src/dom/selector-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* --------------------------------------------------------------------------
*/

import { find as findFn, findOne, matches, closest } from './polyfill'
import { find as findFn, findOne } from './polyfill'
import { makeArray } from '../util/index'

/**
Expand All @@ -18,7 +18,7 @@ const NODE_TEXT = 3

const SelectorEngine = {
matches(element, selector) {
return matches.call(element, selector)
return element.matches(selector)
},

find(selector, element = document.documentElement) {
Expand Down Expand Up @@ -52,7 +52,7 @@ const SelectorEngine = {
},

closest(element, selector) {
return closest.call(element, selector)
return element.closest(selector)
},

prev(element, selector) {
Expand Down
5 changes: 1 addition & 4 deletions js/src/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ const getTransitionDurationFromElement = element => {
}

const triggerTransitionEnd = element => {
const evt = document.createEvent('HTMLEvents')

evt.initEvent(TRANSITION_END, true, true)
element.dispatchEvent(evt)
element.dispatchEvent(new Event(TRANSITION_END))
}

const isElement = obj => (obj[0] || obj).nodeType
Expand Down
7 changes: 0 additions & 7 deletions js/tests/browsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ const browsers = {
browser: 'Edge',
browser_version: 'latest'
},
ie11Win10: {
base: 'BrowserStack',
os: 'Windows',
os_version: '10',
browser: 'IE',
browser_version: '11.0'
},
chromeWin10: {
base: 'BrowserStack',
os: 'Windows',
Expand Down
6 changes: 0 additions & 6 deletions js/tests/unit/modal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,6 @@ describe('Modal', () => {
it('should enforce focus', done => {
fixtureEl.innerHTML = '<div class="modal"><div class="modal-dialog" /></div>'

const isIE11 = Boolean(window.MSInputMethodContext) && Boolean(document.documentMode)
const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl)

Expand All @@ -668,11 +667,6 @@ describe('Modal', () => {
modalEl.addEventListener('shown.bs.modal', () => {
expect(modal._enforceFocus).toHaveBeenCalled()

if (isIE11) {
done()
return
}

spyOn(modal._element, 'focus')

document.addEventListener('focusin', focusInListener)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"js-compile-plugins": "node build/build-plugins.js",
"js-lint": "eslint --cache --cache-location .cache/.eslintcache --report-unused-disable-directives .",
"js-minify": "npm-run-all --parallel js-minify-*",
"js-minify-standalone": "terser --compress typeofs=false --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.js.map,includeSources,url=bootstrap.min.js.map\" --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
"js-minify-standalone": "terser --compress --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.js.map,includeSources,url=bootstrap.min.js.map\" --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
"js-minify-standalone-esm": "terser --compress --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.esm.js.map,includeSources,url=bootstrap.esm.min.js.map\" --output dist/js/bootstrap.esm.min.js dist/js/bootstrap.esm.js",
"js-minify-bundle": "terser --compress typeofs=false --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.bundle.js.map,includeSources,url=bootstrap.bundle.min.js.map\" --output dist/js/bootstrap.bundle.min.js dist/js/bootstrap.bundle.js",
"js-minify-bundle": "terser --compress --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.bundle.js.map,includeSources,url=bootstrap.bundle.min.js.map\" --output dist/js/bootstrap.bundle.min.js dist/js/bootstrap.bundle.js",
"js-test": "npm-run-all --parallel js-test-karma js-test-integration",
"js-debug": "cross-env DEBUG=true karma start js/tests/karma.conf.js",
"js-test-karma": "karma start js/tests/karma.conf.js",
Expand Down
16 changes: 1 addition & 15 deletions scss/_breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,13 @@
padding-left: $breadcrumb-item-padding-x;

&::before {
display: inline-block; // Suppress underlining of the separator in modern browsers
display: inline-block; // Suppress underlining of the separator
padding-right: $breadcrumb-item-padding-x;
color: $breadcrumb-divider-color;
content: escape-svg($breadcrumb-divider);
}
}

// IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built
// without `<ul>`s. The `::before` pseudo-element generates an element
// *within* the .breadcrumb-item and thereby inherits the `text-decoration`.
//
// To trick IE into suppressing the underline, we give the pseudo-element an
// underline and then immediately remove it.
+ .breadcrumb-item:hover::before {
text-decoration: underline;
}
// stylelint-disable-next-line no-duplicate-selectors
+ .breadcrumb-item:hover::before {
text-decoration: none;
}

&.active {
color: $breadcrumb-active-color;
}
Expand Down
4 changes: 0 additions & 4 deletions scss/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
// Enable `flex-grow: 1` for decks and groups so that card blocks take up
// as much space as possible, ensuring footers are aligned to the bottom.
flex: 1 1 auto;
// Workaround for the image size bug in IE
// See: https://github.com/twbs/bootstrap/pull/28855
min-height: 1px;
padding: $card-spacer-y $card-spacer-x;
color: $card-color;
}
Expand Down Expand Up @@ -135,7 +132,6 @@
.card-img,
.card-img-top,
.card-img-bottom {
flex-shrink: 0; // For IE: https://github.com/twbs/bootstrap/issues/29396
width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch
}

Expand Down
34 changes: 0 additions & 34 deletions scss/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,9 @@
}

.modal-dialog-scrollable {
display: flex; // IE10/11
max-height: subtract(100%, $modal-dialog-margin * 2);

.modal-content {
max-height: subtract(100vh, $modal-dialog-margin * 2); // IE10/11
overflow: hidden;
}

Expand All @@ -78,29 +76,6 @@
display: flex;
align-items: center;
min-height: subtract(100%, $modal-dialog-margin * 2);

// Ensure `modal-dialog-centered` extends the full height of the view (IE10/11)
&::before {
display: block; // IE10
height: subtract(100vh, $modal-dialog-margin * 2);
height: min-content; // Reset height to 0 except on IE
content: "";
}

// Ensure `.modal-body` shows scrollbar (IE10/11)
&.modal-dialog-scrollable {
flex-direction: column;
justify-content: center;
height: 100%;

.modal-content {
max-height: none;
}

&::before {
content: none;
}
}
}

// Actual modal
Expand Down Expand Up @@ -206,19 +181,10 @@

.modal-dialog-scrollable {
max-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);

.modal-content {
max-height: subtract(100vh, $modal-dialog-margin-y-sm-up * 2);
}
}

.modal-dialog-centered {
min-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);

&::before {
height: subtract(100vh, $modal-dialog-margin-y-sm-up * 2);
height: min-content;
}
}

.modal-content {
Expand Down
5 changes: 1 addition & 4 deletions scss/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@
// the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
// on the `.navbar` parent.
.navbar-collapse {
flex: 1 0 100%;
// For always expanded or extra full navbars, ensure content aligns itself
// properly vertically. Can be easily overridden with flex utilities.
align-items: center;
width: 100%;
}

// Button for toggling the navbar when in its collapsed state
Expand Down Expand Up @@ -173,9 +173,6 @@

.navbar-collapse {
display: flex !important; // stylelint-disable-line declaration-no-important

// Changes flex-bases to auto because of an IE10 bug
flex-basis: auto;
}

.navbar-toggler {
Expand Down
Loading