Again, another maintenance release for DTCoreText and DTRichTextEditorwhich mostly addresses issues introduced by the recent CSS handling rewrite. It also further enhances support for CSS style cascading.
- FIXED: Out of Memory crash on certain HTML documents extensively using CSS cascading
- FIXED: CSS Cascading by element name performance problem
- FIXED: Issue with font-size doubling in some situations due to CSS selector being applied
- FIXED: Last line in a list might lose the tab stops
- FIXED: glyph run has wrong stringRange for hyphenated lines
- FIXED: all failing unit tests
- ADDED: Single Selector Cascading
- ADDED: Many unit tests for CSS Cascading
- ADDED: Travis-CI for automated testing of pull requests
- CHANGED: CSS selector matching now evaluates specificity
- FIXED: Pasting from Google Drive might yield empty content
- CHANGED: Updated DTCoreText to 1.6.6
This release’s MVP is again Amro Mousa who fixed and enhanced all that was related to CSS Cascading. Amro rewrote the matching engine and this improved parsing performance several orders of magnitude. Specifically the specificity is a very complex topic but apparently Amro has mastered that as well.
I would also like to highlight the tab stop issue. This was a great catch by Thomas Torp. This caused a funny issue for some people building for platforms which allow zeroing-weak-references. I am using DT_WEAK_VARIABLE to denote variables as weak where the deployment target permits that (>= iOS 5). Strangely there seemed to be a situation where a weak CFArrayRef would become nil and thus the array would be assigned as nil.
On the left you see the corrected code, on the right the original. Honestly I don’t quite understand why it would do that. If you have an answer to this riddle please let me know in the comments.
The new version is tagged on GitHub as well as available via CocoaPods.