2010-07-05 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jul 2010 05:31:08 +0000 (05:31 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jul 2010 05:31:08 +0000 (05:31 +0000)
        Reviewed by Eric Seidel.

        Implement in select in table
        https://bugs.webkit.org/show_bug.cgi?id=41646

        Add some tests for this mode.  We fail all these tests currently
        because there's no way to get into this mode.  :(

        * html5lib/resources/tables01.dat:
        * html5lib/runner-expected-html5.txt:
        * html5lib/runner-expected.txt:
2010-07-05  Adam Barth  <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Implement in select in table
        https://bugs.webkit.org/show_bug.cgi?id=41646

        This mode is mostly a fall-through to the InSelectMode.

        * html/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::processStartTag):
        (WebCore::HTMLTreeBuilder::processEndTag):
        (WebCore::HTMLTreeBuilder::processCharacter):
        (WebCore::HTMLTreeBuilder::processEndOfFile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@62521 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/html5lib/resources/tables01.dat
LayoutTests/html5lib/runner-expected-html5.txt
LayoutTests/html5lib/runner-expected.txt
WebCore/ChangeLog
WebCore/html/HTMLTreeBuilder.cpp

index b127b3e..a893e8d 100644 (file)
@@ -2,6 +2,20 @@
 
         Reviewed by Eric Seidel.
 
+        Implement in select in table
+        https://bugs.webkit.org/show_bug.cgi?id=41646
+
+        Add some tests for this mode.  We fail all these tests currently
+        because there's no way to get into this mode.  :(
+
+        * html5lib/resources/tables01.dat:
+        * html5lib/runner-expected-html5.txt:
+        * html5lib/runner-expected.txt:
+
+2010-07-05  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
         Implement basic text node coalescing
         https://bugs.webkit.org/show_bug.cgi?id=41623
 
index 5b25ff9..5f830f1 100644 (file)
 |       <tbody>
 |         <tr>
 |           <td>
+
+#data
+<table><select><option>3</select></table>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|       <option>
+|         "3"
+|     <table>
+
+#data
+<table><select><table></table></select></table>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|     <table>
+|     <table>
+
+#data
+<table><select></table>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|     <table>
+
+#data
+<table><select><option>A<tr><td>B</td></tr></table>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|       <option>
+|         "A"
+|     <table>
+|       <tbody>
+|         <tr>
+|           <td>
+|             "B"
index 5b4979c..5b236be 100644 (file)
@@ -5294,8 +5294,12 @@ resources/inbody01.dat: PASS
 
 resources/tables01.dat:
 4
+7
+8
+9
+10
 
-Test 4 of 6 in resources/tables01.dat failed. Input:
+Test 4 of 10 in resources/tables01.dat failed. Input:
 <table><colgroup></html>foo
 Got:
 | <html>
@@ -5310,4 +5314,72 @@ Expected:
 |     "foo"
 |     <table>
 |       <colgroup>
+
+Test 7 of 10 in resources/tables01.dat failed. Input:
+<table><select><option>3</select></table>
+Got:
+| <html>
+|   <head>
+|   <body>
+|     <table>
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|       <option>
+|         "3"
+|     <table>
+
+Test 8 of 10 in resources/tables01.dat failed. Input:
+<table><select><table></table></select></table>
+Got:
+| <html>
+|   <head>
+|   <body>
+|     <table>
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|     <table>
+|     <table>
+
+Test 9 of 10 in resources/tables01.dat failed. Input:
+<table><select></table>
+Got:
+| <html>
+|   <head>
+|   <body>
+|     <table>
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|     <table>
+
+Test 10 of 10 in resources/tables01.dat failed. Input:
+<table><select><option>A<tr><td>B</td></tr></table>
+Got:
+| <html>
+|   <head>
+|   <body>
+|     <table>
+|       <tbody>
+|         <tr>
+|           <td>
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|       <option>
+|         "A"
+|     <table>
+|       <tbody>
+|         <tr>
+|           <td>
+|             "B"
 #EOF
index 72ee5b5..b3da42b 100644 (file)
@@ -5001,8 +5001,11 @@ resources/inbody01.dat: PASS
 
 resources/tables01.dat:
 3
+7
+8
+9
 
-Test 3 of 6 in resources/tables01.dat failed. Input:
+Test 3 of 10 in resources/tables01.dat failed. Input:
 <table><col foo='bar'>
 Got:
 | <html>
@@ -5019,3 +5022,57 @@ Expected:
 |       <colgroup>
 |         <col>
 |           foo="bar"
+
+Test 7 of 10 in resources/tables01.dat failed. Input:
+<table><select><option>3</select></table>
+Got:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|       <option>
+|         "3"
+|     <table>
+|       <tbody>
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|       <option>
+|         "3"
+|     <table>
+
+Test 8 of 10 in resources/tables01.dat failed. Input:
+<table><select><table></table></select></table>
+Got:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|     <table>
+|       <tbody>
+|     <table>
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|     <table>
+|     <table>
+
+Test 9 of 10 in resources/tables01.dat failed. Input:
+<table><select></table>
+Got:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|     <table>
+|       <tbody>
+Expected:
+| <html>
+|   <head>
+|   <body>
+|     <select>
+|     <table>
index 0158a6b..fee1533 100644 (file)
@@ -2,6 +2,21 @@
 
         Reviewed by Eric Seidel.
 
+        Implement in select in table
+        https://bugs.webkit.org/show_bug.cgi?id=41646
+
+        This mode is mostly a fall-through to the InSelectMode.
+
+        * html/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::processStartTag):
+        (WebCore::HTMLTreeBuilder::processEndTag):
+        (WebCore::HTMLTreeBuilder::processCharacter):
+        (WebCore::HTMLTreeBuilder::processEndOfFile):
+
+2010-07-05  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Eric Seidel.
+
         Implement basic text node coalescing
         https://bugs.webkit.org/show_bug.cgi?id=41623
 
index 71c8f2d..be899ca 100644 (file)
@@ -899,8 +899,18 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken& token)
         }
         parseError(token);
         break;
+    case InSelectInTableMode:
+        ASSERT(insertionMode() == InSelectInTableMode);
+        if (token.name() == captionTag || token.name() == tableTag || token.name() == tbodyTag || token.name() == tfootTag || token.name() == theadTag || token.name() == trTag || token.name() == tdTag || token.name() == thTag) {
+            parseError(token);
+            AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag.localName());
+            processEndTag(endSelect);
+            processStartTag(token);
+            return;
+        }
+        // Fall through
     case InSelectMode:
-        ASSERT(insertionMode() == InSelectMode);
+        ASSERT(insertionMode() == InSelectMode || insertionMode() == InSelectInTableMode);
         if (token.name() == htmlTag) {
             insertHTMLStartTagInBody(token);
             return;
@@ -1462,8 +1472,20 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken& token)
         ASSERT(insertionMode() == AfterFramesetMode || insertionMode() == AfterAfterFramesetMode);
         parseError(token);
         break;
+    case InSelectInTableMode:
+        ASSERT(insertionMode() == InSelectInTableMode);
+        if (token.name() == captionTag || token.name() == tableTag || token.name() == tbodyTag || token.name() == tfootTag || token.name() == theadTag || token.name() == trTag || token.name() == tdTag || token.name() == thTag) {
+            parseError(token);
+            if (m_openElements.inTableScope(token.name())) {
+                AtomicHTMLToken endSelect(HTMLToken::EndTag, selectTag.localName());
+                processEndTag(endSelect);
+                processEndTag(token);
+            }
+            return;
+        }
+        // Fall through.
     case InSelectMode:
-        ASSERT(insertionMode() == InSelectMode);
+        ASSERT(insertionMode() == InSelectMode || insertionMode() == InSelectInTableMode);
         if (token.name() == optgroupTag) {
             if (currentElement()->hasTagName(optionTag))
                 notImplemented();
@@ -1564,8 +1586,9 @@ void HTMLTreeBuilder::processCharacter(AtomicHTMLToken& token)
         ASSERT(insertionMode() == InFramesetMode || insertionMode() == AfterFramesetMode || insertionMode() == AfterAfterFramesetMode);
         parseError(token);
         break;
+    case InSelectInTableMode:
     case InSelectMode:
-        ASSERT(insertionMode() == InSelectMode);
+        ASSERT(insertionMode() == InSelectMode || insertionMode() == InSelectInTableMode);
         insertTextNode(token);
         break;
     default:
@@ -1619,8 +1642,9 @@ void HTMLTreeBuilder::processEndOfFile(AtomicHTMLToken& token)
     case AfterAfterFramesetMode:
         ASSERT(insertionMode() == AfterFramesetMode || insertionMode() == AfterAfterFramesetMode);
         break;
+    case InSelectInTableMode:
     case InSelectMode:
-        ASSERT(insertionMode() == InSelectMode);
+        ASSERT(insertionMode() == InSelectMode || insertionMode() == InSelectInTableMode);
         if (currentElement() != m_openElements.htmlElement())
             parseError(token);
         break;