Issues with css optimization on WebKit browsers
-
Hello and thank you for Autoptimize,
I’m having some trouble and I’m hoping you can be of assistance.
You can reproduce the issue by installing the BuddyPress and bbPress plugins and then opening the BuddyPress registration page (“/register/” by default) in a WebKit browser like Safari (or Midori if you’re on Linux or Windows).
Without the bbPress plugin, the page looks fine and when you submit the empty registration form (registrations must be allowed in WordPress options for the form to show), error messages will appear in bright red boxes. With the bbPress plugin activated, when you submit the empty form, the red boxes will be missing. There are some other visual changes as well, but this one is the most noticeable.
Now, I know I can exclude bbpress.css from optimization, which fixes these display issues, but since this isn’t the only issue I’m having with WebKit and Autoptimize, I’m suspecting this may be symptomatic of a more general problem. This was the first instance I managed to isolate enough for you to easily reproduce.
I have noticed that both bbPress and BuddyPress enqueue their css for media type screen and I found your post on fixing css media types impacting autoptimized css order. I used the autoptimize_filter_css_tagmedia filter, mentioned in that post, to set the media type of bbpress.css to “all”, just to test whether that might help. It didn’t. Instead it messed up the layout of the whole page for some reason (tested with vanilla TwentySeventeen and a custom child theme of TentyFifteen). But again, only for WebKit. It looks just fine in Firefox.
It would seem that WebKit css processing differs in some important way from other engines. Since WebKit, especially as Safari (and Safari Mobile), make for a significant percentage of web browsers, it might be worth looking into this.
BTW, the issue was also present in the upcoming Autoptimize 2.2 when I last tested it.
Thanks in advance.
- The topic ‘Issues with css optimization on WebKit browsers’ is closed to new replies.