Section 12.2.4.3.
()
| 397 | |
| 398 | // Section 12.2.4.3. |
| 399 | func (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. |
| 428 | func (p *parser) acknowledgeSelfClosingTag() { |