Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 20 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
| AfterFrameset | |
0.00% |
0 / 20 |
|
0.00% |
0 / 4 |
90 | |
0.00% |
0 / 1 |
| characters | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| startTag | |
0.00% |
0 / 12 |
|
0.00% |
0 / 1 |
20 | |||
| endTag | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
12 | |||
| endDocument | |
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 frameset" insertion mode |
| 10 | */ |
| 11 | class AfterFrameset extends InsertionMode { |
| 12 | /** @inheritDoc */ |
| 13 | public function characters( $text, $start, $length, $sourceStart, $sourceLength ) { |
| 14 | $this->handleFramesetWhitespace( false, $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( |
| 25 | $name, $attrs, $selfClose, $sourceStart, $sourceLength ); |
| 26 | break; |
| 27 | |
| 28 | case 'noframes': |
| 29 | $dispatcher->inHead->startTag( |
| 30 | $name, $attrs, $selfClose, $sourceStart, $sourceLength ); |
| 31 | break; |
| 32 | |
| 33 | default: |
| 34 | $builder->error( "unexpected start tag after frameset, ignoring", $sourceStart ); |
| 35 | return; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | /** @inheritDoc */ |
| 40 | public function endTag( $name, $sourceStart, $sourceLength ) { |
| 41 | $builder = $this->builder; |
| 42 | $dispatcher = $this->dispatcher; |
| 43 | |
| 44 | switch ( $name ) { |
| 45 | case 'html': |
| 46 | $dispatcher->switchMode( Dispatcher::AFTER_AFTER_FRAMESET ); |
| 47 | break; |
| 48 | |
| 49 | default: |
| 50 | $builder->error( "unexpected end tag after frameset, ignoring", $sourceStart ); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /** @inheritDoc */ |
| 55 | public function endDocument( $pos ) { |
| 56 | $this->builder->stopParsing( $pos ); |
| 57 | } |
| 58 | } |