Fixed bug #10843: htmlArea RTE: IE7 complains when reference is made to attribute...
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 3 Apr 2009 23:12:48 +0000 (23:12 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 3 Apr 2009 23:12:48 +0000 (23:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5275 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/Language/language.js

index 0d78bf6..7ad5276 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        * Fixed issue #10837: htmlARea RTE: IE8 reports unknown "complete" attribute on img nodes
        * Fixed bug #10836: htmlARea RTE: RTE leaves unwanted id attribute on inserted table in IE8
        * Added feature #10842: htmlArea RTE: Let IE8 display language marks like other browsers do
+       * Fixed bug #10843: htmlArea RTE: IE7 complains when reference is made to attribute xml:lang
 
 2009-04-03  Patrick Broens  <patrick@patrickbroens.nl>
 
index 72e79ae..f4f3cb9 100644 (file)
@@ -3,6 +3,7 @@
        * Fixed issue #10837: htmlARea RTE: IE8 reports unknown "complete" attribute on img nodes
        * Fixed bug #10836: htmlARea RTE: RTE leaves unwanted id attribute on inserted table in IE8
        * Added feature #10842: htmlArea RTE: Let IE8 display language marks like other browsers do
+       * Fixed bug #10843: htmlArea RTE: IE7 complains when reference is made to attribute xml:lang
 
 2009-04-02  Stanislas Rolland  <typo3@sjbr.ca>
 
index 1ec72c9..86543ab 100644 (file)
@@ -286,7 +286,12 @@ Language = HTMLArea.Plugin.extend({
         * @return      string          value of the lang attribute, or of the xml:lang attribute
         */
        getLanguageAttribute : function (element) {
-               return element.getAttribute("lang") ? element.getAttribute("lang") : (element.getAttribute("xml:lang") ? element.getAttribute("xml:lang") : "none");
+               var xmllang = "none";
+               try {
+                               // IE7 complains about xml:lang
+                       xmllang = element.getAttribute("xml:lang") ? element.getAttribute("xml:lang") : "none";
+               } catch(e) { }
+               return element.getAttribute("lang") ? element.getAttribute("lang") : xmllang;
        },
        
        /*
@@ -301,7 +306,10 @@ Language = HTMLArea.Plugin.extend({
                if (language == "none") {
                                // Remove language mark, if any
                        element.removeAttribute("lang");
-                       element.removeAttribute("xml:lang");
+                       try {
+                                       // Do not let IE7 complain
+                               element.removeAttribute("xml:lang");
+                       } catch(e) { }
                                // Remove the span tag if it has no more attribute
                        if ((element.nodeName.toLowerCase() == "span") && !HTMLArea.hasAllowedAttributes(element, this.allowedAttributes)) {
                                this.editor.removeMarkup(element);
@@ -311,7 +319,10 @@ Language = HTMLArea.Plugin.extend({
                                element.setAttribute("lang", language);
                        }
                        if (this.useAttribute.xmlLang) {
-                               element.setAttribute("xml:lang", language);
+                               try {
+                                               // Do not let IE7 complain
+                                       element.setAttribute("xml:lang", language);
+                               } catch(e) { }
                        }
                }
        },