Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests for relaxed <select> parser #178

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tree-construction/menuitem-element.dat
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,14 @@
#data
<!DOCTYPE html><select><menuitem></select>
#errors
33: Stray start tag menuitem.
1:34: ERROR: End tag 'select' isn't allowed here. Currently open tags: html, body, select, menuitem.
#document
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <select>
| <menuitem>

#data
<!DOCTYPE html><option><menuitem>
Expand Down
31 changes: 16 additions & 15 deletions tree-construction/tables01.dat
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@
#data
<table><select><option>3</select></table>
#errors
(1,7): expected-doctype-but-got-start-tag
(1,15): unexpected-start-tag-implies-table-voodoo
1:1: ERROR: Expected a doctype token
1:8: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, table.
1:16: ERROR: Start tag 'option' isn't allowed here. Currently open tags: html, body, table, select.
1:24: ERROR: Character tokens aren't legal here
1:25: ERROR: End tag 'select' isn't allowed here. Currently open tags: html, body, table, select, option.
#document
| <html>
| <head>
Expand All @@ -114,12 +117,11 @@
#data
<table><select><table></table></select></table>
#errors
(1,7): expected-doctype-but-got-start-tag
(1,15): unexpected-start-tag-implies-table-voodoo
(1,22): unexpected-table-element-start-tag-in-select-in-table
(1,22): unexpected-start-tag-implies-end-tag
(1,39): unexpected-end-tag
(1,47): unexpected-end-tag
1:1: ERROR: Expected a doctype token
1:8: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, table.
1:16: ERROR: Start tag 'table' isn't allowed here. Currently open tags: html, body, table, select.
1:31: ERROR: End tag 'select' isn't allowed here. Currently open tags: html, body.
1:40: ERROR: End tag 'table' isn't allowed here. Currently open tags: html, body.
#document
| <html>
| <head>
Expand All @@ -131,9 +133,8 @@
#data
<table><select></table>
#errors
(1,7): expected-doctype-but-got-start-tag
(1,15): unexpected-start-tag-implies-table-voodoo
(1,23): unexpected-table-element-end-tag-in-select-in-table
1:1: ERROR: Expected a doctype token
1:8: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, table.
#document
| <html>
| <head>
Expand All @@ -144,9 +145,10 @@
#data
<table><select><option>A<tr><td>B</td></tr></table>
#errors
(1,7): expected-doctype-but-got-start-tag
(1,15): unexpected-start-tag-implies-table-voodoo
(1,28): unexpected-table-element-start-tag-in-select-in-table
1:1: ERROR: Expected a doctype token
1:8: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, table.
1:16: ERROR: Start tag 'option' isn't allowed here. Currently open tags: html, body, table, select.
1:24: ERROR: Character tokens aren't legal here
#document
| <html>
| <head>
Expand Down Expand Up @@ -292,7 +294,6 @@
1:13: 'svg' tag isn't allowed here. Currently open tags: html, body, div, table.
1:33: 'select' tag isn't allowed here. Currently open tags: html, body, div, table, svg, foreignobject.
1:41: 'table' tag isn't allowed here. Currently open tags: html, body, div, table, svg, foreignobject, select.
1:41: 'table' tag isn't allowed here. Currently open tags: html, body, div, table, svg, foreignobject.
1:48: 's' tag isn't allowed here. Currently open tags: html, body, div, table.
1:51: Premature end of file. Currently open tags: html, body, div, table, s.
#document
Expand Down
32 changes: 18 additions & 14 deletions tree-construction/tests1.dat
Original file line number Diff line number Diff line change
Expand Up @@ -355,18 +355,20 @@ Line1<br>Line2<br>Line3<br>Line4
#data
<select><b><option><select><option></b></select>X
#errors
(1,8): expected-doctype-but-got-start-tag
(1,11): unexpected-start-tag-in-select
(1,27): unexpected-select-in-select
(1,39): unexpected-end-tag
(1,48): unexpected-end-tag
1:1: ERROR: Expected a doctype token
1:20: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, select, b, option.
1:36: ERROR: End tag 'b' isn't allowed here. Currently open tags: html, body, b, select, option.
1:50: ERROR: Premature end of file. Currently open tags: html, body, b.
#document
| <html>
| <head>
| <body>
| <select>
| <option>
| <option>
| <b>
| <option>
| <b>
| <select>
| <option>
| "X"

