Title: [89522] trunk
Revision
89522
Author
[email protected]
Date
2011-06-22 19:31:11 -0700 (Wed, 22 Jun 2011)

Log Message

Lower HTML parser DOM depth limit to 2048
https://bugs.webkit.org/show_bug.cgi?id=63219

Reviewed by Adam Barth.

Source/WebCore: 

Lower the default depth limit from 4096 to 2048. There isn't a good
reason to have such pathologically nested content, and by-and-large,
the rendering code is not setup to support it that well. Adding this
aggressive limit now will allow us to see if anything breaks in the
nightlies.

* page/Settings.h:

LayoutTests: 

Update nest test to reflect new limit and remove tests that were
testing specific behaviors of the old parser.

* fast/parser/block-nesting-cap-expected.txt:
* fast/parser/block-nesting-cap-table-expected.txt: Removed.
* fast/parser/block-nesting-cap-table.html: Removed.
* fast/parser/element-nesting-cap-expected.txt: Removed.
* fast/parser/element-nesting-cap.html: Removed.
* fast/parser/script-tests/block-nesting-cap-table.js: Removed.
* fast/parser/script-tests/block-nesting-cap.js:
* fast/parser/script-tests/element-nesting-cap.js: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (89521 => 89522)


--- trunk/LayoutTests/ChangeLog	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/LayoutTests/ChangeLog	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,3 +1,22 @@
+2011-06-22  Sam Weinig  <[email protected]>
+
+        Reviewed by Adam Barth.
+
+        Lower HTML parser DOM depth limit to 2048
+        https://bugs.webkit.org/show_bug.cgi?id=63219
+
+        Update nest test to reflect new limit and remove tests that were
+        testing specific behaviors of the old parser.
+
+        * fast/parser/block-nesting-cap-expected.txt:
+        * fast/parser/block-nesting-cap-table-expected.txt: Removed.
+        * fast/parser/block-nesting-cap-table.html: Removed.
+        * fast/parser/element-nesting-cap-expected.txt: Removed.
+        * fast/parser/element-nesting-cap.html: Removed.
+        * fast/parser/script-tests/block-nesting-cap-table.js: Removed.
+        * fast/parser/script-tests/block-nesting-cap.js:
+        * fast/parser/script-tests/element-nesting-cap.js: Removed.
+
 2011-06-22  Kent Tamura  <[email protected]>
 
         [Win] media/media-controls-clone.html failing on Windows 7 Release (Tests)

Modified: trunk/LayoutTests/fast/parser/block-nesting-cap-expected.txt (89521 => 89522)


--- trunk/LayoutTests/fast/parser/block-nesting-cap-expected.txt	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/LayoutTests/fast/parser/block-nesting-cap-expected.txt	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,11 +1,11 @@
-Test that the HTML parser does not allow the nesting depth of "block-level" elements to exceed 4096.
+Test that the HTML parser does not allow the nesting depth of "block-level" elements to exceed 2048.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS d4096.parentNode === d4094 is true
-PASS d4095.parentNode === d4094 is true
-PASS d4096.previousSibling === d4095 is true
+PASS d2048.parentNode === d2046 is true
+PASS d2047.parentNode === d2046 is true
+PASS d2048.previousSibling === d2047 is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Deleted: trunk/LayoutTests/fast/parser/block-nesting-cap-table-expected.txt (89521 => 89522)


--- trunk/LayoutTests/fast/parser/block-nesting-cap-table-expected.txt	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/LayoutTests/fast/parser/block-nesting-cap-table-expected.txt	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,12 +0,0 @@
-Test that the HTML parser does not allow the nesting depth of "block-level" elements to exceed 4096 when using nested table tag
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-FAIL t1024.parentNode === td1022 should be true. Was false.
-PASS t1023.parentNode === td1022 is true
-FAIL t1024.previousSibling === t1023 should be true. Was false.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/parser/block-nesting-cap-table.html (89521 => 89522)


--- trunk/LayoutTests/fast/parser/block-nesting-cap-table.html	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/LayoutTests/fast/parser/block-nesting-cap-table.html	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<link rel="stylesheet" href=""
-<script src=""
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src=""
-<script src=""
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/parser/element-nesting-cap-expected.txt (89521 => 89522)


--- trunk/LayoutTests/fast/parser/element-nesting-cap-expected.txt	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/LayoutTests/fast/parser/element-nesting-cap-expected.txt	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,12 +0,0 @@
-Test that the HTML parser does not allow the nesting depth of any elements to exceed MAX_DOM_TREE_DEPTH.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-FAIL s3.parentNode === s1 should be true. Was false.
-FAIL s2.parentNode === s1 should be true. Was false.
-PASS s3.previousSibling === s2 is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/parser/element-nesting-cap.html (89521 => 89522)


--- trunk/LayoutTests/fast/parser/element-nesting-cap.html	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/LayoutTests/fast/parser/element-nesting-cap.html	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<link rel="stylesheet" href=""
-<script src=""
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src=""
-<script src=""
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/parser/script-tests/block-nesting-cap-table.js (89521 => 89522)


