-
Notifications
You must be signed in to change notification settings - Fork 340
Closed
Labels
a-contentParsing and rendering Zulip HTML content, notably message contentsParsing and rendering Zulip HTML content, notably message contentsperformanceSmooth and responsive UI; fixing jank, stutters, and lagSmooth and responsive UI; fixing jank, stutters, and lag
Milestone
Description
Greg and I discovered on our call today that classes.contains
does some extra work:
/// Determine if this element contains the class [value].
///
/// This is the Dart equivalent of jQuery's
/// [hasClass](http://api.jquery.com/hasClass/).
@override
bool contains(Object? value) => readClasses().contains(value);
@override
Set<String> readClasses() {
final s = LinkedHashSet<String>();
final classname = _element.className;
for (var name in classname.split(' ')) {
final trimmed = name.trim();
if (trimmed.isNotEmpty) {
s.add(trimmed);
}
}
return s;
}
When we're checking that there are no classes, we should just check if className
is empty. When we're checking that there is one class, we should just do string equality on className
. When we're checking that there is more than one class, we might want to do a regular expression or something.
gnprice
Metadata
Metadata
Assignees
Labels
a-contentParsing and rendering Zulip HTML content, notably message contentsParsing and rendering Zulip HTML content, notably message contentsperformanceSmooth and responsive UI; fixing jank, stutters, and lagSmooth and responsive UI; fixing jank, stutters, and lag
Type
Projects
Status
Done