#data
Expand Down Expand Up @@ -1532,18 +1534,20 @@ Line1<br>Line2<br>Line3<br>Line4
#data
<select><b><option><select><option></b></select>
#errors
(1,8): expected-doctype-but-got-start-tag
(1,11): unexpected-start-tag-in-select
(1,27): unexpected-select-in-select
(1,39): unexpected-end-tag
(1,48): unexpected-end-tag
1:1: ERROR: Expected a doctype token
1:20: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, select, b, option.
1:36: ERROR: End tag 'b' isn't allowed here. Currently open tags: html, body, b, select, option.
1:49: ERROR: Premature end of file. Currently open tags: html, body, b.
#document
| <html>
| <head>
| <body>
| <select>
| <option>
| <option>
| <b>
| <option>
| <b>
| <select>
| <option>

#data
<html><head><title></title><body></body></html>
Expand Down
46 changes: 25 additions & 21 deletions tree-construction/tests10.dat
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,25 @@
#data
<!DOCTYPE html><body><select><svg></svg></select>
#errors
(1,34) unexpected-start-tag-in-select
(1,40) unexpected-end-tag-in-select
#document
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <select>
| <svg svg>

#data
<!DOCTYPE html><body><select><option><svg></svg></option></select>
#errors
(1,42) unexpected-start-tag-in-select
(1,48) unexpected-end-tag-in-select
#document
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <select>
| <option>
| <svg svg>

#data
<!DOCTYPE html><body><table><svg></svg></table>
Expand Down Expand Up @@ -261,13 +259,8 @@
#data
<!DOCTYPE html><body><table><tr><td><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux
#errors
(1,49) unexpected-start-tag-in-select
(1,52) unexpected-start-tag-in-select
(1,59) unexpected-end-tag-in-select
(1,62) unexpected-start-tag-in-select
(1,69) unexpected-end-tag-in-select
(1,72) unexpected-start-tag-in-select
(1,83) unexpected-table-element-end-tag-in-select-in-table
1:70: ERROR: Start tag 'p' isn't allowed here. Currently open tags: html, body, table, tbody, tr, td, select, svg.
1:76: ERROR: End tag 'table' isn't allowed here. Currently open tags: html, body, table, tbody, tr, td, select.
#document
| <!DOCTYPE html>
| <html>
Expand All @@ -278,28 +271,39 @@
| <tr>
| <td>
| <select>
| "foobarbaz"
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <p>
| "baz"
| <p>
| "quux"

#data
<!DOCTYPE html><body><table><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux
#errors
(1,36) unexpected-start-tag-implies-table-voodoo
(1,41) unexpected-start-tag-in-select
(1,44) unexpected-start-tag-in-select
(1,51) unexpected-end-tag-in-select
(1,54) unexpected-start-tag-in-select
(1,61) unexpected-end-tag-in-select
(1,64) unexpected-start-tag-in-select
(1,75) unexpected-table-element-end-tag-in-select-in-table
1:29: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, table.
1:37: ERROR: Start tag 'svg' isn't allowed here. Currently open tags: html, body, table, select.
1:62: ERROR: Start tag 'p' isn't allowed here. Currently open tags: html, body, table, select, svg.
1:62: ERROR: Start tag 'p' isn't allowed here. Currently open tags: html, body, table, select.
1:65: ERROR: Character tokens aren't legal here
1:66: ERROR: Character tokens aren't legal here
1:67: ERROR: Character tokens aren't legal here
#document
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <select>
| "foobarbaz"
| <svg svg>
| <svg g>
| "foo"
| <svg g>
| "bar"
| <p>
| "baz"
| <table>
| <p>
| "quux"
Expand Down
10 changes: 4 additions & 6 deletions tree-construction/tests17.dat
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#data
<!doctype html><table><tbody><select><tr>
#errors
(1,37): unexpected-start-tag-implies-table-voodoo
(1,41): unexpected-table-element-start-tag-in-select-in-table
(1,41): eof-in-table
(1,30): unexpected-start-tag
(1,42): premature-eof
#document
| <!DOCTYPE html>
| <html>
Expand All @@ -17,9 +16,8 @@
#data
<!doctype html><table><tr><select><td>
#errors
(1,34): unexpected-start-tag-implies-table-voodoo
(1,38): unexpected-table-element-start-tag-in-select-in-table
(1,38): expected-closing-tag-but-got-eof
(1,27): unexpected-start-tag
(1,39): premature-eof
#document
| <!DOCTYPE html>
| <html>
Expand Down
44 changes: 29 additions & 15 deletions tree-construction/tests18.dat
Original file line number Diff line number Diff line change
Expand Up @@ -227,34 +227,42 @@
#data
<!doctype html><select><plaintext></plaintext>X
#errors
34: Stray start tag “plaintext”.
46: Stray end tag “plaintext”.
47: End of file seen and there were open elements.
1:48: ERROR: Premature end of file. Currently open tags: html, body, select, plaintext.
#document
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <select>
| "X"
| <plaintext>
| "</plaintext>X"

