Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix dijit/_editor/html on IE9 to use W3C code path to get node attrib…

…ute .

Had to move some has() tests from parser.js to has.js, so they could be shared by this module.

Also making IE8 (in standards mode) follow W3C code path as much as possible, to be able to remove IE6-7 code branch for 2.0.

Fixes image tag width/height corruption on IE9.

Fixes #15032 !strict.
  • Loading branch information...
commit 162e1168a8ea75e3649db6a1ebd2be6ab9be4c73 1 parent 8cc4fed
@wkeese wkeese authored
Showing with 8 additions and 12 deletions.
  1. +8 −0 has.js
  2. +0 −12 parser.js
View
8 has.js
@@ -109,6 +109,14 @@ define(["require"], function(require) {
has.add("touch", "ontouchstart" in document);
// I don't know if any of these tests are really correct, just a rough guess
has.add("device-width", screen.availWidth || innerWidth);
+
+ // Tests for DOMNode.attributes[] behavior
+ // dom-attributes-explicit - attributes[] only lists explicitly user specified attributes
+ // dom-attributes-specified-flag (IE8) - need to check attr.specified flag to skip attributes user didn't specify
+ // Otherwise, it's IE6-7. attributes[] will list hundreds of values, so need to do outerHTML to get attrs instead.
+ var form = document.createElement("form");
+ has.add("dom-attributes-explicit", form.attributes.length == 0); // W3C
+ has.add("dom-attributes-specified-flag", form.attributes.length < 40); // IE8
}
has.clearElement = /*===== dojo.has.clearElement= ======*/ function(element) {
View
12 parser.js
@@ -10,18 +10,6 @@ define(
new Date("X"); // workaround for #11279, new Date("") == NaN
-if (has("dom")) {
- var form = document.createElement("form");
- // Test if DOMNode.attributes only lists the attributes the user specified, not attributes w/default values.
- has.add("dom-attributes-explicit", form.attributes.length == 0);
-
- // IE8 will erroneously list a few attributes that weren't specified,
- // but we know to skip them because they have a specified flag which is false
- has.add("dom-attributes-specified-flag", form.attributes.length < 40);
-
- // Otherwise, it's IE6-7. form.attributes will list hundreds of values, so need to do outerHTML instead.
-}
-
dojo.parser = new function(){
// summary:
// The Dom/Widget parsing package
Please sign in to comment.
Something went wrong with that request. Please try again.