func (p *parser) popUntil(s scope, matchTags ...a.Atom) bool {
	if i := p.indexOfElementInScope(s, matchTags...); i != -1 {
		p.oe = p.oe[:i]
		return true
	}
	return false
}
popUntil pops the stack of open elements at the highest element whose tag
is in matchTags, provided there is no higher element in the scope's stop
tags (as defined in section 12.2.3.2). It returns whether or not there was
such an element. If there was not, popUntil leaves the stack unchanged.

For example, the set of stop tags for table scope is: "html", "table". If
the stack was:
["html", "body", "font", "table", "b", "i", "u"]
then popUntil(tableScope, "font") would return false, but
popUntil(tableScope, "i") would return true and the stack would become:
["html", "body", "font", "table", "b"]

If an element's tag is in both the stop tags and matchTags, then the stack
will be popped and the function returns true (provided, of course, there was
no higher element in the stack that was also in the stop tags). For example,
popUntil(tableScope, "table") returns true and leaves:
["html", "body", "font"]
package html
import (
	"errors"
	"fmt"
	"io"
	"strings"
	a "golang.org/x/net/html/atom"
)
type parser struct {
	tokenizer *Tokenizer
	tok Token
	hasSelfClosingToken bool
	doc *Node
	oe, afe nodeStack
	head, form *Node
	scripting, framesetOK bool
	im insertionMode
	originalIM insertionMode
	fosterParenting bool
	quirks bool
	fragment bool
	context *Node
}
func (p *parser) top() *Node {
	if n := p.oe.top(); n != nil {
		return n
	}
	return p.doc
}
var (
	defaultScopeStopTags = map[string][]a.Atom{
		"":     {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template},
		"math": {a.AnnotationXml, a.Mi, a.Mn, a.Mo, a.Ms, a.Mtext},
		"svg":  {a.Desc, a.ForeignObject, a.Title},
	}
)
type scope int
const (
	defaultScope scope = iota
	listItemScope
	buttonScope
	tableScope
	tableRowScope
	tableBodyScope
	selectScope
)