Closed
Bug 1196926
Opened 10 years ago
Closed 10 years ago
nodeValue capped at 4096 bytes when parsing XML
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 890284
People
(Reporter: feedback, Unassigned)
References
()
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
Steps to reproduce:
I load an XML resource from the server into variable r. The resource's size is 762844 plus tags ('<index subset="1">...</index>'); everything else between the tags is digits, commas, and line feeds. Then the resource is parsed with the following code:
var indices = r.getElementsByTagName('index');
for(var i = 0; i < indices.length; i++)
if (indices[i].getAttribute('subset') && indices[i].hasChildNodes())
data.indices[indices[i].getAttribute('subset')] = indices[i].firstChild.nodeValue;
Actual results:
The value of indices[i].firstChild.nodeValue is capped to 4096 bytes. This only happens with Firefox 40.0 and Firefox 40.2; however it works perfectly well with Chrome, IE, and Opera.
By the way, I can use innerHTML, which will work. (But then I'd have to remove the tag; and Opera doesn't accept innerHTML for XML resources.)
Expected results:
The size of the nodeValue is 762844.
Severity: normal → major
Component: Untriaged → Web Apps
Keywords: js1.7
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64
Whiteboard: XML parser
Updated•10 years ago
|
Component: Web Apps → Untriaged
Could you provide a testcase (public URL if possible) to reproduce the issue, please.
Component: Untriaged → DOM
Flags: needinfo?(feedback)
Keywords: js1.7
Product: Firefox → Core
Whiteboard: XML parser
Comment 2•10 years ago
|
||
Possible dupe, bug 890284.
Flags: needinfo?(feedback)
I provided a testcase for you. The real original code is huge. The JavaScript is in this file: http://quizzicalweb.com/bugreport/firefox_bug_1196926.js. Please ignore the AJAX code; but it's necessary to download an XML from some kind of source. The part where the error occurs comes at the end:
function bugcode(r)
{
var BUGVAR;
var indices = r.getElementsByTagName('index');
for(var i = 0; i < indices.length; i++)
if (indices[i].getAttribute('subset') && indices[i].hasChildNodes())
{
BUGVAR = indices[i].firstChild.nodeValue;
if (BUGVAR.length == 4096)
alert('This is the bug! Size of BUGVAR capped to 4096 instead of 106317.');
else
alert('Everyting\'s fine. Size: ' + BUGVAR.length);
}
}
[By the way, meanwhile I tested it on Safari, and Safari also does it right. It's only Firefox as far as I can see.]
Comment 4•10 years ago
|
||
This is a dup of some old bug. hsivonen might recall which one.
And I think we really should fix the issue finally, even if XML is used less and less.
Updated•10 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•