#8045 closed defect (fixed)
dojox.data.XmlItem.toString() truncates content at 4096 characters in Firefox
Reported by: | Ayhan Ergul | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | high | Milestone: | 1.2.2 |
Component: | DojoX Data | Version: | 1.2.0 |
Keywords: | XmlStore Firefox 4096 | Cc: | |
Blocked By: | Blocking: |
Description
When using Firefox (tested on 2.x), querying an XmlStore? returns XmlItem? objects with content truncated at 4096 characters when accessed via toString(). This is due to Firefox breaking up large text nodes into multiple text nodes with no more than 4096 characters (apparently to improve the performance of its page layout algorithm). The toString() implementation returns only the first text node's content, effectively limiting return value to 4096 characters:
toString: function() { // summary: // Return a value of the first text child of the element // returns: // a value of the first text child of the element var str = ""; if (this.element) { for (var i = 0; i < this.element.childNodes.length; i++) { var node = this.element.childNodes[i]; if (node.nodeType === 3) { str = node.nodeValue; break; } } } return str; //String }
Replacing the following section of code:
str = node.nodeValue; break;
with:
str = str + node.nodeValue;
would appear to resolve this issue.
Ayhan Ergul
Attachments (1)
Change History (5)
comment:1 Changed 14 years ago by
Status: | new → assigned |
---|
Changed 14 years ago by
Attachment: | dojox.data.XmlStore_20081110.patch added |
---|
Minor patch, varient of suggestion.
comment:3 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 Changed 14 years ago by
Milestone: | tbd → 1.2.2 |
---|
Note: See
TracTickets for help on using
tickets.
Will include a fix for this as part of the work to support identity in 1.3