Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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)

dojox.data.XmlStore_20081110.patch (423 bytes) - added by Jared Jurkiewicz 11 years ago.
Minor patch, varient of suggestion.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 11 years ago by Jared Jurkiewicz

Status: newassigned

Will include a fix for this as part of the work to support identity in 1.3

Changed 11 years ago by Jared Jurkiewicz

Minor patch, varient of suggestion.

comment:2 Changed 11 years ago by Jared Jurkiewicz

Tested on:

Firefox 2.0

IE 7

Safari 3.1

Google Chrome

comment:3 Changed 11 years ago by Jared Jurkiewicz

Resolution: fixed
Status: assignedclosed

comment:4 Changed 11 years ago by Jared Jurkiewicz

Milestone: tbd1.2.2
Note: See TracTickets for help on using tickets.