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-stack-event.php
83 lines
| 1 | <?php |
| 2 | /** |
| 3 | * HTML API: WP_HTML_Stack_Event class |
| 4 | * |
| 5 | * @package WordPress |
| 6 | * @subpackage HTML-API |
| 7 | * @since 6.6.0 |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Core class used by the HTML Processor as a record for stack operations. |
| 12 | * |
| 13 | * This class is for internal usage of the WP_HTML_Processor class. |
| 14 | * |
| 15 | * @access private |
| 16 | * @since 6.6.0 |
| 17 | * |
| 18 | * @see WP_HTML_Processor |
| 19 | */ |
| 20 | class WP_HTML_Stack_Event { |
| 21 | /** |
| 22 | * Refers to popping an element off of the stack of open elements. |
| 23 | * |
| 24 | * @since 6.6.0 |
| 25 | */ |
| 26 | const POP = 'pop'; |
| 27 | |
| 28 | /** |
| 29 | * Refers to pushing an element onto the stack of open elements. |
| 30 | * |
| 31 | * @since 6.6.0 |
| 32 | */ |
| 33 | const PUSH = 'push'; |
| 34 | |
| 35 | /** |
| 36 | * References the token associated with the stack push event, |
| 37 | * even if this is a pop event for that element. |
| 38 | * |
| 39 | * @since 6.6.0 |
| 40 | * |
| 41 | * @var WP_HTML_Token |
| 42 | */ |
| 43 | public $token; |
| 44 | |
| 45 | /** |
| 46 | * Indicates which kind of stack operation this event represents. |
| 47 | * |
| 48 | * May be one of the class constants. |
| 49 | * |
| 50 | * @since 6.6.0 |
| 51 | * |
| 52 | * @see self::POP |
| 53 | * @see self::PUSH |
| 54 | * |
| 55 | * @var string |
| 56 | */ |
| 57 | public $operation; |
| 58 | |
| 59 | /** |
| 60 | * Indicates if the stack element is a real or virtual node. |
| 61 | * |
| 62 | * @since 6.6.0 |
| 63 | * |
| 64 | * @var string |
| 65 | */ |
| 66 | public $provenance; |
| 67 | |
| 68 | /** |
| 69 | * Constructor function. |
| 70 | * |
| 71 | * @param WP_HTML_Token $token Token associated with stack event, always an opening token. |
| 72 | * @param string $operation One of self::PUSH or self::POP. |
| 73 | * @param string $provenance "virtual" or "real". |
| 74 | * |
| 75 | * @since 6.6.0 |
| 76 | */ |
| 77 | public function __construct( WP_HTML_Token $token, string $operation, string $provenance ) { |
| 78 | $this->token = $token; |
| 79 | $this->operation = $operation; |
| 80 | $this->provenance = $provenance; |
| 81 | } |
| 82 | } |
| 83 |