Make WordPress Core


Ignore:
Timestamp:
07/05/2024 04:37:41 PM (9 months ago)
Author:
dmsnell
Message:

HTML API: Stub out remaining insertion modes in the HTML Processor.

As part of work to add more spec support to the HTML API, this patch adds
stubs for all of the remaining parser insertion modes in the HTML Processor.
These modes are not all supported yet, but they will be necessary to continue
adding support for other tags and markup.

Developed in https://github.com/WordPress/wordpress-develop/pull/6973
Discussed in https://core.trac.wordpress.org/ticket/61576

Props dmsnell, jonsurrell.
See #61576.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-processor-state.php

    r58656 r58679  
    4949
    5050    /**
     51     * Before HTML insertion mode for full HTML parser.
     52     *
     53     * @since 6.4.0
     54     *
     55     * @see https://html.spec.whatwg.org/#the-before-html-insertion-mode
     56     * @see WP_HTML_Processor_State::$insertion_mode
     57     *
     58     * @var string
     59     */
     60    const INSERTION_MODE_BEFORE_HTML = 'insertion-mode-before-html';
     61
     62    /**
     63     * Before head insertion mode for full HTML parser.
     64     *
     65     * @since 6.7.0
     66     *
     67     * @see https://html.spec.whatwg.org/#parsing-main-beforehead
     68     * @see WP_HTML_Processor_State::$insertion_mode
     69     *
     70     * @var string
     71     */
     72    const INSERTION_MODE_BEFORE_HEAD = 'insertion-mode-before-head';
     73
     74    /**
     75     * In head insertion mode for full HTML parser.
     76     *
     77     * @since 6.7.0
     78     *
     79     * @see https://html.spec.whatwg.org/#parsing-main-inhead
     80     * @see WP_HTML_Processor_State::$insertion_mode
     81     *
     82     * @var string
     83     */
     84    const INSERTION_MODE_IN_HEAD = 'insertion-mode-in-head';
     85
     86    /**
     87     * In head noscript insertion mode for full HTML parser.
     88     *
     89     * @since 6.7.0
     90     *
     91     * @see https://html.spec.whatwg.org/#parsing-main-inheadnoscript
     92     * @see WP_HTML_Processor_State::$insertion_mode
     93     *
     94     * @var string
     95     */
     96    const INSERTION_MODE_IN_HEAD_NOSCRIPT = 'insertion-mode-in-head-noscript';
     97
     98    /**
     99     * After head insertion mode for full HTML parser.
     100     *
     101     * @since 6.7.0
     102     *
     103     * @see https://html.spec.whatwg.org/#parsing-main-afterhead
     104     * @see WP_HTML_Processor_State::$insertion_mode
     105     *
     106     * @var string
     107     */
     108    const INSERTION_MODE_AFTER_HEAD = 'insertion-mode-after-head';
     109
     110    /**
    51111     * In body insertion mode for full HTML parser.
    52112     *
     
    61121
    62122    /**
     123     * In table insertion mode for full HTML parser.
     124     *
     125     * @since 6.7.0
     126     *
     127     * @see https://html.spec.whatwg.org/#parsing-main-intable
     128     * @see WP_HTML_Processor_State::$insertion_mode
     129     *
     130     * @var string
     131     */
     132    const INSERTION_MODE_IN_TABLE = 'insertion-mode-in-table';
     133
     134    /**
     135     * In table text insertion mode for full HTML parser.
     136     *
     137     * @since 6.7.0
     138     *
     139     * @see https://html.spec.whatwg.org/#parsing-main-intabletext
     140     * @see WP_HTML_Processor_State::$insertion_mode
     141     *
     142     * @var string
     143     */
     144    const INSERTION_MODE_IN_TABLE_TEXT = 'insertion-mode-in-table-text';
     145
     146    /**
     147     * In caption insertion mode for full HTML parser.
     148     *
     149     * @since 6.7.0
     150     *
     151     * @see https://html.spec.whatwg.org/#parsing-main-incaption
     152     * @see WP_HTML_Processor_State::$insertion_mode
     153     *
     154     * @var string
     155     */
     156    const INSERTION_MODE_IN_CAPTION = 'insertion-mode-in-caption';
     157
     158    /**
     159     * In column group insertion mode for full HTML parser.
     160     *
     161     * @since 6.7.0
     162     *
     163     * @see https://html.spec.whatwg.org/#parsing-main-incolumngroup
     164     * @see WP_HTML_Processor_State::$insertion_mode
     165     *
     166     * @var string
     167     */
     168    const INSERTION_MODE_IN_COLUMN_GROUP = 'insertion-mode-in-column-group';
     169
     170    /**
     171     * In table body insertion mode for full HTML parser.
     172     *
     173     * @since 6.7.0
     174     *
     175     * @see https://html.spec.whatwg.org/#parsing-main-intablebody
     176     * @see WP_HTML_Processor_State::$insertion_mode
     177     *
     178     * @var string
     179     */
     180    const INSERTION_MODE_IN_TABLE_BODY = 'insertion-mode-in-table-body';
     181
     182    /**
     183     * In row insertion mode for full HTML parser.
     184     *
     185     * @since 6.7.0
     186     *
     187     * @see https://html.spec.whatwg.org/#parsing-main-inrow
     188     * @see WP_HTML_Processor_State::$insertion_mode
     189     *
     190     * @var string
     191     */
     192    const INSERTION_MODE_IN_ROW = 'insertion-mode-in-row';
     193
     194    /**
     195     * In cell insertion mode for full HTML parser.
     196     *
     197     * @since 6.7.0
     198     *
     199     * @see https://html.spec.whatwg.org/#parsing-main-incell
     200     * @see WP_HTML_Processor_State::$insertion_mode
     201     *
     202     * @var string
     203     */
     204    const INSERTION_MODE_IN_CELL = 'insertion-mode-in-cell';
     205
     206    /**
    63207     * In select insertion mode for full HTML parser.
    64208     *
     
    85229
    86230    /**
    87      * In table insertion mode for full HTML parser.
    88      *
    89      * @since 6.7.0
    90      *
    91      * @see https://html.spec.whatwg.org/#parsing-main-intable
    92      * @see WP_HTML_Processor_State::$insertion_mode
    93      *
    94      * @var string
    95      */
    96     const INSERTION_MODE_IN_TABLE = 'insertion-mode-in-table';
    97 
    98     /**
    99      * In caption insertion mode for full HTML parser.
    100      *
    101      * @since 6.7.0
    102      *
    103      * @see https://html.spec.whatwg.org/#parsing-main-incaption
    104      * @see WP_HTML_Processor_State::$insertion_mode
    105      *
    106      * @var string
    107      */
    108     const INSERTION_MODE_IN_CAPTION = 'insertion-mode-in-caption';
    109 
    110     /**
    111      * In table body insertion mode for full HTML parser.
    112      *
    113      * @since 6.7.0
    114      *
    115      * @see https://html.spec.whatwg.org/#parsing-main-intablebody
    116      * @see WP_HTML_Processor_State::$insertion_mode
    117      *
    118      * @var string
    119      */
    120     const INSERTION_MODE_IN_TABLE_BODY = 'insertion-mode-in-table-body';
    121 
    122     /**
    123      * In row insertion mode for full HTML parser.
    124      *
    125      * @since 6.7.0
    126      *
    127      * @see https://html.spec.whatwg.org/#parsing-main-inrow
    128      * @see WP_HTML_Processor_State::$insertion_mode
    129      *
    130      * @var string
    131      */
    132     const INSERTION_MODE_IN_ROW = 'insertion-mode-in-row';
    133 
    134     /**
    135      * In cell insertion mode for full HTML parser.
    136      *
    137      * @since 6.7.0
    138      *
    139      * @see https://html.spec.whatwg.org/#parsing-main-incell
    140      * @see WP_HTML_Processor_State::$insertion_mode
    141      *
    142      * @var string
    143      */
    144     const INSERTION_MODE_IN_CELL = 'insertion-mode-in-cell';
    145 
    146     /**
    147      * In column group insertion mode for full HTML parser.
    148      *
    149      * @since 6.7.0
    150      *
    151      * @see https://html.spec.whatwg.org/#parsing-main-incolumngroup
    152      * @see WP_HTML_Processor_State::$insertion_mode
    153      *
    154      * @var string
    155      */
    156     const INSERTION_MODE_IN_COLUMN_GROUP = 'insertion-mode-in-column-group';
     231     * In template insertion mode for full HTML parser.
     232     *
     233     * @since 6.7.0
     234     *
     235     * @see https://html.spec.whatwg.org/#parsing-main-intemplate
     236     * @see WP_HTML_Processor_State::$insertion_mode
     237     *
     238     * @var string
     239     */
     240    const INSERTION_MODE_IN_TEMPLATE = 'insertion-mode-in-template';
     241
     242    /**
     243     * After body insertion mode for full HTML parser.
     244     *
     245     * @since 6.7.0
     246     *
     247     * @see https://html.spec.whatwg.org/#parsing-main-afterbody
     248     * @see WP_HTML_Processor_State::$insertion_mode
     249     *
     250     * @var string
     251     */
     252    const INSERTION_MODE_AFTER_BODY = 'insertion-mode-after-body';
    157253
    158254    /**
     
    169265
    170266    /**
    171      * In head insertion mode for full HTML parser.
    172      *
    173      * @since 6.7.0
    174      *
    175      * @see https://html.spec.whatwg.org/#parsing-main-inhead
    176      * @see WP_HTML_Processor_State::$insertion_mode
    177      *
    178      * @var string
    179      */
    180     const INSERTION_MODE_IN_HEAD = 'insertion-mode-in-head';
    181 
    182     /**
    183      * Before head insertion mode for full HTML parser.
    184      *
    185      * @since 6.7.0
    186      *
    187      * @see https://html.spec.whatwg.org/#parsing-main-beforehead
    188      * @see WP_HTML_Processor_State::$insertion_mode
    189      *
    190      * @var string
    191      */
    192     const INSERTION_MODE_BEFORE_HEAD = 'insertion-mode-before-head';
    193 
    194     /**
    195      * After head insertion mode for full HTML parser.
    196      *
    197      * @since 6.7.0
    198      *
    199      * @see https://html.spec.whatwg.org/#parsing-main-afterhead
    200      * @see WP_HTML_Processor_State::$insertion_mode
    201      *
    202      * @var string
    203      */
    204     const INSERTION_MODE_AFTER_HEAD = 'insertion-mode-after-head';
    205 
    206     /**
    207      * In template insertion mode for full HTML parser.
    208      *
    209      * @since 6.7.0
    210      *
    211      * @see https://html.spec.whatwg.org/#parsing-main-intemplate
    212      * @see WP_HTML_Processor_State::$insertion_mode
    213      *
    214      * @var string
    215      */
    216     const INSERTION_MODE_IN_TEMPLATE = 'insertion-mode-in-template';
     267     * After frameset insertion mode for full HTML parser.
     268     *
     269     * @since 6.7.0
     270     *
     271     * @see https://html.spec.whatwg.org/#parsing-main-afterframeset
     272     * @see WP_HTML_Processor_State::$insertion_mode
     273     *
     274     * @var string
     275     */
     276    const INSERTION_MODE_AFTER_FRAMESET = 'insertion-mode-after-frameset';
     277
     278    /**
     279     * After after body insertion mode for full HTML parser.
     280     *
     281     * @since 6.7.0
     282     *
     283     * @see https://html.spec.whatwg.org/#the-after-after-body-insertion-mode
     284     * @see WP_HTML_Processor_State::$insertion_mode
     285     *
     286     * @var string
     287     */
     288    const INSERTION_MODE_AFTER_AFTER_BODY = 'insertion-mode-after-after-body';
     289
     290    /**
     291     * After after frameset insertion mode for full HTML parser.
     292     *
     293     * @since 6.7.0
     294     *
     295     * @see https://html.spec.whatwg.org/#the-after-after-frameset-insertion-mode
     296     * @see WP_HTML_Processor_State::$insertion_mode
     297     *
     298     * @var string
     299     */
     300    const INSERTION_MODE_AFTER_AFTER_FRAMESET = 'insertion-mode-after-after-frameset';
     301
     302    /**
     303     * In foreign content insertion mode for full HTML parser.
     304     *
     305     * @since 6.7.0
     306     *
     307     * @see https://html.spec.whatwg.org/#parsing-main-inforeign
     308     * @see WP_HTML_Processor_State::$insertion_mode
     309     *
     310     * @var string
     311     */
     312    const INSERTION_MODE_IN_FOREIGN_CONTENT = 'insertion-mode-in-foreign-content';
    217313
    218314    /**
Note: See TracChangeset for help on using the changeset viewer.