Commit 37c3c7ec authored by Dries's avatar Dries

- Patch #769226 by Owen Barton, alanburke, sun: fixed JS/CSS preprocess should default to FALSE.

parent 4f2d6969
...@@ -2642,27 +2642,26 @@ function drupal_add_html_head_link($attributes, $header = FALSE) { ...@@ -2642,27 +2642,26 @@ function drupal_add_html_head_link($attributes, $header = FALSE) {
* Calling drupal_static_reset('drupal_add_css') will clear all cascading * Calling drupal_static_reset('drupal_add_css') will clear all cascading
* stylesheets added so far. * stylesheets added so far.
* *
* If preprocessing is turned on, the cascading style sheets added using this * If CSS aggregation/compression is enabled, all cascading style sheets added
* function will be preprocessed before they are added to the HTML header of the * with $options['preprocess'] set to TRUE will be merged into one aggregate
* page. Preprocessing merges all the CSS files into one file, which is then * file and compressed by removing all extraneous white space.
* compressed by removing all extraneous white space. Note that preprocessed * Preprocessed inline stylesheets will not be aggregated into this single file;
* inline stylesheets will not be aggregated into this single file; instead, * instead, they are just compressed upon output on the page. Externally hosted
* they will just be compressed when being output on the page. External * stylesheets are never aggregated or compressed.
* stylesheets will also not be aggregated. *
* * The reason for aggregating the files is outlined quite thoroughly here:
* The reason for merging the CSS files is outlined quite thoroughly here:
* http://www.die.net/musings/page_load_time/ "Load fewer external objects. Due * http://www.die.net/musings/page_load_time/ "Load fewer external objects. Due
* to request overhead, one bigger file just loads faster than two smaller ones * to request overhead, one bigger file just loads faster than two smaller ones
* half its size." * half its size."
* *
* However, you should *not* preprocess every file as this can lead to redundant * $options['preprocess'] should be only set to TRUE when a file is required for
* caches. You should set $options['preprocess'] to FALSE when your styles are * all typical visitors and most pages of a site. It is critical that all
* only used on a few pages of the site. This could be a special admin page, the * preprocessed files are added unconditionally on every page, even if the
* homepage, or a handful of pages that does not represent the majority of the * files do not happen to be needed on a page. This is normally done by calling
* pages on your site. * drupal_add_css() in a hook_init() implementation.
* *
* Typical candidates for preprocessing are for example styles for nodes across * Non-preprocessed files should only be added to the page when they are
* the site, or styles used in the theme. * actually needed.
* *
* @param $data * @param $data
* (optional) The stylesheet data to be added, depending on what is passed * (optional) The stylesheet data to be added, depending on what is passed
...@@ -2710,9 +2709,8 @@ function drupal_add_html_head_link($attributes, $header = FALSE) { ...@@ -2710,9 +2709,8 @@ function drupal_add_html_head_link($attributes, $header = FALSE) {
* always come last. * always come last.
* - 'media': The media type for the stylesheet, e.g., all, print, screen. * - 'media': The media type for the stylesheet, e.g., all, print, screen.
* Defaults to 'all'. * Defaults to 'all'.
* - 'preprocess': If TRUE, Allows the CSS to be aggregated and compressed if * - 'preprocess': If TRUE and CSS aggregation/compression is enabled, the
* the Optimize CSS feature has been turned on under the performance * styles will be aggregated and compressed. Defaults to FALSE.
* section. Defaults to TRUE.
* - 'browsers': An array containing information specifying which browsers * - 'browsers': An array containing information specifying which browsers
* should load the CSS item. See drupal_pre_render_conditional_comments() * should load the CSS item. See drupal_pre_render_conditional_comments()
* for details. * for details.
...@@ -2740,7 +2738,7 @@ function drupal_add_css($data = NULL, $options = NULL) { ...@@ -2740,7 +2738,7 @@ function drupal_add_css($data = NULL, $options = NULL) {
'type' => 'file', 'type' => 'file',
'weight' => CSS_DEFAULT, 'weight' => CSS_DEFAULT,
'media' => 'all', 'media' => 'all',
'preprocess' => TRUE, 'preprocess' => FALSE,
'data' => $data, 'data' => $data,
'browsers' => array(), 'browsers' => array(),
); );
...@@ -3576,6 +3574,25 @@ function drupal_region_class($region) { ...@@ -3576,6 +3574,25 @@ function drupal_region_class($region) {
* Calling drupal_static_reset('drupal_add_js') will clear all JavaScript added * Calling drupal_static_reset('drupal_add_js') will clear all JavaScript added
* so far. * so far.
* *
* If JavaScript aggregation is enabled, all JavaScript files added with
* $options['preprocess'] set to TRUE will be merged into one aggregate file.
* Preprocessed inline JavaScript will not be aggregated into this single file.
* Externally hosted JavaScripts are never aggregated.
*
* The reason for aggregating the files is outlined quite thoroughly here:
* http://www.die.net/musings/page_load_time/ "Load fewer external objects. Due
* to request overhead, one bigger file just loads faster than two smaller ones
* half its size."
*
* $options['preprocess'] should be only set to TRUE when a file is required for
* all typical visitors and most pages of a site. It is critical that all
* preprocessed files are added unconditionally on every page, even if the
* files are not needed on a page. This is normally done by calling
* drupal_add_css() in a hook_init() implementation.
*
* Non-preprocessed files should only be added to the page when they are
* actually needed.
*
* @param $data * @param $data
* (optional) If given, the value depends on the $options parameter: * (optional) If given, the value depends on the $options parameter:
* - 'file': Path to the file relative to base_path(). * - 'file': Path to the file relative to base_path().
...@@ -3617,9 +3634,8 @@ function drupal_region_class($region) { ...@@ -3617,9 +3634,8 @@ function drupal_region_class($region) {
* - cache: If set to FALSE, the JavaScript file is loaded anew on every page * - cache: If set to FALSE, the JavaScript file is loaded anew on every page
* call; in other words, it is not cached. Used only when 'type' references * call; in other words, it is not cached. Used only when 'type' references
* a JavaScript file. Defaults to TRUE. * a JavaScript file. Defaults to TRUE.
* - preprocess: Aggregate the JavaScript if the JavaScript optimization * - preprocess: If TRUE and JavaScript aggregation is enabled, the script
* setting has been toggled in admin/config/development/performance. Note * file will be aggregated. Defaults to FALSE.
* that JavaScript of type 'external' is not aggregated. Defaults to TRUE.
* *
* @return * @return
* The current array of JavaScript files, settings, and in-line code, * The current array of JavaScript files, settings, and in-line code,
...@@ -3712,7 +3728,7 @@ function drupal_js_defaults($data = NULL) { ...@@ -3712,7 +3728,7 @@ function drupal_js_defaults($data = NULL) {
'scope' => 'header', 'scope' => 'header',
'cache' => TRUE, 'cache' => TRUE,
'defer' => FALSE, 'defer' => FALSE,
'preprocess' => TRUE, 'preprocess' => FALSE,
'version' => NULL, 'version' => NULL,
'data' => $data, 'data' => $data,
); );
......
...@@ -1775,7 +1775,7 @@ function _locale_rebuild_js($langcode = NULL) { ...@@ -1775,7 +1775,7 @@ function _locale_rebuild_js($langcode = NULL) {
*/ */
function _locale_translate_language_list($translation, $limit_language) { function _locale_translate_language_list($translation, $limit_language) {
// Add CSS. // Add CSS.
drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', array('preprocess' => FALSE)); drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css');
$languages = language_list(); $languages = language_list();
unset($languages['en']); unset($languages['en']);
......
...@@ -164,7 +164,7 @@ function _drupal_theme_initialize($theme, $base_theme = array(), $registry_callb ...@@ -164,7 +164,7 @@ function _drupal_theme_initialize($theme, $base_theme = array(), $registry_callb
// And now add the stylesheets properly // And now add the stylesheets properly
foreach ($final_stylesheets as $media => $stylesheets) { foreach ($final_stylesheets as $media => $stylesheets) {
foreach ($stylesheets as $stylesheet) { foreach ($stylesheets as $stylesheet) {
drupal_add_css($stylesheet, array('weight' => CSS_THEME, 'media' => $media)); drupal_add_css($stylesheet, array('weight' => CSS_THEME, 'media' => $media, 'preprocess' => TRUE));
} }
} }
...@@ -189,7 +189,7 @@ function _drupal_theme_initialize($theme, $base_theme = array(), $registry_callb ...@@ -189,7 +189,7 @@ function _drupal_theme_initialize($theme, $base_theme = array(), $registry_callb
// Add scripts used by this theme. // Add scripts used by this theme.
foreach ($final_scripts as $script) { foreach ($final_scripts as $script) {
drupal_add_js($script, array('weight' => JS_THEME)); drupal_add_js($script, array('weight' => JS_THEME, 'preprocess' => TRUE));
} }
$theme_engine = NULL; $theme_engine = NULL;
......
...@@ -286,7 +286,7 @@ function _aggregator_category_title($category) { ...@@ -286,7 +286,7 @@ function _aggregator_category_title($category) {
* Implements hook_init(). * Implements hook_init().
*/ */
function aggregator_init() { function aggregator_init() {
drupal_add_css(drupal_get_path('module', 'aggregator') . '/aggregator.css'); drupal_add_css(drupal_get_path('module', 'aggregator') . '/aggregator.css', array('preprocess' => TRUE));
} }
/** /**
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Menu callback for admin/structure/block/demo. * Menu callback for admin/structure/block/demo.
*/ */
function block_admin_demo($theme = NULL) { function block_admin_demo($theme = NULL) {
drupal_add_css(drupal_get_path('module', 'block') . '/block.css', array('preprocess' => FALSE)); drupal_add_css(drupal_get_path('module', 'block') . '/block.css');
return ''; return '';
} }
...@@ -53,7 +53,7 @@ function block_admin_display($theme = NULL) { ...@@ -53,7 +53,7 @@ function block_admin_display($theme = NULL) {
*/ */
function block_admin_display_form($form, &$form_state, $blocks, $theme) { function block_admin_display_form($form, &$form_state, $blocks, $theme) {
drupal_add_css(drupal_get_path('module', 'block') . '/block.css', array('preprocess' => FALSE)); drupal_add_css(drupal_get_path('module', 'block') . '/block.css');
$block_regions = system_region_list($theme, REGIONS_VISIBLE) + array(BLOCK_REGION_NONE => '<' . t('none') . '>'); $block_regions = system_region_list($theme, REGIONS_VISIBLE) + array(BLOCK_REGION_NONE => '<' . t('none') . '>');
......
...@@ -222,7 +222,7 @@ function book_admin_paths() { ...@@ -222,7 +222,7 @@ function book_admin_paths() {
* Implements hook_init(). * Implements hook_init().
*/ */
function book_init() { function book_init() {
drupal_add_css(drupal_get_path('module', 'book') . '/book.css'); drupal_add_css(drupal_get_path('module', 'book') . '/book.css', array('preprocess' => TRUE));
} }
/** /**
......
...@@ -189,7 +189,7 @@ function color_scheme_form($complete_form, &$form_state, $theme) { ...@@ -189,7 +189,7 @@ function color_scheme_form($complete_form, &$form_state, $theme) {
), ),
// Add custom CSS. // Add custom CSS.
'css' => array( 'css' => array(
$base . '/color.css' => array('preprocess' => FALSE), $base . '/color.css' => array(),
), ),
// Add custom JavaScript. // Add custom JavaScript.
'js' => array( 'js' => array(
......
...@@ -289,6 +289,13 @@ function comment_menu() { ...@@ -289,6 +289,13 @@ function comment_menu() {
return $items; return $items;
} }
/**
* Implements hook_init().
*/
function comment_init() {
drupal_add_css(drupal_get_path('module', 'comment') . '/comment.css', array('preprocess' => TRUE));
}
/** /**
* Implements hook_menu_alter(). * Implements hook_menu_alter().
*/ */
...@@ -716,7 +723,6 @@ function comment_node_page_additions($node) { ...@@ -716,7 +723,6 @@ function comment_node_page_additions($node) {
$comments = comment_load_multiple($cids); $comments = comment_load_multiple($cids);
comment_prepare_thread($comments); comment_prepare_thread($comments);
$build = comment_view_multiple($comments, $node); $build = comment_view_multiple($comments, $node);
$build['#attached']['css'][] = drupal_get_path('module', 'comment') . '/comment.css';
$build['pager']['#theme'] = 'pager'; $build['pager']['#theme'] = 'pager';
$additions['comments'] = $build; $additions['comments'] = $build;
} }
......
...@@ -91,7 +91,7 @@ function dblog_menu() { ...@@ -91,7 +91,7 @@ function dblog_menu() {
function dblog_init() { function dblog_init() {
if (arg(0) == 'admin' && arg(1) == 'reports') { if (arg(0) == 'admin' && arg(1) == 'reports') {
// Add the CSS for this module // Add the CSS for this module
drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css', array('preprocess' => FALSE)); drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css');
} }
} }
......
...@@ -542,7 +542,6 @@ function field_attach_form($entity_type, $entity, &$form, &$form_state, $langcod ...@@ -542,7 +542,6 @@ function field_attach_form($entity_type, $entity, &$form, &$form_state, $langcod
// Add custom weight handling. // Add custom weight handling.
list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
$form['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css';
$form['#pre_render'][] = '_field_extra_fields_pre_render'; $form['#pre_render'][] = '_field_extra_fields_pre_render';
$form['#entity_type'] = $entity_type; $form['#entity_type'] = $entity_type;
$form['#bundle'] = $bundle; $form['#bundle'] = $bundle;
...@@ -1129,9 +1128,6 @@ function field_attach_view($entity_type, $entity, $view_mode, $langcode = NULL) ...@@ -1129,9 +1128,6 @@ function field_attach_view($entity_type, $entity, $view_mode, $langcode = NULL)
$output['#entity_type'] = $entity_type; $output['#entity_type'] = $entity_type;
$output['#bundle'] = $bundle; $output['#bundle'] = $bundle;
// Include CSS styles.
$output['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css';
// Let other modules alter the renderable array. // Let other modules alter the renderable array.
$context = array( $context = array(
'entity_type' => $entity_type, 'entity_type' => $entity_type,
......
...@@ -165,6 +165,13 @@ function field_theme() { ...@@ -165,6 +165,13 @@ function field_theme() {
); );
} }
/**
* Implements hook_init().
*/
function field_init() {
drupal_add_css(drupal_get_path('module', 'field') . '/theme/field.css', array('preprocess' => TRUE));
}
/** /**
* Implements hook_cron(). * Implements hook_cron().
* *
...@@ -811,7 +818,6 @@ function field_view_field($entity_type, $entity, $field_name, $display = array() ...@@ -811,7 +818,6 @@ function field_view_field($entity_type, $entity, $field_name, $display = array()
if (isset($result[$field_name])) { if (isset($result[$field_name])) {
$output = $result[$field_name]; $output = $result[$field_name];
$output['#attached']['css'][] = drupal_get_path('module', 'field') . '/theme/field.css';
} }
} }
......
...@@ -221,7 +221,7 @@ function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) { ...@@ -221,7 +221,7 @@ function forum_menu_local_tasks_alter(&$data, $router_item, $root_path) {
* Implements hook_init(). * Implements hook_init().
*/ */
function forum_init() { function forum_init() {
drupal_add_css(drupal_get_path('module', 'forum') . '/forum.css'); drupal_add_css(drupal_get_path('module', 'forum') . '/forum.css', array('preprocess' => TRUE));
} }
/** /**
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
*/ */
function help_main() { function help_main() {
// Add CSS // Add CSS
drupal_add_css(drupal_get_path('module', 'help') . '/help.css', array('preprocess' => FALSE)); drupal_add_css(drupal_get_path('module', 'help') . '/help.css');
$output = '<h2>' . t('Help topics') . '</h2><p>' . t('Help is available on the following items:') . '</p>' . help_links_as_list(); $output = '<h2>' . t('Help topics') . '</h2><p>' . t('Help is available on the following items:') . '</p>' . help_links_as_list();
return $output; return $output;
} }
......
...@@ -16,7 +16,7 @@ function image_style_list() { ...@@ -16,7 +16,7 @@ function image_style_list() {
$page['image_style_list'] = array( $page['image_style_list'] = array(
'#markup' => theme('image_style_list', array('styles' => $styles)), '#markup' => theme('image_style_list', array('styles' => $styles)),
'#attached' => array( '#attached' => array(
'css' => array(drupal_get_path('module', 'image') . '/image.admin.css' => array('preprocess' => FALSE)), 'css' => array(drupal_get_path('module', 'image') . '/image.admin.css' => array()),
), ),
); );
...@@ -48,7 +48,7 @@ function image_style_form($form, &$form_state, $style) { ...@@ -48,7 +48,7 @@ function image_style_form($form, &$form_state, $style) {
$form_state['image_style'] = $style; $form_state['image_style'] = $style;
$form['#tree'] = TRUE; $form['#tree'] = TRUE;
$form['#attached']['css'][drupal_get_path('module', 'image') . '/image.admin.css'] = array('preprocess' => FALSE); $form['#attached']['css'][drupal_get_path('module', 'image') . '/image.admin.css'] = array();
// Show the thumbnail preview. // Show the thumbnail preview.
$form['preview'] = array( $form['preview'] = array(
...@@ -383,7 +383,7 @@ function image_effect_form($form, &$form_state, $style, $effect) { ...@@ -383,7 +383,7 @@ function image_effect_form($form, &$form_state, $style, $effect) {
} }
$form['#tree'] = TRUE; $form['#tree'] = TRUE;
$form['#attached']['css'][drupal_get_path('module', 'image') . '/image.admin.css'] = array('preprocess' => FALSE); $form['#attached']['css'][drupal_get_path('module', 'image') . '/image.admin.css'] = array();
if (function_exists($effect['form callback'])) { if (function_exists($effect['form callback'])) {
$form['data'] = call_user_func($effect['form callback'], $effect['data']); $form['data'] = call_user_func($effect['form callback'], $effect['data']);
} }
......
...@@ -784,7 +784,7 @@ function locale_translate_overview_screen() { ...@@ -784,7 +784,7 @@ function locale_translate_overview_screen() {
*/ */
function locale_translate_seek_screen() { function locale_translate_seek_screen() {
// Add CSS. // Add CSS.
drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', array('preprocess' => FALSE)); drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css');
$elements = drupal_get_form('locale_translation_filter_form'); $elements = drupal_get_form('locale_translation_filter_form');
$output = drupal_render($elements); $output = drupal_render($elements);
......
...@@ -1998,7 +1998,7 @@ function _node_custom_theme() { ...@@ -1998,7 +1998,7 @@ function _node_custom_theme() {
* Implements hook_init(). * Implements hook_init().
*/ */
function node_init() { function node_init() {
drupal_add_css(drupal_get_path('module', 'node') . '/node.css'); drupal_add_css(drupal_get_path('module', 'node') . '/node.css', array('preprocess' => TRUE));
} }
function node_last_changed($nid) { function node_last_changed($nid) {
......
...@@ -31,7 +31,7 @@ function poll_help($path, $arg) { ...@@ -31,7 +31,7 @@ function poll_help($path, $arg) {
* Implements hook_init(). * Implements hook_init().
*/ */
function poll_init() { function poll_init() {
drupal_add_css(drupal_get_path('module', 'poll') . '/poll.css'); drupal_add_css(drupal_get_path('module', 'poll') . '/poll.css', array('preprocess' => TRUE));
} }
/** /**
......
...@@ -97,6 +97,13 @@ function search_help($path, $arg) { ...@@ -97,6 +97,13 @@ function search_help($path, $arg) {
} }
} }
/**
* Implements hook_init().
*/
function search_init() {
drupal_add_css(drupal_get_path('module', 'search') . '/search.css', array('preprocess' => TRUE));
}
/** /**
* Implements hook_theme(). * Implements hook_theme().
*/ */
...@@ -875,9 +882,6 @@ function search_get_keys() { ...@@ -875,9 +882,6 @@ function search_get_keys() {
* An HTML string containing the search form. * An HTML string containing the search form.
*/ */
function search_form($form, &$form_state, $action = '', $keys = '', $type = NULL, $prompt = NULL) { function search_form($form, &$form_state, $action = '', $keys = '', $type = NULL, $prompt = NULL) {
// Add CSS
drupal_add_css(drupal_get_path('module', 'search') . '/search.css', array('preprocess' => FALSE));
if (!$action) { if (!$action) {
$action = 'search/' . $type; $action = 'search/' . $type;
} }
......
...@@ -53,7 +53,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase { ...@@ -53,7 +53,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase {
* Test behavior of ajax_render_error(). * Test behavior of ajax_render_error().
*/ */
function testAJAXRenderError() { function testAJAXRenderError() {
$result = $this->drupalGetAJAX('ajax-test/render-error'); $result = $this->discardSettings($this->drupalGetAJAX('ajax-test/render-error'));
// Verify default error message. // Verify default error message.
$this->assertEqual($result[0]['command'], 'alert', t('ajax_render_error() invokes alert command.')); $this->assertEqual($result[0]['command'], 'alert', t('ajax_render_error() invokes alert command.'));
$this->assertEqual($result[0]['text'], t('An error occurred while handling the request: The server received invalid input.'), t('Default error message is output.')); $this->assertEqual($result[0]['text'], t('An error occurred while handling the request: The server received invalid input.'), t('Default error message is output.'));
...@@ -61,7 +61,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase { ...@@ -61,7 +61,7 @@ class AJAXFrameworkTestCase extends AJAXTestCase {
$edit = array( $edit = array(
'message' => 'Custom error message.', 'message' => 'Custom error message.',
); );
$result = $this->drupalGetAJAX('ajax-test/render-error', array('query' => $edit)); $result = $this->discardSettings($this->drupalGetAJAX('ajax-test/render-error', array('query' => $edit)));
$this->assertEqual($result[0]['text'], $edit['message'], t('Custom error message is output.')); $this->assertEqual($result[0]['text'], $edit['message'], t('Custom error message is output.'));
} }
} }
......
...@@ -621,7 +621,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { ...@@ -621,7 +621,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
function testRenderInlinePreprocess() { function testRenderInlinePreprocess() {
$css = 'body { padding: 0px; }'; $css = 'body { padding: 0px; }';
$css_preprocessed = '<style type="text/css" media="all">' . drupal_load_stylesheet_content($css, TRUE) . '</style>'; $css_preprocessed = '<style type="text/css" media="all">' . drupal_load_stylesheet_content($css, TRUE) . '</style>';
drupal_add_css($css, 'inline'); drupal_add_css($css, array('type' => 'inline', 'preprocess' => TRUE));
$styles = drupal_get_css(); $styles = drupal_get_css();
$this->assertEqual(trim($styles), $css_preprocessed, t('Rendering preprocessed inline CSS adds it to the page.')); $this->assertEqual(trim($styles), $css_preprocessed, t('Rendering preprocessed inline CSS adds it to the page.'));
} }
...@@ -631,7 +631,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { ...@@ -631,7 +631,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
*/ */
function testRenderInlineNoPreprocess() { function testRenderInlineNoPreprocess() {
$css = 'body { padding: 0px; }'; $css = 'body { padding: 0px; }';
drupal_add_css($css, array('type' => 'inline', 'preprocess' => FALSE)); drupal_add_css($css, array('type' => 'inline'));
$styles = drupal_get_css(); $styles = drupal_get_css();
$this->assertTrue(strpos($styles, $css) > 0, t('Rendering non-preprocessed inline CSS adds it to the page.')); $this->assertTrue(strpos($styles, $css) > 0, t('Rendering non-preprocessed inline CSS adds it to the page.'));
} }
...@@ -641,7 +641,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { ...@@ -641,7 +641,7 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
*/ */
function testRenderInlineFullPage() { function testRenderInlineFullPage() {
$css = 'body { font-size: 254px; }'; $css = 'body { font-size: 254px; }';
$expected = 'font-size:254px;'; $expected = $css;
// Create a node, using the PHP filter that tests drupal_add_css(). // Create a node, using the PHP filter that tests drupal_add_css().
$php_format_id = db_query_range('SELECT format FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'PHP code'))->fetchField(); $php_format_id = db_query_range('SELECT format FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'PHP code'))->fetchField();
......
...@@ -1066,6 +1066,7 @@ function system_library() { ...@@ -1066,6 +1066,7 @@ function system_library() {
'js' => array( 'js' => array(
'misc/jquery.js' => array('weight' => JS_LIBRARY - 20), 'misc/jquery.js' => array('weight' => JS_LIBRARY - 20),
), ),
'preprocess' => TRUE,
); );
// jQuery Once. // jQuery Once.
...@@ -1076,6 +1077,7 @@ function system_library() { ...@@ -1076,6 +1077,7 @@ function system_library() {
'js' => array( 'js' => array(
'misc/jquery.once.js' => array('weight' => JS_LIBRARY - 19), 'misc/jquery.once.js' => array('weight' => JS_LIBRARY - 19),
), ),
'preprocess' => TRUE,
); );
// jQuery Form Plugin. // jQuery Form Plugin.
...@@ -1120,7 +1122,7 @@ function system_library() { ...@@ -1120,7 +1122,7 @@ function system_library() {
'misc/farbtastic/farbtastic.js' => array(), 'misc/farbtastic/farbtastic.js' => array(),
), ),