[wp-trac] [WordPress Trac] #61531: HTML API: Tag processor class name methods should behave consistently with case sensitivity

WordPress Trac noreply at wordpress.org
Fri Jun 28 12:58:49 UTC 2024


#61531: HTML API: Tag processor class name methods should behave consistently with
case sensitivity
--------------------------+------------------------
 Reporter:  jonsurrell    |      Owner:  jonsurrell
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  6.7
Component:  HTML API      |    Version:  6.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+------------------------
 The Tag Processor CSS class name methods `class_list`, `add_class`, and
 `remove_class` should be consistent regarding case sensitivity.

 These methods are intended to align with CSS class names, meaning that
 matching should be done ASCII case-insensitive. `class_list` already
 yields lower case unique class names, but `remove_class` and `add_class`
 do not have similar behavior of treating case-insensitive matching classes
 as equal.

 - `add_class` should only add classes that are not already present
 (compared ASCII case-insensitive).
 - `remove_class` should remove all matching classes (compared ASCII case-
 insensitive).

 This was discussed with @dmsnell on Slack here:
 https://wordpress.slack.com/archives/C05NFB818PQ/p1719403633636769

 Related to #61520 which documents the lower-casing behavior of
 `class_list`.

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


More information about the wp-trac mailing list