[wp-trac] [WordPress Trac] #62653: Add CSS selector based tag navigation to HTML and Tag Processors

WordPress Trac noreply at wordpress.org
Thu Dec 5 18:34:50 UTC 2024


#62653: Add CSS selector based tag navigation to HTML and Tag Processors
-----------------------------+-----------------------------
 Reporter:  jonsurrell       |      Owner:  (none)
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  HTML API         |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 CSS selectors provide an excellent way to navigate through an HTML
 document. They are a familiar and interface for many web developers to
 navigate elements in a page and fit well with the HTML API. They're a core
 concept in the Block API where attributes may be sourced based on a
 selector.

 [https://github.com/WordPress/wordpress-develop/pull/6388 HTML API: Add
 attribute sourcing] describes some of the needs based on selectors used in
 existing Core blocks:

 {{{
 .blocks-gallery-caption
 .blocks-gallery-item
 .blocks-gallery-item__caption
 .book-author
 .message
 a
 a[download]
 audio
 blockquote
 cite
 code
 div
 figcaption
 figure > a
 figure a
 figure img
 figure video,figure img
 h1,h2,h3,h4,h5,h6
 img
 li
 ol,ul
 p
 pre
 tbody tr
 td,th
 tfoot tr
 thead tr
 video
 }}}

 Some use cases:

 - [https://developer.wordpress.org/block-editor/reference-guides/block-api
 /block-attributes/ Block attributes] use CSS selectors to access data in
 HTML.
 - The Block Bindings project depends on selectors. It currently has a
 temporary and limited solution that covers only the most basic selectors.
 Switching to a more full-featured implementation via HTML API CSS
 Selectors is [https://github.com/WordPress/gutenberg/issues/67520 part of
 the roadmap] and is necessary for expanding block bindings to support more
 blocks.
 - [https://github.com/WordPress/gutenberg/issues/63037 It's part of the
 HTML API roadmap] - "Continue developing block attribute sourcing." in the
 linked issue
 - It's featured on [https://github.com/WordPress/gutenberg/issues/62437
 Dennis' list of broad and interesting things.] as "Add the ability to read
 block attributes on the server which are "sourced" from the block's HTML,
 as described in a block.json file. [#6388]


 Prior work:
 - [https://github.com/WordPress/gutenberg/pull/46345 WIP: Introduce class
 for sourcing block attributes from HTML]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62653>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list