mirror of
https://github.com/golang/net.git
synced 2026-03-31 10:27:08 +09:00
html: add Main support
This follows up on golang.org/cl/205617 Change-Id: Ic4a232c40a69bcd3ba35abdd36bce933f35248ea Reviewed-on: https://go-review.googlesource.com/c/net/+/206117 Run-TryBot: Kunpei Sakai <namusyaka@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Nigel Tao <nigeltao@golang.org>
This commit is contained in:
@@ -881,7 +881,7 @@ func inBodyIM(p *parser) bool {
|
||||
p.addElement()
|
||||
p.im = inFramesetIM
|
||||
return true
|
||||
case a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dialog, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:
|
||||
case a.Address, a.Article, a.Aside, a.Blockquote, a.Center, a.Details, a.Dialog, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Main, a.Menu, a.Nav, a.Ol, a.P, a.Section, a.Summary, a.Ul:
|
||||
p.popUntil(buttonScope, a.P)
|
||||
p.addElement()
|
||||
case a.H1, a.H2, a.H3, a.H4, a.H5, a.H6:
|
||||
@@ -1137,7 +1137,7 @@ func inBodyIM(p *parser) bool {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dialog, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:
|
||||
case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dialog, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Main, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul:
|
||||
p.popUntil(defaultScope, p.tok.DataAtom)
|
||||
case a.Form:
|
||||
if p.oe.contains(a.Template) {
|
||||
|
||||
46
html/testdata/webkit/main-element.dat
vendored
Normal file
46
html/testdata/webkit/main-element.dat
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
#data
|
||||
<!doctype html><p>foo<main>bar<p>baz
|
||||
#errors
|
||||
(1,36): expected-closing-tag-but-got-eof
|
||||
#document
|
||||
| <!DOCTYPE html>
|
||||
| <html>
|
||||
| <head>
|
||||
| <body>
|
||||
| <p>
|
||||
| "foo"
|
||||
| <main>
|
||||
| "bar"
|
||||
| <p>
|
||||
| "baz"
|
||||
|
||||
#data
|
||||
<!doctype html><main><p>foo</main>bar
|
||||
#errors
|
||||
#document
|
||||
| <!DOCTYPE html>
|
||||
| <html>
|
||||
| <head>
|
||||
| <body>
|
||||
| <main>
|
||||
| <p>
|
||||
| "foo"
|
||||
| "bar"
|
||||
|
||||
#data
|
||||
<!DOCTYPE html>xxx<svg><x><g><a><main><b>
|
||||
#errors
|
||||
* (1,42) unexpected HTML-like start tag token in foreign content
|
||||
* (1,42) unexpected end of file
|
||||
#document
|
||||
| <!DOCTYPE html>
|
||||
| <html>
|
||||
| <head>
|
||||
| <body>
|
||||
| "xxx"
|
||||
| <svg svg>
|
||||
| <svg x>
|
||||
| <svg g>
|
||||
| <svg a>
|
||||
| <svg main>
|
||||
| <b>
|
||||
Reference in New Issue
Block a user