MCPcopy
hub / github.com/golang/net / reconstructActiveFormattingElements

Method reconstructActiveFormattingElements

html/parse.go:399–425  ·  view source on GitHub ↗

Section 12.2.4.3.

()

Source from the content-addressed store, hash-verified

397
398// Section 12.2.4.3.
399func (p *parser) reconstructActiveFormattingElements() {
400 n := p.afe.top()
401 if n == nil {
402 return
403 }
404 if n.Type == scopeMarkerNode || p.oe.index(n) != -1 {
405 return
406 }
407 i := len(p.afe) - 1
408 for n.Type != scopeMarkerNode && p.oe.index(n) == -1 {
409 if i == 0 {
410 i = -1
411 break
412 }
413 i--
414 n = p.afe[i]
415 }
416 for {
417 i++
418 clone := p.afe[i].clone()
419 p.addChild(clone)
420 p.afe[i] = clone
421 if i == len(p.afe)-1 {
422 break
423 }
424 }
425}
426
427// Section 12.2.5.
428func (p *parser) acknowledgeSelfClosingTag() {

Callers 1

inBodyIMFunction · 0.80

Calls 4

addChildMethod · 0.95
cloneMethod · 0.80
topMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected