From 07c1d13047ecfaf4b16143546d8e998cb3283a8b Mon Sep 17 00:00:00 2001 From: Dhruv Manek Date: Fri, 21 Oct 2011 17:53:37 -0700 Subject: [PATCH 1/3] fix(angular): Allow widgets to be styled in IE8 and below Closes #584 --- src/Angular.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index 9b651fce4a4f..cea78283bcd6 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -51,6 +51,24 @@ if ('i' !== 'I'.toLowerCase()) { function fromCharCode(code) { return String.fromCharCode(code); } +/** + * @ngdoc function + * @name angular.shivForIE + * @function + * + * @description + * Creates the element for IE8 and below to allow styling of widgets + * (http://ejohn.org/blog/html5-shiv/) + * + * @param {string} element Name of the widget. + * @returns {string} Lowercased string. + */ +function shivForIE(element) { + element = lowercase(element); + if (msie < 9 && element.indexOf('@') == -1) + document.createElement(element); + return element; +} var _undefined = undefined, _null = null, @@ -91,7 +109,7 @@ var _undefined = undefined, /** @name angular.directive */ angularDirective = extensionMap(angular, 'directive'), /** @name angular.widget */ - angularWidget = extensionMap(angular, 'widget', lowercase), + angularWidget = extensionMap(angular, 'widget', shivForIE), /** @name angular.filter */ angularFilter = extensionMap(angular, 'filter'), /** @name angular.service */ From 5e8bee65eaf5b84eaec3657be3a8963cbeb18170 Mon Sep 17 00:00:00 2001 From: Dhruv Manek Date: Sat, 22 Oct 2011 16:34:49 -0700 Subject: [PATCH 2/3] fix(angular): Allow widgets to be styled in IE8 and below Closes #584 --- regression/issue-584.html | 24 ++++++++++++++++++++++++ src/Angular.js | 19 ++++++++----------- 2 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 regression/issue-584.html diff --git a/regression/issue-584.html b/regression/issue-584.html new file mode 100644 index 000000000000..84e5e732c356 --- /dev/null +++ b/regression/issue-584.html @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/src/Angular.js b/src/Angular.js index cea78283bcd6..b425bb27dcc0 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -52,22 +52,19 @@ if ('i' !== 'I'.toLowerCase()) { function fromCharCode(code) { return String.fromCharCode(code); } /** - * @ngdoc function - * @name angular.shivForIE - * @function - * - * @description * Creates the element for IE8 and below to allow styling of widgets - * (http://ejohn.org/blog/html5-shiv/) + * (http://ejohn.org/blog/html5-shiv/). This hack works only if angular is + * included synchronously at the top of the document before IE sees any + * unknown elements. See regression/issue-352.html. * * @param {string} element Name of the widget. * @returns {string} Lowercased string. */ -function shivForIE(element) { - element = lowercase(element); - if (msie < 9 && element.indexOf('@') == -1) - document.createElement(element); - return element; +function shivForIE(elementName) { + elementName = lowercase(elementName); + if (msie < 9) + document.createElement(elementName); + return elementName; } var _undefined = undefined, From 425df3899516da836eb402c3049bd915c35d1853 Mon Sep 17 00:00:00 2001 From: Dhruv Manek Date: Mon, 24 Oct 2011 13:31:22 -0700 Subject: [PATCH 3/3] fix(angular): Allow widgets to be styled in IE8 and below Closes #584 --- src/Angular.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Angular.js b/src/Angular.js index b425bb27dcc0..11a25ab5d121 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -55,14 +55,14 @@ function fromCharCode(code) { return String.fromCharCode(code); } * Creates the element for IE8 and below to allow styling of widgets * (http://ejohn.org/blog/html5-shiv/). This hack works only if angular is * included synchronously at the top of the document before IE sees any - * unknown elements. See regression/issue-352.html. + * unknown elements. See regression/issue-584.html. * * @param {string} element Name of the widget. * @returns {string} Lowercased string. */ function shivForIE(elementName) { elementName = lowercase(elementName); - if (msie < 9) + if (msie < 9 && element.indexOf('@') == -1) document.createElement(elementName); return elementName; }