Make WordPress Core


Ignore:
Timestamp:
08/08/2024 07:23:53 AM (15 months ago)
Author:
dmsnell
Message:

HTML API: Add support for SVG and MathML (Foreign content)

As part of work to add more spec support to the HTML API, this patch adds
support for SVG and MathML elements, or more generally, "foreign content."

The rules in foreign content are a mix of XML and HTML parsing rules and
introduce additional complexity into the processor, but is important in
order to avoid getting lost when inside these elements.

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

Props: dmsnell, jonsurrell, westonruter.
See #61576.

File:
1 edited

Legend:

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

    r58836 r58867  
    301301
    302302    /**
    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';
    313 
    314     /**
    315303     * No-quirks mode document compatability mode.
    316304     *
Note: See TracChangeset for help on using the changeset viewer.