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

Removing IE9 and IE10 support #368

Merged
merged 7 commits into from
Apr 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions karma-saucelabs.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@ module.exports = function(config) {
base: 'SauceLabs',
browserName: 'firefox',
},
sl_ie_9: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '9',
},
sl_ie_10: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '10',
},
sl_ie_11: {
base: 'SauceLabs',
browserName: 'internet explorer',
Expand All @@ -63,9 +51,10 @@ module.exports = function(config) {
if (!sauceLabsAccessKey) {
sauceLabsAccessKey = process.env.SAUCE_ACCESS_KEY_ENC;
if (sauceLabsAccessKey) {
sauceLabsAccessKey = new Buffer(sauceLabsAccessKey, 'base64').toString(
'binary'
);
sauceLabsAccessKey = new Buffer(
sauceLabsAccessKey,
'base64'
).toString('binary');
}
}

Expand Down
35 changes: 20 additions & 15 deletions packages/metal-dom/src/domNamed.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ function addClassesWithNative_(element, classes) {
}

/**
* Adds the requested CSS classes to an element without using classList.
* IE11 doesn't support Element.classList.add function, this method
* adds the requested CSS classes to an element without using classList.
* @param {!Element} element The element to add CSS classes to.
* @param {string} classes CSS classes to add.
* @private
Expand Down Expand Up @@ -152,7 +153,8 @@ function attachDelegateEvent_(element, eventName) {
}

/**
* Gets the closest element up the tree from the given element (including
* IE11 doesn't support Element.closest function, this method
* gets the closest element up the tree from the given element (including
* itself) that matches the specified selector, or null if none match.
* @param {Element} element
* @param {string} selector
Expand All @@ -166,7 +168,8 @@ export function closest(element, selector) {
}

/**
* Appends a child node with text or other nodes to a parent node. If
* IE11 doesn't support Element.classList.add function, this method
* appends a child node with text or other nodes to a parent node. If
* child is a HTML string it will be automatically converted to a document
* fragment before appending it to the parent.
* @param {!Element} parent The node to append nodes to.
Expand Down Expand Up @@ -207,17 +210,13 @@ export function buildFragment(htmlString) {

/**
* Checks if the first element contains the second one.
* @deprecated Use element1.contains(element2) directly instead of this method
* @param {!Element} element1
* @param {!Element} element2
* @return {boolean}
*/
export function contains(element1, element2) {
if (isDocument(element1)) {
// document.contains is not defined on IE9, so call it on documentElement instead.
return element1.documentElement.contains(element2);
} else {
return element1.contains(element2);
}
return element1.contains(element2);
}

/**
Expand Down Expand Up @@ -405,7 +404,8 @@ export function isEmpty(element) {
}

/**
* Check if an element matches a given selector.
* IE11 doesn't support Element.matches function, this method
* check if an element matches a given selector.
* @param {Element} element
* @param {string} selector
* @return {boolean}
Expand Down Expand Up @@ -507,6 +507,7 @@ export function on(element, eventName, callback, capture) {
}

/**
* IE11 doesn't support once event listener option, this method
* Listens to the specified event on the given DOM element once. This
* function normalizes DOM event payloads and functions so they'll work the
* same way on all supported browsers.
Expand Down Expand Up @@ -536,7 +537,8 @@ export function parent(element, selector) {
}

/**
* Inserts a node before first child of the parent. If child is a HTML string
* IE11 doesn't support Element.prepend function, this method
* inserts a node before first child of the parent. If child is a HTML string
* it will be converted to document fragment before prepending it to the parent.
* @param {!Element} parent The node to prepend to.
* @param {!(Element|NodeList|string)} child The thing to prepend to the parent.
Expand Down Expand Up @@ -622,7 +624,8 @@ function removeClassesWithNative_(element, classes) {
}

/**
* Removes the requested CSS classes from an element without using classList.
* IE11 doesn't support Element.classList, this method
* removes the requested CSS classes from an element without using classList.
* @param {!Element} element The element to remove CSS classes from.
* @param {string} classes CSS classes to remove.
* @private
Expand All @@ -641,13 +644,14 @@ function removeClassesWithoutNative_(element, classes) {

/**
* Replaces the first element with the second.
* @deprecated Use element1.parentNode.replaceChild(element2, element1)
* directly instead of this method
* @param {Element} element1
* @param {Element} element2
*/
export function replace(element1, element2) {
if (element1 && element2 && element1 !== element2 && element1.parentNode) {
element1.parentNode.insertBefore(element2, element1);
element1.parentNode.removeChild(element1);
element1.parentNode.replaceChild(element2, element1);
}
}

Expand Down Expand Up @@ -811,7 +815,8 @@ function toggleClassesWithNative_(element, classes) {
}

/**
* Adds or removes one or more classes from an element without using classList.
* IE11 doesn't support Element.classList, this method
* adds or removes one or more classes from an element without using classList.
* If any of the classes is present, it will be removed from the element,
* or added otherwise.
* @param {!Element} element The element which classes will be toggled.
Expand Down
4 changes: 2 additions & 2 deletions packages/metal-dom/src/events.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import {isServerSide} from 'metal';
import {registerCustomEvent, contains} from './dom';
import {registerCustomEvent} from './dom';
import features from './features';

/**
Expand All @@ -23,7 +23,7 @@ function registerEvents() {
// eslint-disable-next-line
if (
!related ||
(related !== target && !contains(target, related))
(related !== target && !target.contains(related))
) {
event.customType = eventName;
return callback(event);
Expand Down
2 changes: 1 addition & 1 deletion packages/metal-dom/src/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class features {
}

/**
* Some browsers (like IE9) change the order of element attributes, when html
* Some browsers (like IE11, Edge) change the order of element attributes, when html
* is rendered. This method can be used to check if this behavior happens on
* the current browser.
* @return {boolean}
Expand Down
2 changes: 1 addition & 1 deletion packages/metal/src/coreNamed.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function getFirstTruthy_(a, b) {

/**
* Gets the name of the given function. If the current browser doesn't
* support the `name` property, this will calculate it from the function's
* support the `name` property, like IE11, this will calculate it from the function's
* content string.
* @param {!function()} fn
* @return {string}
Expand Down