2 Commits

Author SHA1 Message Date
Jake Dallimore
b63cb5b496 MDL-67097 libraries: add unit test verifying rtl directive failure case
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.
2019-11-06 08:57:27 +08:00
Jake Dallimore
5aa7d19615 MDL-67097 libraries: add unit tests for the core_rtlcss class
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.
2019-11-06 08:57:26 +08:00