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