From b4829c1de6ffd8581c40932da7a57dcfdd0610fb Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Thu, 19 Jan 2012 17:41:10 +1100 Subject: [PATCH] html: in foreign content, check for HTML integration points in breakout elements. Pass tests10.dat, test 33:
    a | | | | | | | |
      | "a" Also pass test 34:

      R=andybalholm, dsymonds CC=golang-dev https://golang.org/cl/5536048 --- src/pkg/html/parse.go | 4 ++-- src/pkg/html/parse_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pkg/html/parse.go b/src/pkg/html/parse.go index 43c04727ab8..04f4ae75334 100644 --- a/src/pkg/html/parse.go +++ b/src/pkg/html/parse.go @@ -1713,8 +1713,8 @@ func parseForeignContent(p *parser) bool { } if breakout[p.tok.Data] { for i := len(p.oe) - 1; i >= 0; i-- { - // TODO: HTML, MathML integration points. - if p.oe[i].Namespace == "" { + // TODO: MathML integration points. + if p.oe[i].Namespace == "" || htmlIntegrationPoint(p.oe[i]) { p.oe = p.oe[:i+1] break } diff --git a/src/pkg/html/parse_test.go b/src/pkg/html/parse_test.go index c929c257727..1528dffaafa 100644 --- a/src/pkg/html/parse_test.go +++ b/src/pkg/html/parse_test.go @@ -184,7 +184,7 @@ func TestParser(t *testing.T) { {"tests4.dat", -1}, {"tests5.dat", -1}, {"tests6.dat", -1}, - {"tests10.dat", 33}, + {"tests10.dat", 35}, } for _, tf := range testFiles { f, err := os.Open("testdata/webkit/" + tf.filename)