Commit Graph

22 Commits

Author SHA1 Message Date
Kunpei Sakai
ffdde10578 html: implement adjusted current node and make parser support foreign fragment
This follows up on golang.org/cl/205617

Change-Id: Id94a4fcef6a604936c404f75999ba37321b6c2c0
Reviewed-on: https://go-review.googlesource.com/c/net/+/206121
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-11-25 08:49:36 +00:00
Kunpei Sakai
72fef5d5e2 html: remove "filterres" from svg attribute adjustments
This follows up on golang.org/cl/205617
Ref: c0ffd43f89

Change-Id: I0a7399368bb8c28c5bf65adf3614a84ffeb82b8c
Reviewed-on: https://go-review.googlesource.com/c/net/+/206120
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-11-24 23:54:46 +00:00
Kunpei Sakai
b954d4e333 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>
2019-11-24 23:23:54 +00:00
Kunpei Sakai
7e6e90b9ea html: port html5lib test data from html5lib/html5lib-tests
1. git clone git@github.com:html5lib/html5lib-tests.git && git checkout 88b8ee967f9f6f42fcd84c65af774860a70ecf3c
2. cp -Rv html5lib-tests/tree-construction/ into testdata/webkit
3. Drop unpassed following changes:

testdata/webkit/foreign-fragment.dat
testdata/webkit/isindex.dat
testdata/webkit/main-element.dat
testdata/webkit/menuitem-element.dat
testdata/webkit/tests11.dat
testdata/webkit/tests16.dat
testdata/webkit/tests19.dat
testdata/webkit/tests25.dat
testdata/webkit/tests5.dat
testdata/webkit/webkit02.dat

Change-Id: Ie60b6e24751a1efb83caf326b7e42f0517ec6b96
Reviewed-on: https://go-review.googlesource.com/c/net/+/205617
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-11-08 06:38:44 +00:00
Kunpei Sakai
6f6bbb1828 html: add Dialog support
Change-Id: I16afe71ca444afb03526f94e6743a587cd82a8d4
Reviewed-on: https://go-review.googlesource.com/c/net/+/205618
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-11-08 04:52:52 +00:00
Tom Anthony
ce75fb3bc6 html: Add missing condition to 'in cell' insertion mode, required by spec
In section 12.2.6.4.15 of the spec, there is a condition that the current node is a td or th element, which is not implemented. This can lead to a panic when the open elements stack is popped whilst empty, as outlined in golang/go#30600. This commit implements that check.

Fixes golang/go#30600

Change-Id: I4837815e2edce21b58a985a100d93d146bf71e24
GitHub-Last-Rev: 79084c5a84
GitHub-Pull-Request: golang/net#41
Reviewed-on: https://go-review.googlesource.com/c/net/+/172377
Reviewed-by: Kunpei Sakai <namusyaka@gmail.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-24 02:45:59 +00:00
Tom Anthony
e3b2ff56ed html: fix parsing where nested tags of unknown types inadvertently close one another
The existing implementation behaves differently to all major browsers, for the instance where a self-closing element of an unknown tag type is the child of another element of an unknown tag type. The issue appears to be that nested tags of an differing unknown types will all have an atom value of 0 and `inBodyEndTagOther` will incorrectly match them to one another.

Fixes golang/go#30961

Change-Id: I62b0aa49c027c8432df7d077ffba135201b3b786
GitHub-Last-Rev: fb25181f9a
GitHub-Pull-Request: golang/net#37
Reviewed-on: https://go-review.googlesource.com/c/net/+/168638
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-03-24 22:39:53 +00:00
Brad Fitzpatrick
66a96c8a54 html: remove G+ reference from testdata
A bot inside Google was nagging me about this so change plusone to
minusone to hide it from the bot which doesn't understand that it's
just test data.

Change-Id: I2300a3e8c2ca969d61cae2d6bdc0683743b534e1
Reviewed-on: https://go-review.googlesource.com/c/162888
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-02-26 19:30:03 +00:00
Kunpei Sakai
d26f9f9a57 html: update inSelectIM and inSelectInTableIM for the latest spec
Fixes golang/go#27842

Change-Id: I06eb3c0c18be3566bd30a29fca5f3f7e6791d2cc
Reviewed-on: https://go-review.googlesource.com/c/137275
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-01-25 09:10:13 +00:00
Kunpei Sakai
4b62a64f59 html: make (*nodeStack)contains distinguish namespace
By proceeding without distinguishing namespace, inconsistency will
occur.
This commit makes the method distinguish the HTML namespace.

Fixes golang/go#27846

Change-Id: I8269f670240c0fe31162a16fbe1ac23acacec00f
Reviewed-on: https://go-review.googlesource.com/c/159397
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-01-25 00:28:52 +00:00
Kunpei Sakai
cf3bd585ca html: don't set im if <template> doesn't have HTML namespace
If there are nested <template> elements and the <template> node isn't in HTML namespace,
couldn't continue to parse documents correctly.
By this patch, it makes the <template> which is in math namespace be skipped on
resetting insertion mode.

Fixes golang/go#27702

Change-Id: I6eacdb98fe29eb3c61781afca5bc4d83e72ba4ed
Reviewed-on: https://go-review.googlesource.com/136875
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-09-25 07:13:36 +00:00
Kunpei Sakai
2f5d238892 html: avoid panic even if unconsidered <isindex> and <template> combination
The <isindex> element has been removed from the spec so that the
<template> element doesn't cover it.
To avoid panic, this commit adds ignoring code as a workaround.

Fixes golang/go#27704

Change-Id: I847391389285df2fc0eb6a795f8c93b481cdebac
Reviewed-on: https://go-review.googlesource.com/136575
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-09-21 00:03:56 +00:00
Kunpei Sakai
8a410e7b63 html: fix wrong comparison in foster parenting algorithm
Fixes golang/go#23071

Change-Id: I383e13bfd87e32ffb775dff54c46b66b090e5017
Reviewed-on: https://go-review.googlesource.com/131475
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-08-26 01:23:51 +00:00
Kunpei Sakai
4bcd98cce5 html: copy passed tests from chromium
Updates golang/go#23071

Change-Id: I1fdf3fe8c94efdf3c4bf9c39900468381159a032
Reviewed-on: https://go-review.googlesource.com/131178
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-08-24 15:20:47 +00:00
Kunpei Sakai
faa378e6db html: handle end-of-file cases correctly
Updates golang/go#23071

Change-Id: I02a61109b5738759a9ee3e448981778de7d0ff62
Reviewed-on: https://go-review.googlesource.com/130795
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-08-24 04:51:31 +00:00
Kunpei Sakai
aaf6012214 html: remove special procedure for <template> in frameset im
See more details: https://bugs.chromium.org/p/chromium/issues/detail?id=829668

Updates golang/go#23071

Change-Id: Ib9c963269f814c3f21d3784754729df57dcc8f90
Reviewed-on: https://go-review.googlesource.com/123776
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-08-16 10:28:01 +00:00
Kunpei Sakai
c394268923 html: don't ignore token when current token is not <template>
Updates golang/go#23071

Change-Id: I36b0ee58f61b7de25730e0fb082eeb7ef2787594
Reviewed-on: https://go-review.googlesource.com/123920
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-08-11 02:16:10 +00:00
Kunpei Sakai
32a936f463 html: don't ignore the token if the current node is form
See: https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inbody

Fixes golang/go#25703
Updates golang/go#23071

Change-Id: I09db4c2d07a242cb45c3e37b499c609809dd0b83
Reviewed-on: https://go-review.googlesource.com/120658
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-07-06 05:13:57 +00:00
Kunpei Sakai
d41e817464 html: handle rb and rtc elements
Updates golang/go#23071

Change-Id: Ifef79e077801422eb273af3e5a541c85c63bfce4
Reviewed-on: https://go-review.googlesource.com/107575
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-04-18 06:21:11 +00:00
namusyaka
500e7a4f95 html: add "in template" insertion mode support
See:
https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-intemplate

Updates golang/go#23071

Change-Id: I36529b7cf5d2adf159ed5c471fba9f67890b7eb9
Reviewed-on: https://go-review.googlesource.com/94838
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-04-15 21:43:07 +00:00
Ian Lance Taylor
05bc443e7e html: remove license references from benchmark test data
The license references puzzle programs that grep for licenses.

Fixes golang/go#13573.

Change-Id: I601fbc6ba2b189b476af1082c48fb02cd72f59d8
Reviewed-on: https://go-review.googlesource.com/17714
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-11 03:42:21 +00:00
Nigel Tao
ea127e889c go.net/html: move exp/html and exp/html/atom here to the go.net
sub-repo.

It's a straight copy, except for these modifications:
* "exp/html" and "exp/html/atom" imports were renamed, and
* the "TODO... When this package moves out of exp" comment was
  deleted from atom/atom.go.

The matching change is at https://golang.org/cl/7317043

The rationale was discussed at
https://groups.google.com/d/topic/golang-nuts/Qq5hTQyPuLg/discussion

R=adg, remyoudompheng, dave
CC=golang-dev
https://golang.org/cl/7310063
2013-02-11 11:55:20 +11:00