PHP
6 days ago
LICENSE.md
6 days ago
README.md
6 days ago
class-wp-html-active-formatting-elements.php
6 days ago
class-wp-html-attribute-token.php
6 days ago
class-wp-html-decoder.php
6 days ago
class-wp-html-doctype-info.php
6 days ago
class-wp-html-native-processor-wrapper.php
6 days ago
class-wp-html-native-tag-processor-wrapper.php
6 days ago
class-wp-html-open-elements.php
6 days ago
class-wp-html-processor-state.php
6 days ago
class-wp-html-processor.php
6 days ago
class-wp-html-span.php
6 days ago
class-wp-html-stack-event.php
6 days ago
class-wp-html-tag-processor.php
6 days ago
class-wp-html-text-replacement.php
6 days ago
class-wp-html-token.php
6 days ago
class-wp-html-unsupported-exception.php
6 days ago
class-wp-token-map.php
6 days ago
composer.json
6 days ago
html5-named-character-references.php
6 days ago
class-wp-html-span.php
57 lines
| 1 | <?php |
| 2 | /** |
| 3 | * HTML API: WP_HTML_Span class |
| 4 | * |
| 5 | * @package WordPress |
| 6 | * @subpackage HTML-API |
| 7 | * @since 6.2.0 |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Core class used by the HTML tag processor to represent a textual span |
| 12 | * inside an HTML document. |
| 13 | * |
| 14 | * This is a two-tuple in disguise, used to avoid the memory overhead |
| 15 | * involved in using an array for the same purpose. |
| 16 | * |
| 17 | * This class is for internal usage of the WP_HTML_Tag_Processor class. |
| 18 | * |
| 19 | * @access private |
| 20 | * @since 6.2.0 |
| 21 | * @since 6.5.0 Replaced `end` with `length` to more closely align with `substr()`. |
| 22 | * |
| 23 | * @see WP_HTML_Tag_Processor |
| 24 | */ |
| 25 | class WP_HTML_Span { |
| 26 | /** |
| 27 | * Byte offset into document where span begins. |
| 28 | * |
| 29 | * @since 6.2.0 |
| 30 | * |
| 31 | * @var int |
| 32 | */ |
| 33 | public $start; |
| 34 | |
| 35 | /** |
| 36 | * Byte length of this span. |
| 37 | * |
| 38 | * @since 6.5.0 |
| 39 | * |
| 40 | * @var int |
| 41 | */ |
| 42 | public $length; |
| 43 | |
| 44 | /** |
| 45 | * Constructor. |
| 46 | * |
| 47 | * @param int $start Byte offset into document where replacement span begins. |
| 48 | * @param int $length Byte length of span. |
| 49 | * |
| 50 | * @since 6.2.0 |
| 51 | */ |
| 52 | public function __construct( int $start, int $length ) { |
| 53 | $this->start = $start; |
| 54 | $this->length = $length; |
| 55 | } |
| 56 | } |
| 57 |