When a closing comment is used, such as when we wrap css with the
rtl:begin:ignore and rtl🔚ignore (the latter being the closing),
it is ignored in the following case:
- If the closing comment is the last item in a csslist like:
div {/*rtl:begin:ignore*/left:20px; text-align:left/*rtl🔚ignore*/}
in which case there is no css rule following the comment for it to be
associated with. It is therefore not seen and registered, meaning we
continue ignoring rtl (a bug).
In such cases, we should either:
- ensure the comment is not the final element in the css list
- use self-closing (/*rtl:ignore*/) comments for each rule instead.
- use a self-closing comment on the entire css list, if applicable.
The core_rtlcss class extends the \MoodleHQ\RTLCSS\RTLCSS class. This
upstream library had tests, but these were not included in core. This
change uses those test cases to test core_rtlcss, to make sure future
lib changes don't break the css parsing.