Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #61531


Ignore:
Timestamp:
06/28/2024 07:21:47 PM (12 months ago)
Author:
jonsurrell
Comment:

After further review, it's difficult to determine exactly the correct behavior of these class methods should be. I've updated the summary to talk about auditing the behavior and I've changed the milestone to "future release."

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #61531

    • Property Summary changed from HTML API: Tag processor class name methods should behave consistently with case sensitivity to HTML API: Audit class name methods for consistency and correctness
    • Property Owner jonsurrell deleted
    • Property Milestone changed from 6.7 to Future Release
    • Property Keywords has-patch has-unit-tests added
    • Property Type changed from defect (bug) to enhancement
  • Ticket #61531 – Description

    initial v2  
    1 The Tag Processor CSS class name methods `class_list`, `add_class`, and `remove_class` should be consistent regarding case sensitivity.
     1The Tag Processor CSS class name methods `class_list`, `add_class`, `remove_class`, and `has_class`. These should behave consistently regarding case-sensistivity.
    22
    3 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.
     3These methods are intended to align with CSS class selectors. CSS class selector matching behavior is complicated and may depend on the document. This makes it difficult to determine the correct behavior for these methods.
    44
    5 - `add_class` should only add classes that are not already present (compared ASCII case-insensitive).
    6 - `remove_class` should remove all matching classes (compared ASCII case-insensitive).
    7 
    8 This was discussed with @dmsnell on Slack here: https://wordpress.slack.com/archives/C05NFB818PQ/p1719403633636769
    9 
    10 Related to #61520 which documents the lower-casing behavior of `class_list`.
     5At the moment, `class_list` yields ASCII lower-cased class names, but `remove_class` and `add_class` match case sensitive class names.