- CSS can be conditionally loaded for limited
'browsers'(e.g., IE) only, but JS cannot.
- cannot be done without conditional comment support for JS.
- Make it consistent with drupal_add_css
- Hacking a #browsers condition into the current code of drupal_get_js() doesn't really make sense.
- Instead, further align drupal_get_js() with drupal_get_css(), as originally proposed in already.
- Introduce #type 'scripts' -- equivalent to existing #type 'styles'.
- As already the case for #type 'styles' / drupal_get_css(), properly separate the current processing of JS into a #group_callback and #aggregate_callback.
Side-benefit: Default behavior can be changed and improved in contrib.
- Only do the necessary to align #type 'scripts' with 'styles', and to introduce support for 'browsers'.
A major long-term benefit of doing so is that we're finally able to abstract and merge further parts of the #group_callback and #aggregate_callback logic into common helper functions -- paving the way to get to the long-standing idea of having a single generalized system for "support files"/"page requisites" in Drupal core.
The last patch submitted #136 has been RTBC.
This patch does everything proposed. It also passed all the JS test, and a couple of new test were added.
Seems good to go.
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 865536-D7-229-PASS.patch. Unable to apply patch. See the log in the details link for more information.
FAILED: [[SimpleTest]]: [MySQL] 40,709 pass(es), 4 fail(s), and 0 exception(s).
FAILED: [[SimpleTest]]: [MySQL] 39,003 pass(es), 2 fail(s), and 0 exception(s).