Opened 11 years ago
Closed 11 years ago
#14512 closed defect (fixed)
exception in parser.instantiate() on IE6/IE7 when String.split() modified to work per spec
Reported by: | Martin Repta | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Parser | Version: | 1.7.1 |
Keywords: | parser IE7 | Cc: | |
Blocked By: | Blocking: |
Description
there is a bug in IE7 with Invalid argument
eror message from IE7: Message: Invalid argument. Line: 161 Char: 6 Code: 0
This bug appears when method getAttributeNode(param) is calling. The problem appears when param is an empty string. All major browsers except IE7 will return null, however IE7 throws an error.
Solution is simple, patch file attached.
Attachments (1)
Change History (6)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Here is status after several hours of debugging this: OK you are right code works on MSIE7 fine. We have tested this in combination with libary that fixed String.prototype.split to behave consistently with specification. This code relies on fact that MSIE7 dos not support attributes and "RELIES" incorrectly on fact that " a b".spit returns 2 items. While correct version of split shall return 3 items ["","a","b"] and the code fails.
Actually the check: if(has("dom-attributes-explicit")) is not sufficient and the code could be more robust.
attributes = darray.map(attrs.split(/\s+/), function(name){
is the line that produces "unexpected" array.
Just for the record the library modifying String.prototype.split is popular "syntaxhighlighter_3.0.83".
We are working on fix/test and let you know, soon.
Changed 11 years ago by
Attachment: | dojo_parser.patch added |
---|
comment:3 Changed 11 years ago by
Actually the fixed split comes even deeper from http://xregexp.com
comment:4 Changed 11 years ago by
Milestone: | tbd → 1.8 |
---|---|
Status: | new → assigned |
Summary: | bug in dojo.parser.instantiate IE7 → exception in parser.instantiate() on IE6/IE7 when String.split() modified to work per spec |
Ah I see, good one. I didn't know that split() (according to spec) works that way. Too bad, as the IE behavior seems more useful.
Anyway, your fix to make sure the attrs string is trimmed makes sense, I'll check that in. Thanks for tracking down what was really going on.
You'll need to provide a test case for this and every ticket, because as far as I know the current code on IE7 is working fine. Thanks.