--- trunk/LayoutTests/fast/parser/script-tests/block-nesting-cap-table.js	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/LayoutTests/fast/parser/script-tests/block-nesting-cap-table.js	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,20 +0,0 @@
-description('Test that the HTML parser does not allow the nesting depth of "block-level" elements to exceed 4096 when using nested table tag');
-
-var depth = 1028;  // <table><tbody><tr><td> consumes 4 blocks. (1028 * 4 = 4112 > 4096).
-var markup = "";
-var i;
-for (i = 0; i < depth; ++i)
-    markup += "<table id='t" + i + "'><tbody><tr><td id='td" + i + "'>";
-var doc = document.implementation.createHTMLDocument();
-doc.body.innerHTML = markup;
-
-var t1023 = doc.getElementById("t1023");
-var t1024 = doc.getElementById("t1024");
-
-var td1022 = doc.getElementById("td1022");
-
-shouldBe("t1024.parentNode === td1022", "true");
-shouldBe("t1023.parentNode === td1022", "true");
-shouldBe("t1024.previousSibling === t1023", "true");
-
-var successfullyParsed = true;

Modified: trunk/LayoutTests/fast/parser/script-tests/block-nesting-cap.js (89521 => 89522)


--- trunk/LayoutTests/fast/parser/script-tests/block-nesting-cap.js	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/LayoutTests/fast/parser/script-tests/block-nesting-cap.js	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,6 +1,6 @@
-description('Test that the HTML parser does not allow the nesting depth of "block-level" elements to exceed 4096.');
+description('Test that the HTML parser does not allow the nesting depth of "block-level" elements to exceed 2048.');
 
-var depth = 4100;
+var depth = 2100;
 var markup = "";
 var i;
 for (i = 0; i < depth; ++i)
@@ -8,12 +8,12 @@
 var doc = document.implementation.createHTMLDocument();
 doc.body.innerHTML = markup;
 
-var d4094 = doc.getElementById("d4094");
-var d4095 = doc.getElementById("d4095");
-var d4096 = doc.getElementById("d4096");
+var d2046 = doc.getElementById("d2046");
+var d2047 = doc.getElementById("d2047");
+var d2048 = doc.getElementById("d2048");
 
-shouldBe("d4096.parentNode === d4094", "true");
-shouldBe("d4095.parentNode === d4094", "true");
-shouldBe("d4096.previousSibling === d4095", "true");
+shouldBe("d2048.parentNode === d2046", "true");
+shouldBe("d2047.parentNode === d2046", "true");
+shouldBe("d2048.previousSibling === d2047", "true");
 
 var successfullyParsed = true;

Deleted: trunk/LayoutTests/fast/parser/script-tests/element-nesting-cap.js (89521 => 89522)


--- trunk/LayoutTests/fast/parser/script-tests/element-nesting-cap.js	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/LayoutTests/fast/parser/script-tests/element-nesting-cap.js	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,18 +0,0 @@
-description('Test that the HTML parser does not allow the nesting depth of any elements to exceed MAX_DOM_TREE_DEPTH.');
-
-var depth = 5100;
-var markup = "";
-for (var i = 3; i < depth; ++i)
-    markup += "<span id='s" + i + "'>";
-var doc = document.implementation.createHTMLDocument();
-doc.body.innerHTML = markup;
-
-var s1 = doc.getElementById("s5001");
-var s2 = doc.getElementById("s5002");
-var s3 = doc.getElementById("s5003");
-
-shouldBeTrue("s3.parentNode === s1");
-shouldBeTrue("s2.parentNode === s1");
-shouldBeTrue("s3.previousSibling === s2");
-
-var successfullyParsed = true;

Modified: trunk/Source/WebCore/ChangeLog (89521 => 89522)


--- trunk/Source/WebCore/ChangeLog	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/Source/WebCore/ChangeLog	2011-06-23 02:31:11 UTC (rev 89522)
@@ -1,3 +1,18 @@
+2011-06-22  Sam Weinig  <[email protected]>
+
+        Reviewed by Adam Barth.
+
+        Lower HTML parser DOM depth limit to 2048
+        https://bugs.webkit.org/show_bug.cgi?id=63219
+
+        Lower the default depth limit from 4096 to 2048. There isn't a good
+        reason to have such pathologically nested content, and by-and-large,
+        the rendering code is not setup to support it that well. Adding this
+        aggressive limit now will allow us to see if anything breaks in the
+        nightlies.
+
+        * page/Settings.h:
+
 2011-06-22  Julien Chaffraix  <[email protected]>
 
         Reviewed by Dimitri Glazkov.

Modified: trunk/Source/WebCore/page/Settings.h (89521 => 89522)


--- trunk/Source/WebCore/page/Settings.h	2011-06-23 02:26:27 UTC (rev 89521)
+++ trunk/Source/WebCore/page/Settings.h	2011-06-23 02:31:11 UTC (rev 89522)
@@ -388,7 +388,7 @@
         void setUsePreHTML5ParserQuirks(bool flag) { m_usePreHTML5ParserQuirks = flag; }
         bool usePreHTML5ParserQuirks() const { return m_usePreHTML5ParserQuirks; }
 
-        static const unsigned defaultMaximumHTMLParserDOMTreeDepth = 4096;
+        static const unsigned defaultMaximumHTMLParserDOMTreeDepth = 2048;
         void setMaximumHTMLParserDOMTreeDepth(unsigned maximumHTMLParserDOMTreeDepth) { m_maximumHTMLParserDOMTreeDepth = maximumHTMLParserDOMTreeDepth; }
         unsigned maximumHTMLParserDOMTreeDepth() const { return m_maximumHTMLParserDOMTreeDepth; }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to