[wp-trac] [WordPress Trac] #61974: HTML API: Add method to split text nodes by null or empty prefixes.

WordPress Trac noreply at wordpress.org
Mon Sep 2 23:19:23 UTC 2024


#61974: HTML API: Add method to split text nodes by null or empty prefixes.
--------------------------------------+----------------------
 Reporter:  dmsnell                   |       Owner:  dmsnell
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.7
Component:  HTML API                  |     Version:  trunk
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+----------------------
Changes (by dmsnell):

 * owner:  (none) => dmsnell
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58970" 58970]:
 {{{
 #!CommitTicketReference repository="" revision="58970"
 HTML API: Allow subdividing text nodes by meaningful prefixes.

 HTML parsing rules at times differentiate character tokens that are all
 null bytes, all whitespace, or other content. This patch introduces a new
 function which may be used to classify text node sub-regions and lead to
 more efficient application of these parsing rules.

 Further, when classified in this way, application code may skip some rules
 and decoding entirely, improving performance. For example, this can be
 used to ease the implementation of skipping inter-element whitespace,
 which is usually not rendered.

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

 Props dmsnell, jonsurrell.
 Fixes #61974.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61974#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list