-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
View stringify utility should sort CSS classes and styles #4207
Comments
View utilities are sorting attribute names: |
I was talking about this with @oskarwrobel and @f1ames and have some doubts. Styles and classes order have a meaning in terms of CSS, so sorting the output might not be a good idea. Maybe instead of that, we should check why the output is different and fix issue there. |
But we want to do this only for tests. And I don't know any case where it would matter for real. Actually, I'm surprised that the order may matter. |
A nice summary that confirms what @szymonkups wrote and that explains cases when the order of CSS classes matters: https://stackoverflow.com/a/15672815/524419 |
OK, so it applies to Anyway, we're talking about a util we use in tests. So we don't have to be worried about such scenarios. Actually, I would say that CKEditor doesn't need to be worried about them at all. |
So, can I continue work on it? |
I think so. If the problem we're going to solve here is running tests in multiple browsers then sorting attrs in test utils will be a perfect helper. |
After introducing sorting the attributes/values, ~80 tests fail. Of course, we can fix these tests but I'm wondering whether we could use ckeditor/ckeditor5-core#108 and accept two versions of HTML (first for Edge, second for other browsers). It means this ticket will be invalid. We have only one test which fails because of the order values in |
So which tests fail after your change? |
A lot of in images and UI. |
Let's fix those ~80 tests. It will make them more stable and safe for the future. |
Fix: View stringify utility now sorts CSS classes and values in `style` attribute. Closes #1179.
One of test on Edge fails because of order of the styles don't match to defined in test:
We could sort everything.
The text was updated successfully, but these errors were encountered: