Skip to content

Commit 416470e

Browse files
committed
cleanup: Remove unnecessary DOM parser logic
1 parent d9d03a7 commit 416470e

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

html/dom_parser.go

-19
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func NewDOMParser() domParser { return domParser{} }
5454

5555
type ElementSteps interface {
5656
AppendChild(parent dom.Node, child dom.Node) dom.Node
57-
Connected(n dom.Element)
5857
}
5958

6059
type BaseRules struct{}
@@ -67,8 +66,6 @@ func (r BaseRules) AppendChild(parent dom.Node, child dom.Node) dom.Node {
6766
return res
6867
}
6968

70-
func (r BaseRules) Connected(n dom.Element) {}
71-
7269
type TemplateElementRules struct{ BaseRules }
7370

7471
func (TemplateElementRules) AppendChild(parent dom.Node, child dom.Node) dom.Node {
@@ -94,16 +91,6 @@ func parseIntoDocument(doc dom.Document, r io.Reader) error {
9491
return nil
9592
}
9693

97-
func cloneNode(n *html.Node) *html.Node {
98-
return &html.Node{
99-
Type: n.Type,
100-
Data: n.Data,
101-
DataAtom: n.DataAtom,
102-
Namespace: n.Namespace,
103-
Attr: n.Attr,
104-
}
105-
}
106-
10794
// convertNS converts the namespace URI from x/net/html to the _right_
10895
// namespace.
10996
// SVG elements have namespace "svg"
@@ -142,12 +129,6 @@ func createElementFromNode(
142129
newNode = newElm
143130
newNode = rules.AppendChild(parent, newElm)
144131
iterate(d, newNode, source)
145-
// ?
146-
if rules != nil {
147-
if newElm.IsConnected() {
148-
rules.Connected(newElm)
149-
}
150-
}
151132
return newElm
152133
}
153134

0 commit comments

Comments
 (0)