Changes between Initial Version and Version 2 of Ticket #61531
- Timestamp:
- 06/28/2024 07:21:47 PM (12 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #61531
-
Property
Summary
changed from
HTML API: Tag processor class name methods should behave consistently with case sensitivity
toHTML API: Audit class name methods for consistency and correctness
- Property Owner jonsurrell deleted
-
Property
Milestone
changed from
6.7
toFuture Release
- Property Keywords has-patch has-unit-tests added
-
Property
Type
changed from
defect (bug)
toenhancement
-
Property
Summary
changed from
-
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.1 The Tag Processor CSS class name methods `class_list`, `add_class`, `remove_class`, and `has_class`. These should behave consistently regarding case-sensistivity. 2 2 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.3 These 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. 4 4 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`. 5 At the moment, `class_list` yields ASCII lower-cased class names, but `remove_class` and `add_class` match case sensitive class names.