-
Notifications
You must be signed in to change notification settings - Fork 12
"Cuts the Mustard" test #88
Comments
+1 Although I think you could then remove |
Actually +10 for all of that - can I do ten? |
I think also we should recommend that product developers take a versioned library that encapsulates CTM in case it changes in the future. If it does change we will mandate the change and we ought to make that easy to do. I know it's just one line of code but I think in reality forcing the change won't be so easy to manage. Also this could be nicely wrapped into Modernizr like so Modernizr.add('ctm', function(){
return ('classList' in document.createElement('div') && 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window);
});
var cuts_the_mustard = Modernizr.ctm; And on the DOM as feature clases <html class="ctm"> or <html class="no-ctm"> This relates to #86 in that developers could add |
Yet to establish whether modernizr can be included in Origami builds, but in principle it seems like a good idea to have a versioned bootstrap that loads the bundle. Would a gist be the best way of presenting that? Then it can be included in the docs, but updated as necessary. |
Can I just check whether we mean no Origami javascript will run, or no javascript at all? |
Product developers are free to do whatever they like (Origami principle 4!) so it's just origami modules that would be restricted in this way. In practice, I would hope they'd choose to put their JS in the same bundle, so it would apply to theirs as well. |
OK, yep make sense. In that case, revealing the content of the |
Why? Is allowing this statement to be true the thing that's complicated? Otherwise it's trivial to add |
Yep, that bit is trivial (and I did say 'slightly more complicated' :-)) But it does mean there's a greater number of circumstances:
BTW, I'm all for the approach proposed in this issue, although I'm concerned it'll be a barrier for adoption of Origami components by products. |
Just to clarify my last comment. Dan said my last one didn't make sense ;-) I would prefer not to have this case:
Why would you want to prevent some |
Well, ads spring to mind. If ft-cms were to start using some Origami modules and used the CTM test to determine whether to run those modules' JS, then if the CTM test failed, you wouldn't want the ads' |
So for script libraries we don't have control of? And do we have control of the |
For ads in ft-cms we do. But that was just one example.
|
This isn't strictly within the Origami realm - we simply advise the product developer when they're allowed to load the Origami components. But I think our suggested class should simply be |
Late arriving at this discussion, but I can see a couple of issues that perhaps aren't addressed above:
So, how about something like the following:
|
See #86 for modernizr discussion. This issue is about what we recommend as a good CTM test. |
As part of the fallbacks and polyfills discussion we now have a mechanism for modules to declare their requirements, so we no longer need an explicit CTM test to be recommended by Origami, but we can still provide a recommendation for a mechanism for running a test. |
We need to define what our CTM test is, so that Origami JavaScript authors know what baseline functionality they can rely on.
The BBC, who invented the expression, use the following test:
They say that the oldest browsers that support this are:
I propose we throw in classList as well:
The additional browsers this kicks out vs the BBC's test are:
We propose that absolutely no Origami JavaScript will be run in browsers that fail this test. In order to run no JavaScript in these browsers, our non-JS experience has to be good, ie it must be possible to log in, see your sign in status, read articles, use the paywall, see ads and tracking has to work too.
Therefore it's proposed that we split our browser support strategy into CSS and JavaScript lists. The current primary, secondary and unsupported scheme continues to apply in respect of CSS, and therefore the quality of the visual style, and a new, second standard is created for JavaScript with only two levels: cuts the mustard, and doesn't. Only browsers that cut the mustard will have JavaScript-powered features. So, for example, IE9 will look visually perfect, but won't have flyout menus, overlays, animations or (possibly) comments.
This proposal is also taking into account that there will be a lag before we see Origami components used in production, and in that time, the non-compliant browsers will further reduce their share.
Since they're not on Github, I'm soliciting feedback on this from Dan Skinner, Tom Betts and Jay Sethi by email.
The text was updated successfully, but these errors were encountered: