Commit ce3e958c authored by eric@webkit.org's avatar eric@webkit.org

2010-07-14 Eric Seidel <eric@webkit.org>

        Reviewed by Adam Barth.

        Add a test to document WebKit (and Minefield's) HTML5 spec violation related to text node coalescing
        https://bugs.webkit.org/show_bug.cgi?id=42294

        * html5lib/resources/adoption01.dat:
        * html5lib/runner-expected-html5.txt:
        * html5lib/runner-expected.txt:
2010-07-14  Eric Seidel  <eric@webkit.org>

        Reviewed by Adam Barth.

        Make the LegacyHTMLTreeBuilder coalesce text nodes
        https://bugs.webkit.org/show_bug.cgi?id=42314

        This is slightly tricky as we're side-stepping the old
        parsers insertion logic in the cases where we know we can
        safely merge text into an existing text node instead of
        inserting a new one.

        This affects lots of tests (which will need to change for
        the HTML5 TreeBuilder anyway) and causes the LegacyHTMLTreeBuilder
        to now pass a bunch more subtests in html5lib/runner.html.

        The parser benchmark thinks that this is a small speedup.
        I think I happen to have been lucky enough to get the right
        cache alignment, and that this is likely a wash.

        * html/LegacyHTMLTreeBuilder.cpp:
        (WebCore::LegacyHTMLTreeBuilder::parseToken):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 94d18b50
This diff is collapsed.
......@@ -73,10 +73,8 @@ deleteCommand();
runTest();
</SCRIPT>
<#text>
</#text>
<#text>
</#text>
<#text>
</#text>
</BODY>
</HTML>
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 13 of BODY > HTML > #document
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 12 of BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of BODY > HTML > #document to 13 of BODY > HTML > #document
EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of BODY > HTML > #document to 12 of BODY > HTML > #document
EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of TD > TR > TBODY > TABLE > BODY > HTML > #document to 1 of TD > TR > TBODY > TABLE > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of TD > TR > TBODY > TABLE > BODY > HTML > #document to 1 of TD > TR > TBODY > TABLE > BODY > HTML > #document
EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 13 of BODY > HTML > #document
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 12 of BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of BODY > HTML > #document to 13 of BODY > HTML > #document
EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of BODY > HTML > #document to 12 of BODY > HTML > #document
EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of TD > TR > TBODY > TABLE > BODY > HTML > #document to 1 of TD > TR > TBODY > TABLE > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of TD > TR > TBODY > TABLE > BODY > HTML > #document to 1 of TD > TR > TBODY > TABLE > BODY > HTML > #document
EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 13 of BODY > HTML > #document
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 12 of BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of BODY > HTML > #document to 13 of BODY > HTML > #document
EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of BODY > HTML > #document to 12 of BODY > HTML > #document
EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of TD > TR > TBODY > TABLE > BODY > HTML > #document to 1 of TD > TR > TBODY > TABLE > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
......
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 11 of BODY > HTML > #document
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 10 of BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
......
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 5 of DIV > BODY > HTML > #document
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
......
......@@ -34,7 +34,7 @@ function editingTest()
<body>
<p>Test that moving insertion point over Thai text (without ligatures) always moves one character at a time.</p>
<p>Should say PASS:</p>
<div contenteditable id="test">อยากไปความ</textarea>
<div contenteditable id="test">อยากไปความ</div>
<ul id="console"></ul>
<script language="javascript" type="text/javascript">
runEditingTest();
......
......@@ -15,4 +15,3 @@ layer at (0,0) size 800x152
RenderBlock {P} at (0,102) size 784x18
RenderText {#text} at (0,0) size 61x18
text run at (0,0) width 61: "RTL End"
RenderText {#text} at (0,0) size 0x0
......@@ -7,4 +7,3 @@ layer at (0,0) size 800x600
RenderText {#text} at (50,50) size 200x50
text run at (50,50) width 200: "A B"
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
......@@ -14,8 +14,6 @@ resources/tests1.dat:
52
53
54
57
59
78
79
80
......@@ -196,12 +194,9 @@ Got:
| <html>
| <head>
| <body>
| "A"
| "B"
| "C"
| "ABC"
| <select>
| "D"
| "E"
| "DE"
Expected:
| <!DOCTYPE html>
| <html>
......@@ -224,8 +219,7 @@ Got:
| <script>
| " <!-- "
| <body>
| " --> "
| " EOF"
| " --> EOF"
Expected:
| <!DOCTYPE html>
| <html>
......@@ -330,46 +324,6 @@ Expected:
| "Test"
| <u>
Test 57 of 113 in resources/tests1.dat failed. Input:
<b>Test</i>Test
Got:
| <html>
| <head>
| <body>
| <b>
| "Test"
| "Test"
Expected:
| <html>
| <head>
| <body>
| <b>
| "TestTest"
Test 59 of 113 in resources/tests1.dat failed. Input:
<b>A<cite>B<div>C</cite>D
Got:
| <html>
| <head>
| <body>
| <b>
| "A"
| <cite>
| "B"
| <div>
| "C"
| "D"
Expected:
| <html>
| <head>
| <body>
| <b>
| "A"
| <cite>
| "B"
| <div>
| "CD"
Test 78 of 113 in resources/tests1.dat failed. Input:
<a href="blah">aba<table><a href="foo">br<tr><td></td></tr>x</table>aoe
Got:
......@@ -784,13 +738,10 @@ resources/tests2.dat:
8
9
11
32
36
42
44
45
53
54
Test 6 of 59 in resources/tests2.dat failed. Input:
<!DOCTYPE html><frameset>test
......@@ -877,22 +828,6 @@ Expected:
| "<td>"
| <table>
Test 32 of 59 in resources/tests2.dat failed. Input:
<!DOCTYPE html>X</body>X
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| "X"
| "X"
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| "XX"
Test 36 of 59 in resources/tests2.dat failed. Input:
<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>
Got:
......@@ -982,38 +917,6 @@ Expected:
| <style>
| "
x { content:"</style" } "
Test 53 of 59 in resources/tests2.dat failed. Input:
<!DOCTYPE html>X</html>X
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| "X"
| "X"
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| "XX"
Test 54 of 59 in resources/tests2.dat failed. Input:
<!DOCTYPE html>X</html>
Got:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| "X"
| " "
Expected:
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| "X "
resources/tests3.dat:
16
17
......@@ -1144,10 +1047,8 @@ Expected:
| "setting head's innerHTML"
resources/tests5.dat:
2
6
7
8
9
16
Test 2 of 16 in resources/tests5.dat failed. Input:
......@@ -1158,8 +1059,7 @@ Got:
| <style>
| " <!-- "
| <body>
| " --> "
| "x"
| " --> x"
Expected:
| <html>
| <head>
......@@ -1169,25 +1069,6 @@ Expected:
| <body>
| "--> x"
Test 6 of 16 in resources/tests5.dat failed. Input:
<iframe> <!--- </iframe>->x</iframe> --> </iframe>x
Got:
| <html>
| <head>
| <body>
| <iframe>
| " <!--- "
| "->x"
| " --> "
| "x"
Expected:
| <html>
| <head>
| <body>
| <iframe>
| " <!--- "
| "->x --> x"
Test 7 of 16 in resources/tests5.dat failed. Input:
<script> <!-- </script> --> </script>x
Got:
......@@ -1196,8 +1077,7 @@ Got:
| <script>
| " <!-- "
| <body>
| " --> "
| "x"
| " --> x"
Expected:
| <html>
| <head>
......@@ -1215,8 +1095,7 @@ Got:
| <title>
| " <!-- "
| <body>
| " --> "
| "x"
| " --> x"
Expected:
| <html>
| <head>
......@@ -1226,25 +1105,6 @@ Expected:
| <body>
| "--> x"
Test 9 of 16 in resources/tests5.dat failed. Input:
<textarea> <!--- </textarea>->x</textarea> --> </textarea>x
Got:
| <html>
| <head>
| <body>
| <textarea>
| " <!--- "
| "->x"
| " --> "
| "x"
Expected:
| <html>
| <head>
| <body>
| <textarea>
| " <!--- "
| "->x --> x"
Test 16 of 16 in resources/tests5.dat failed. Input:
<noscript><!--</noscript>--></noscript>
Got:
......@@ -1506,7 +1366,6 @@ resources/tests7.dat:
18
19
24
25
27
28
29
......@@ -1751,24 +1610,6 @@ Expected:
| <body>
| "X"
Test 25 of 30 in resources/tests7.dat failed. Input:
<div><p>a</x> b
Got:
| <html>
| <head>
| <body>
| <div>
| <p>
| "a"
| " b"
Expected:
| <html>
| <head>
| <body>
| <div>
| <p>
| "a b"
Test 27 of 30 in resources/tests7.dat failed. Input:
<table><b><tr><td>aaa</td></tr>bbb</table>ccc
Got:
......@@ -1827,11 +1668,10 @@ Got:
| <body>
| "A"
| " B"
| "C"
| <table>
| <tbody>
| <tr>
| " "
| " C"
Expected:
| <html>
| <head>
......@@ -1856,104 +1696,11 @@ Expected:
| <select>
| <keygen>
resources/tests8.dat:
1
2
3
4
5
6
8
9
Test 1 of 9 in resources/tests8.dat failed. Input:
<div>
<div></div>
</span>x
Got:
| <html>
| <head>
| <body>
| <div>
| "
"
| <div>
| "
"
| "x"
Expected:
| <html>
| <head>
| <body>
| <div>
| "
"
| <div>
| "
x"
Test 2 of 9 in resources/tests8.dat failed. Input:
<div>x<div></div>
</span>x
Got:
| <html>
| <head>
| <body>
| <div>
| "x"
| <div>
| "
"
| "x"
Expected:
| <html>
| <head>
| <body>
| <div>
| "x"
| <div>
| "
x"
Test 3 of 9 in resources/tests8.dat failed. Input:
<div>x<div></div>x</span>x
Got:
| <html>
| <head>
| <body>
| <div>
| "x"
| <div>
| "x"
| "x"
Expected:
| <html>
| <head>
| <body>
| <div>
| "x"
| <div>
| "xx"
Test 4 of 9 in resources/tests8.dat failed. Input:
<div>x<div></div>y</span>z
Got:
| <html>
| <head>
| <body>
| <div>
| "x"
| <div>
| "y"
| "z"
Expected:
| <html>
| <head>
| <body>
| <div>