| 1 |
<?php |
| 2 |
|
| 3 |
namespace Wikimedia\RemexHtml\TreeBuilder; |
| 4 |
|
| 5 |
use Wikimedia\RemexHtml\Tokenizer\Attributes; |
| 6 |
|
| 7 |
/** |
| 8 |
* The "after after frameset" insertion mode. |
| 9 |
*/ |
| 10 |
class AfterAfterFrameset extends InsertionMode { |
| 11 |
/** @inheritDoc */ |
| 12 |
public function characters( $text, $start, $length, $sourceStart, $sourceLength ) { |
| 13 |
$this->handleFramesetWhitespace( true, $text, $start, $length, $sourceStart, $sourceLength ); |
| 14 |
} |
| 15 |
|
| 16 |
/** @inheritDoc */ |
| 17 |
public function startTag( $name, Attributes $attrs, $selfClose, $sourceStart, $sourceLength ) { |
| 18 |
$builder = $this->builder; |
| 19 |
$dispatcher = $this->dispatcher; |
| 20 |
|
| 21 |
switch ( $name ) { |
| 22 |
case 'html': |
| 23 |
$dispatcher->inBody->startTag( $name, $attrs, $selfClose, |
| 24 |
$sourceStart, $sourceLength ); |
| 25 |
break; |
| 26 |
|
| 27 |
case 'noframes': |
| 28 |
$dispatcher->inHead->startTag( $name, $attrs, $selfClose, |
| 29 |
$sourceStart, $sourceLength ); |
| 30 |
break; |
| 31 |
|
| 32 |
default: |
| 33 |
$builder->error( "unexpected start tag after after frameset", $sourceStart ); |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
/** @inheritDoc */ |
| 38 |
public function endTag( $name, $sourceStart, $sourceLength ) { |
| 39 |
$this->builder->error( "unexpected end tag after after frameset", $sourceStart ); |
| 40 |
} |
| 41 |
|
| 42 |
/** @inheritDoc */ |
| 43 |
public function endDocument( $pos ) { |
| 44 |
$this->builder->stopParsing( $pos ); |
| 45 |
} |
| 46 |
|
| 47 |
/** @inheritDoc */ |
| 48 |
public function comment( $text, $sourceStart, $sourceLength ) { |
| 49 |
$this->builder->comment( [ TreeBuilder::ROOT, null ], $text, $sourceStart, $sourceLength ); |
| 50 |
} |
| 51 |
} |