stripNulls(
function ( $text, $start, $length, $sourceStart, $sourceLength ) {
$this->builder->insertCharacters( $text, $start, $length,
$sourceStart, $sourceLength );
},
$text, $start, $length, $sourceStart, $sourceLength );
}
public function startTag( $name, Attributes $attrs, $selfClose, $sourceStart, $sourceLength ) {
$builder = $this->builder;
$stack = $builder->stack;
$dispatcher = $this->dispatcher;
switch ( $name ) {
case 'html':
$dispatcher->inBody->startTag( $name, $attrs, $selfClose, $sourceStart, $sourceLength );
break;
case 'option':
if ( $stack->current->htmlName === 'option' ) {
$builder->pop( $sourceStart, 0 );
}
$builder->insertElement( 'option', $attrs, false, $sourceStart, $sourceLength );
break;
case 'optgroup':
if ( $stack->current->htmlName === 'option' ) {
$builder->pop( $sourceStart, 0 );
}
if ( $stack->current->htmlName === 'optgroup' ) {
$builder->pop( $sourceStart, 0 );
}
$builder->insertElement( 'optgroup', $attrs, false, $sourceStart, $sourceLength );
break;
case 'select':
if ( !$stack->isInSelectScope( 'select' ) ) {
$builder->error( "