#data
<!doctype html><table><select><plaintext>a<caption>b
#errors
30: Start tag “select” seen in “table”.
41: Stray start tag “plaintext”.
51: “caption” start tag with “select” open.
52: End of file seen and there were open elements.
1:23: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, table.
1:31: ERROR: Start tag 'plaintext' isn't allowed here. Currently open tags: html, body, table, select.
1:42: ERROR: Character tokens aren't legal here
1:43: ERROR: Character tokens aren't legal here
1:44: ERROR: Character tokens aren't legal here
1:45: ERROR: Character tokens aren't legal here
1:46: ERROR: Character tokens aren't legal here
1:47: ERROR: Character tokens aren't legal here
1:48: ERROR: Character tokens aren't legal here
1:49: ERROR: Character tokens aren't legal here
1:50: ERROR: Character tokens aren't legal here
1:51: ERROR: Character tokens aren't legal here
1:52: ERROR: Character tokens aren't legal here
1:53: ERROR: Premature end of file. Currently open tags: html, body, table, select, plaintext.
#document
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <select>
| "a"
| <plaintext>
| "a<caption>b"
| <table>
| <caption>
| "b"

#data
<!doctype html><template><plaintext>a</template>b
Expand Down Expand Up @@ -446,8 +454,11 @@
#data
<!doctype html><table><select><script></style></script>abc
#errors
(1,30): unexpected-start-tag-implies-table-voodoo
(1,58): eof-in-select
1:23: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, table.
1:56: ERROR: Character tokens aren't legal here
1:57: ERROR: Character tokens aren't legal here
1:58: ERROR: Character tokens aren't legal here
1:59: ERROR: Premature end of file. Currently open tags: html, body, table, select.
#document
| <!DOCTYPE html>
| <html>
Expand All @@ -462,8 +473,11 @@
#data
<!doctype html><table><tr><select><script></style></script>abc
#errors
(1,34): unexpected-start-tag-implies-table-voodoo
(1,62): eof-in-select
1:27: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, table, tbody, tr.
1:60: ERROR: Character tokens aren't legal here
1:61: ERROR: Character tokens aren't legal here
1:62: ERROR: Character tokens aren't legal here
1:63: ERROR: Premature end of file. Currently open tags: html, body, table, tbody, tr, select.
#document
| <!DOCTYPE html>
| <html>
Expand Down
6 changes: 4 additions & 2 deletions tree-construction/tests2.dat
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,8 @@
#data
<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>
#errors
(1,68): unexpected-select-in-select
1:61: ERROR: Start tag 'select' isn't allowed here. Currently open tags: html, body, select, option.
1:77: ERROR: Premature end of file. Currently open tags: html, body, select, option.
#document
| <!DOCTYPE html>
| <html>
Expand All @@ -510,7 +511,8 @@
| <optgroup>
| <option>
| <option>
| <option>
| <select>
| <option>

#data
<!DOCTYPE html><select><optgroup><option><optgroup>
Expand Down
Loading
Loading