[BUGFIX] Avoid exception with :last-of-type etc. #875
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This simply broadens the range of exceptions thrown by
symfony/css-selector
(for unsupported selector expressions) which will be caught and discarded in non-debug mode.It does not make anything magically work which didn't previously; however, it does allow the rest of the CSS to achieve full functionality, with only the affected CSS rule and selector suffering.
The tests and changes to the README clarify and correct-as-documented the current behaviour for these edge cases, which could be improved upon in future.
These are currently rarely-used CSS pseudo-classes; their level of support in mainstream browsers has only recently reached 95% of audiences. Their level of support in email clients is likely to be drasitcally lower per se for some time to come, but may be something Emogrifier can help with moving forwards, as their use becomes more widespread…
Closes #872. New issue #876 for follow-up.