Updated: Comment #0
Problem/Motivation
In Drupal 7, drupal.js, jquery.js and Drupal.settings were added to all pages, with no way to turn it off. This was reported in #1279226: jQuery and Drupal JavaScript libraries and settings are output even when no JS is added to the page. It was fixed by requiring that each piece of JS declares its dependencies, using the library system: #1737148: Explicitly declare all JS dependencies, don't use drupal_add_js. Hurray!
Sadly, this is now broken, because we weren't carefully watching this. Because we didn't have test coverage.
(I broke this: #2120117: drupalSettings.user.uid added to page even if there is no other JS; drupal.node-new-comments-link lib added for anon users.)
Proposed resolution
Write test to ensure this does not happen again.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Related Issues
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | test_no_js_anon_standard-2120457-10.patch | 2.93 KB | wim leers |
| #10 | interdiff.txt | 1023 bytes | wim leers |
| #1 | test_no_js_anon_standard-2120457-1.patch | 2.7 KB | wim leers |
Comments
Comment #1
wim leersThis patch should fail, because it's currently broken in HEAD. Once #2120117: drupalSettings.user.uid added to page even if there is no other JS; drupal.node-new-comments-link lib added for anon users lands, this patch should be re-tested and it should come back green.
Comment #3
wim leersYay, the expected failure! :P
Comment #4
nod_So it's actually postponed on #2120117: drupalSettings.user.uid added to page even if there is no other JS; drupal.node-new-comments-link lib added for anon users then. Or maybe it's worth merging the two directly?
Comment #5
wim leersIndeed postponed on that issue.
Let's not merge them; they have different goals.
Comment #6
catchComment #7
catch#1: test_no_js_anon_standard-2120457-1.patch queued for re-testing.
Comment #8
nod_Perfect :)
Comment #9
webchickThe name and description of the test are out of sync with what the test is asserting.
Since this needs a small re-roll anyway to add some docs to the assertion function, could these docs explain why the shiv is ok?
Comment #10
wim leersI don't see what's wrong with the name and description of the test at all?
Docs added to explain why the HTML5 shiv is ok.
Comment #11
catchI think Angie means that the description says 'no JavaScript' but the actual test ensures that only the html5shiv is loaded - so it's not really 'no javascript'.
Comment #12
wim leers#11: Well… the goal really is "no JavaScript". And the fact is that in every browser except IE 6, 7 and 8, no JavaScript is loaded! So for all intents and purposes, Drupal is not loading any JavaScript: there's no Drupal-specific behaviors or logic or magic being added, only a small piece of JS to make a crappy browser not break completely.
Once we drop IE8 support entirely, the HTML5 shiv will go away as well.
So I think the name is still accurate.
Comment #13
nod_FYI: core: #1993334: Add HTML5shiv to Stable and Classy only , ie8 module #1999948: Add HTML5shiv.
Comment #14
catchOK I think that's reasonable, will leave this for a day or so in case Angie disagrees.
Comment #15
webchick"+ * The HTML5 shiv is necessary for e.g. the tag which Drupal 8 uses
+ * to work in older browsers like Internet Explorer 8."
Cool, I think that covers it, thanks.
Committed and pushed to 8.x!
Comment #16
wim leersHurray :)