*/
static List<Patch> diff(Element context, NativeArray<Style> prev, NativeArray<Style> next) {
List<Patch> patches = new ArrayList();
for (int i = 0, length = next.length(); i < length; i++) {
Style nextClass = next.get(i);
int prevIndex = prev.indexOf(nextClass);
if (prevIndex == -1) {
patches.add(new AddClass(context, nextClass));
}
}
for (int i = 0, length = prev.length(); i < length; i++) {
Style prevClass = prev.get(i);
if (next.indexOf(prevClass) == -1) {
patches.add(new RemoveClass(context, prevClass));
}
}