Make WordPress Core


Ignore:
Timestamp:
07/02/2024 09:45:18 PM (9 months ago)
Author:
dmsnell
Message:

HTML API: Add missing insertion mode constants.

As the HTML Processor starts to support other insertion modes outside of
"IN BODY" it needs to be aware of those other modes. This patch
introduces the missing insertion modes in preparation for adding that
support.

Extracted as necessary prep work to the following more complete change:
https://github.com/WordPress/wordpress-develop/pull/6020

Props jonsurrell.
See #61549.

File:
1 edited

Legend:

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

    r56558 r58631  
    6161
    6262    /**
     63     * In select insertion mode for full HTML parser.
     64     *
     65     * @since 6.7.0
     66     *
     67     * @see https://html.spec.whatwg.org/#parsing-main-inselect
     68     * @see WP_HTML_Processor_State::$insertion_mode
     69     *
     70     * @var string
     71     */
     72    const INSERTION_MODE_IN_SELECT = 'insertion-mode-in-select';
     73
     74    /**
     75     * In select in table insertion mode for full HTML parser.
     76     *
     77     * @since 6.7.0
     78     *
     79     * @see https://html.spec.whatwg.org/#parsing-main-inselectintable
     80     * @see WP_HTML_Processor_State::$insertion_mode
     81     *
     82     * @var string
     83     */
     84    const INSERTION_MODE_IN_SELECT_IN_TABLE = 'insertion-mode-in-select-in-table';
     85
     86    /**
     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';
     157
     158    /**
     159     * In frameset insertion mode for full HTML parser.
     160     *
     161     * @since 6.7.0
     162     *
     163     * @see https://html.spec.whatwg.org/#parsing-main-inframeset
     164     * @see WP_HTML_Processor_State::$insertion_mode
     165     *
     166     * @var string
     167     */
     168    const INSERTION_MODE_IN_FRAMESET = 'insertion-mode-in-frameset';
     169
     170    /**
     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';
     217
     218    /**
    63219     * Tracks open elements while scanning HTML.
    64220     *
Note: See TracChangeset for help on using the changeset viewer.