Title: [215535] trunk
Revision
215535
Author
[email protected]
Date
2017-04-19 15:27:04 -0700 (Wed, 19 Apr 2017)

Log Message

Parsing large XML strings fails
https://bugs.webkit.org/show_bug.cgi?id=170999
<rdar://problem/17336267>

Reviewed by Brady Eidson.

Source/WebCore:

Test: fast/dom/xml-large.html

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLParserContext::createStringParser):
(WebCore::XMLParserContext::createMemoryParser):
Allow huge XML strings. They work fine in Chrome and Firefox.

LayoutTests:

* fast/dom/xml-large-expected.txt: Added.
* fast/dom/xml-large.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (215534 => 215535)


--- trunk/LayoutTests/ChangeLog	2017-04-19 22:06:58 UTC (rev 215534)
+++ trunk/LayoutTests/ChangeLog	2017-04-19 22:27:04 UTC (rev 215535)
@@ -1,3 +1,14 @@
+2017-04-19  Alex Christensen  <[email protected]>
+
+        Parsing large XML strings fails
+        https://bugs.webkit.org/show_bug.cgi?id=170999
+        <rdar://problem/17336267>
+
+        Reviewed by Brady Eidson.
+
+        * fast/dom/xml-large-expected.txt: Added.
+        * fast/dom/xml-large.html: Added.
+
 2017-04-19  Chris Fleizach  <[email protected]>
 
         AX: <hr> should use a different role description than interactive separators

Added: trunk/LayoutTests/fast/dom/xml-large-expected.txt (0 => 215535)


--- trunk/LayoutTests/fast/dom/xml-large-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/xml-large-expected.txt	2017-04-19 22:27:04 UTC (rev 215535)
@@ -0,0 +1,2 @@
+ALERT: parsed successfully
+

Added: trunk/LayoutTests/fast/dom/xml-large.html (0 => 215535)


--- trunk/LayoutTests/fast/dom/xml-large.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/xml-large.html	2017-04-19 22:27:04 UTC (rev 215535)
@@ -0,0 +1,13 @@
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+var x = '<root>';
+for (var i = 0; i < 25000; ++i)
+    x += '<node id = "' + i + '"><payload>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</payload></node>';
+x += '</root>';
+var d = (new DOMParser).parseFromString(x, "text/xml");
+if (d.getElementsByTagName("parsererror").length)
+    alert("error while parsing");
+else
+    alert("parsed successfully");
+</script>

Modified: trunk/Source/WebCore/ChangeLog (215534 => 215535)


--- trunk/Source/WebCore/ChangeLog	2017-04-19 22:06:58 UTC (rev 215534)
+++ trunk/Source/WebCore/ChangeLog	2017-04-19 22:27:04 UTC (rev 215535)
@@ -1,3 +1,18 @@
+2017-04-19  Alex Christensen  <[email protected]>
+
+        Parsing large XML strings fails
+        https://bugs.webkit.org/show_bug.cgi?id=170999
+        <rdar://problem/17336267>
+
+        Reviewed by Brady Eidson.
+
+        Test: fast/dom/xml-large.html
+
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLParserContext::createStringParser):
+        (WebCore::XMLParserContext::createMemoryParser):
+        Allow huge XML strings. They work fine in Chrome and Firefox.
+
 2017-04-19  Chris Fleizach  <[email protected]>
 
         AX: <hr> should use a different role description than interactive separators

Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (215534 => 215535)


--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2017-04-19 22:06:58 UTC (rev 215534)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2017-04-19 22:27:04 UTC (rev 215535)
@@ -511,7 +511,7 @@
     parser->_private = userData;
 
     // Substitute entities.
-    xmlCtxtUseOptions(parser, XML_PARSE_NOENT);
+    xmlCtxtUseOptions(parser, XML_PARSE_NOENT | XML_PARSE_HUGE);
 
     switchToUTF16(parser);
 
@@ -540,7 +540,7 @@
 
     // Substitute entities.
     // FIXME: Why is XML_PARSE_NODICT needed? This is different from what createStringParser does.
-    xmlCtxtUseOptions(parser, XML_PARSE_NODICT | XML_PARSE_NOENT);
+    xmlCtxtUseOptions(parser, XML_PARSE_NODICT | XML_PARSE_NOENT | XML_PARSE_HUGE);
 
     // Internal initialization
     parser->sax2 = 1;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to