summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/simpletest/tests/common.test14
-rw-r--r--modules/system/system.module8
2 files changed, 16 insertions, 6 deletions
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 7b64d46c4..9a93d75c8 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -558,7 +558,9 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
$css = 'http://example.com/style.css';
drupal_add_css($css, 'external');
$styles = drupal_get_css();
- $this->assertTrue(strpos($styles, 'href="' . $css) > 0, t('Rendering an external CSS file.'));
+ // Stylesheet URL may be the href of a LINK tag or in an @import statement
+ // of a STYLE tag.
+ $this->assertTrue(strpos($styles, 'href="' . $css) > 0 || strpos($styles, '@import url("' . $css . '")') > 0, t('Rendering an external CSS file.'));
}
/**
@@ -566,10 +568,10 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
*/
function testRenderInlinePreprocess() {
$css = 'body { padding: 0px; }';
- $css_preprocessed = '<style type="text/css">' . 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');
$styles = drupal_get_css();
- $this->assertEqual($styles, "\n" . $css_preprocessed . "\n", 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,8 +633,10 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase {
$styles = drupal_get_css();
- if (preg_match_all('/href="' . preg_quote($GLOBALS['base_url'] . '/', '/') . '([^?]+)\?/', $styles, $matches)) {
- $result = $matches[1];
+ // Stylesheet URL may be the href of a LINK tag or in an @import statement
+ // of a STYLE tag.
+ if (preg_match_all('/(href="|url\(")' . preg_quote($GLOBALS['base_url'] . '/', '/') . '([^?]+)\?/', $styles, $matches)) {
+ $result = $matches[2];
}
else {
$result = array();
diff --git a/modules/system/system.module b/modules/system/system.module
index 56c63f198..5536cc757 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -311,12 +311,18 @@ function system_element_info() {
$types['ajax_commands'] = array(
'#ajax_commands' => array(),
);
-
$types['html_tag'] = array(
'#theme' => 'html_tag',
+ '#pre_render' => array('drupal_pre_render_conditional_comments'),
'#attributes' => array(),
'#value' => NULL,
);
+ $types['styles'] = array(
+ '#items' => array(),
+ '#pre_render' => array('drupal_pre_render_styles'),
+ '#group_callback' => 'drupal_group_css',
+ '#aggregate_callback' => 'drupal_aggregate_css',
+ );
// Input elements.
$types['submit'] = array(